/* Supplier portal, styled after the Inner Child Hub. Light by default; dark when the user picks it in Settings. */
:root {
  --page: #fcfaf3; --bg: #ffffff; --ink: #171717; --text: #5c5c5c; --line: #ebe7e0; --soft: #f8f5ee; --hover: #f3efe6;
  --acc: #c16452; --acc-soft: #f6e4df; --acc-ink: #ffffff; --btn: #232323; --btn-fg: #ffffff;
  --ok: #3f7a4a; --ok-soft: #e3efe2; --warn: #9a5f12; --warn-soft: #f8ecd6; --bad: #b0352a; --bad-soft: #f8e3e0;
  --info: #4a4fb0; --info-soft: #e9e9fb;
  --air: #8a4b8f; --air-soft: #f5e8f6; --sea: #44708a; --sea-soft: #e4edf1; --step-off: #e2ddd4; --step-on: #171717;
  --f: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --page: #1c1a18; --bg: #141312; --ink: #f3efe8; --text: #b8b1a7; --line: #2d2925; --soft: #211f1c; --hover: #27241f;
  --acc: #e0907c; --acc-soft: #3a2420; --acc-ink: #141312; --btn: #f3efe8; --btn-fg: #141312;
  --ok: #8cc79a; --ok-soft: #1c2b1f; --warn: #e5b66a; --warn-soft: #33270f; --bad: #f0948a; --bad-soft: #3d1f1c;
  --info: #aeb2ff; --info-soft: #23264a; --air: #e0a5e4; --air-soft: #35203a; --sea: #8fc0ec; --sea-soft: #182b3d;
  --step-off: #38332d; --step-on: #f3efe8;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--page); color: var(--text); font-family: var(--f); font-size: 15px; line-height: 1.5; margin: 0; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
h1, h2, h3 { color: var(--ink); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0; }
.gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.inner { max-width: 1160px; margin: 0 auto; }

header.top { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 6; }
header.top .inner { display: flex; align-items: center; gap: 18px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { height: 36px; width: auto; display: block; }
.brand small { font-weight: 700; color: var(--text); font-size: .68rem; text-transform: uppercase; letter-spacing: .18em; }
.logo-d { display: none !important; }
:root[data-theme="dark"] .logo-l { display: none !important; } :root[data-theme="dark"] .logo-d { display: block !important; }
.nav { display: flex; gap: 4px; margin-right: auto; flex-wrap: wrap; }
.nav a { white-space: nowrap; color: var(--text); text-decoration: none; padding: 6px 10px; border-radius: 4px; font-weight: 600; font-size: .88rem; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--hover); }
.who { font-size: .84rem; color: var(--text); }
.hbtn { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 4px; padding: 5px 10px; font-size: .8rem; font-weight: 600; text-decoration: none; display: inline-block; }
details.settings { position: relative; }
details.settings summary { list-style: none; }
details.settings summary::-webkit-details-marker { display: none; }
.setpop { position: absolute; right: 0; top: calc(100% + 8px); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px; width: 230px; display: grid; gap: 10px; z-index: 9; }
.setpop b { color: var(--ink); font-size: .9rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--bg); }
.seg button { border: 0; background: transparent; padding: 5px 12px; font-size: .82rem; font-weight: 600; color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--btn); color: var(--btn-fg); }

main { padding-block: 24px 150px; }
main > .inner { display: grid; gap: 18px; }
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.pad { padding: 18px 20px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text); font-weight: 700; background: var(--soft); }
td { color: var(--ink); }
.num { text-align: right; }
.muted { color: var(--text); }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--hover); }
tr.click a { color: inherit; text-decoration: none; font-weight: 700; }
tfoot td { font-weight: 700; background: var(--soft); }

table.lines { table-layout: fixed; min-width: 880px; }
table.lines td { height: 48px; }
table.lines td.prod { overflow: hidden; text-overflow: ellipsis; }
tr.changed td { background: var(--info-soft); }
tr.cant td { background: var(--bad-soft); }
tr.cant td.prod { text-decoration: line-through; }
td.sku { color: var(--text); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; }
td input[type="number"], .cv { display: inline-block; width: 100px; border: 1px solid transparent; border-radius: 4px; padding: 4px 8px; text-align: right; background: transparent; line-height: 1.5; }
td input[type="number"] { border-color: var(--line); background: var(--bg); }
td input.dirty { border-color: var(--info); box-shadow: 0 0 0 1px var(--info); }
.was { font-size: .78rem; color: var(--text); text-decoration: line-through; margin-right: 6px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.t-air { background: var(--air-soft); color: var(--air); } .t-sea { background: var(--sea-soft); color: var(--sea); }
.t-wait { background: var(--acc-soft); color: var(--acc); } .t-prop { background: var(--info-soft); color: var(--info); } .t-ok { background: var(--ok-soft); color: var(--ok); }
.t-bad { background: var(--bad-soft); color: var(--bad); } .t-quiet { background: var(--warn-soft); color: var(--warn); } .t-mute { background: var(--hover); color: var(--text); }

.pohead { display: grid; gap: 14px; padding: 18px 20px; }
.pohead .r { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 30px; }
.facts div { display: grid; }
.facts span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--text); }
.facts b { color: var(--ink); font-size: 1.05rem; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 520px; }
.steps div { display: grid; gap: 4px; font-size: .74rem; font-weight: 600; }
.steps i { height: 6px; border-radius: 3px; background: var(--step-off); }
.steps .d i { background: var(--step-on); } .steps .now i { background: var(--acc); } .steps .now { color: var(--acc); }

.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tools .grow { margin-right: auto; }
.search, select.inp, input.inp { border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; background: var(--bg); }
.search { min-width: 220px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 12px; font-size: .82rem; font-weight: 600; color: var(--text); text-decoration: none; }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.linkbtn { border: 0; background: none; color: var(--ink); font-weight: 400; padding: 0; font-size: .86rem; text-decoration: underline; text-underline-offset: 2px; }

.btn { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 4px; padding: 11px 18px; font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-fg); }
.btn.primary:hover { opacity: .88; }
.btn.danger { color: var(--bad); border-color: var(--bad); background: var(--bg); }
.btn.sm { padding: 6px 10px; font-size: .68rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.decide { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.decide .inner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-block: 14px; }
.decide .msg { margin-right: auto; display: grid; gap: 2px; min-width: 0; }
.decide .msg b { color: var(--ink); font-size: 1rem; }
.decide .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet { display: grid; gap: 12px; padding: 16px 20px; background: var(--soft); border-radius: 8px; }
.sheet .q { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { border: 2px solid var(--line); background: var(--bg); border-radius: 4px; padding: 8px 14px; font-weight: 700; color: var(--ink); }
.opt[aria-pressed="true"] { border-color: var(--acc); background: var(--acc-soft); }
textarea, .field input { width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; background: var(--bg); }
.field { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--ink); }
.field input[type="date"] { max-width: 220px; }
.delta-up { color: var(--bad); font-weight: 700; } .delta-down { color: var(--ok); font-weight: 700; }
.note { background: var(--soft); border-radius: 4px; padding: 12px 14px; font-size: .9rem; }
.note b { color: var(--ink); }
.note.info { background: var(--info-soft); } .note.warn { background: var(--warn-soft); } .note.bad { background: var(--bad-soft); }
.empty { padding: 28px; text-align: center; color: var(--text); }
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 4px; font-weight: 600; font-size: .9rem; z-index: 20; max-width: calc(100% - 32px); }
.toast.err { background: var(--bad); color: #fff; }
.lede { max-width: 70ch; }
.check { width: 16px; height: 16px; accent-color: var(--acc); }
.fseg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.fseg button { border: 0; background: var(--bg); padding: 2px 9px; font-size: .74rem; font-weight: 700; color: var(--text); }
.fseg button[aria-pressed="true"].sea { background: var(--sea); color: var(--bg); }
.fseg button[aria-pressed="true"].air { background: var(--air); color: var(--bg); }
.mob-only, .mob-block { display: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; display: grid; gap: 2px; }
.stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.stat b { color: var(--ink); font-size: 1.5rem; }
.events { list-style: none; margin: 0; padding: 0; display: grid; }
.events li { padding: 8px 16px; border-top: 1px solid var(--line); font-size: .86rem; display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .panel { width: 100%; max-width: 420px; padding: 28px; display: grid; gap: 16px; }
.auth input[type="email"], .auth input[type="password"] { width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; background: var(--bg); color: var(--ink); font-size: .95rem; }
.auth .btn { width: 100%; text-align: center; }
.auth .brand { flex-direction: column; justify-self: center; gap: 6px; }
.auth .brand img { height: auto; width: 220px; max-width: 100%; }

@media (max-width: 720px) {
  .search { min-width: 0; flex: 1 1 100%; }
  .decide .acts { width: 100%; } .decide .acts .btn { flex: 1; padding-inline: 8px; }
  header.top .inner { gap: 10px; }
  header.top .who { display: none; }
  details.settings { margin-left: auto; }
  .mob-block { display: block; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .setpop { position: fixed; right: 16px; top: 64px; }
  .mob-only { display: inline; }
  .hm { display: none; }
  table.lines, table.lines tbody { display: block; min-width: 0; }
  table.lines thead, table.lines colgroup { display: none; }
  table.lines tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: center; }
  table.lines tr.changed { background: var(--info-soft); } table.lines tr.cant { background: var(--bad-soft); }
  table.lines td { display: block; height: auto; border: 0; padding: 0; white-space: normal; background: transparent !important; }
  table.lines td.selc:empty { display: none; }
  table.lines td.selc { grid-column: 1 / -1; }
  table.lines td.prod { grid-column: 1 / -1; font-weight: 700; }
  table.lines td.sku { grid-column: 1 / -1; margin-bottom: 6px; }
  table.lines td.num { text-align: left; font-size: .9rem; }
  table.lines td.num::before { content: attr(data-l); display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
  table.lines td.num .cv, table.lines td.num input { text-align: left; padding-left: 0; width: 100%; max-width: 110px; }
  table.lines td.num input { padding-left: 8px; }
  table.lines td.frc { grid-column: 1 / span 2; margin-top: 6px; min-height: 34px; display: flex; align-items: center; }
  table.lines td.lastc { grid-column: 3; margin-top: 6px; justify-self: end; min-height: 34px; display: flex; align-items: center; }
  table.lines td.lastc label { display: inline-flex; gap: 6px; align-items: center; font-size: .82rem; }
  table.lines tr.empty-r { display: block; }
}
