/* Splise PO intake demo. Tokens from brand/tokens.json. */
:root {
  --midnight: #0B1A2E; --cobalt: #3D6BFF; --cobalt-deep: #2F5BEB; --cobalt-light: #8FA9FF;
  --ice: #F3F5F8; --white: #FBFCFD; --fog: #E3E8EF; --line: #CDD5E0; --slate: #4A5568; --steel: #9AA6B8; --deep: #16263D;
  --approve: #178A55; --approve-bg: #E3F3EA; --flag: #9A6412; --flag-bg: #FBF1DF;
  --sans: "Schibsted Grotesk", Arial, sans-serif;
  --mono: "JetBrains Mono", "Courier New", monospace;
  --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--ice); color: var(--midnight); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--cobalt-deep); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--slate); }
.small { font-size: 14px; line-height: 20px; }
[hidden] { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 16px/1 var(--sans); padding: 13px 20px; border-radius: 8px; border: 1px solid var(--cobalt-deep); background: var(--cobalt-deep); color: var(--white); cursor: pointer; text-decoration: none; }
.btn:hover { background: #2550d6; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--cobalt-deep); }
.btn-ghost:hover { background: rgba(47, 91, 235, .08); }
.btn-small { padding: 9px 14px; font-size: 14px; }

.top { border-bottom: 1px solid var(--line); background: var(--ice); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand img { display: block; height: 30px; width: auto; }
.top-nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.top-nav a:not(.btn) { color: var(--midnight); text-decoration: none; }

.intro { padding-top: 56px; padding-bottom: 28px; }
.eyebrow { font: 500 14px/20px var(--sans); color: var(--slate); margin-bottom: 12px; }
h1 { font-size: clamp(34px, 3vw + 18px, 52px); line-height: 1.08; letter-spacing: -0.02em; max-width: 20ch; }
.lede { font-size: 19px; line-height: 30px; color: var(--slate); max-width: 64ch; margin-top: 18px; }
.banner { margin-top: 22px; padding: 14px 16px; border-radius: 8px; font-size: 15px; }
.banner-flag { background: var(--flag-bg); color: #6b4609; border: 1px solid #ecd3a4; }

.step { padding-top: 28px; padding-bottom: 12px; }
.step h2, .step-wide h2 { font-size: 24px; line-height: 32px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--midnight); color: var(--white); font-size: 14px; }

.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { text-align: left; font: inherit; color: inherit; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.card:hover { border-color: var(--steel); }
.card[aria-pressed="true"] { border-color: var(--cobalt-deep); box-shadow: 0 0 0 2px var(--cobalt-deep) inset; }
.card-kind { font: 500 13px/18px var(--mono); color: var(--slate); }
.card h3 { font-size: 17px; line-height: 24px; }
.card p { font-size: 14px; line-height: 20px; color: var(--slate); }
.tag { display: inline-block; font: 500 12px/18px var(--sans); color: var(--slate); background: var(--fog); border-radius: 999px; padding: 1px 9px; width: fit-content; }

.own { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.own-card { background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.own-card h3 { font-size: 17px; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn { position: relative; }
textarea { width: 100%; font: 400 14px/20px var(--mono); border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: var(--ice); color: var(--midnight); resize: vertical; }

.run-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.doc-name { font-weight: 600; }
.status { margin-top: 12px; min-height: 24px; font-size: 15px; }
.status .ok { color: var(--approve); font-weight: 500; }
.status .err { color: #a32a2a; font-weight: 500; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--cobalt-deep); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.step-wide { padding-top: 28px; padding-bottom: 12px; }
.step-wide > .wrap > .muted { max-width: 72ch; margin-bottom: 16px; }
.split { display: grid; grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.5fr); gap: 16px; align-items: start; max-width: 1480px; }
.source { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: 12px; }
.pane-head { font: 500 14px/20px var(--sans); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--fog); display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.source-body { height: min(78vh, 860px); overflow: auto; background: #e9edf2; }
.source-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.source-body img, .source-body .pdf-page { width: 100%; display: block; }
.source-body .pdf-page { background: #fff; margin-bottom: 8px; }
.pdf-note { padding: 8px 12px; background: var(--white); border-bottom: 1px solid var(--line); }
.source-body pre { margin: 0; padding: 16px; white-space: pre-wrap; font: 400 13px/20px var(--mono); background: var(--white); min-height: 100%; }

/* ---- Mock ERP: dense, boxy, classic dealer-system feel (no vendor styling copied) ---- */
.erp { background: #f4f5f7; border: 1px solid #9aa6b8; border-radius: 4px; font-size: 13px; overflow: hidden; box-shadow: 0 1px 2px rgba(11,26,46,.08), 0 14px 30px rgba(11,26,46,.10); }
.erp-title { display: flex; justify-content: space-between; align-items: center; background: var(--midnight); color: var(--white); padding: 7px 10px; font: 500 13px/18px var(--sans); }
.erp-mock { background: var(--flag-bg); color: #6b4609; font-weight: 600; padding: 1px 8px; border-radius: 3px; font-size: 12px; }
.erp-menu { display: flex; gap: 16px; padding: 4px 10px; background: #e3e8ef; border-bottom: 1px solid #b9c3d1; color: var(--slate); font-size: 12px; }
.erp-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 12px; padding: 10px; border-bottom: 1px solid #b9c3d1; background: #f9fafb; }
.fld { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fld.wide { grid-column: span 2; }
.fld label, .fld .lbl { font-size: 11px; color: var(--slate); display: flex; align-items: center; gap: 6px; }
.fld .val { font: 400 12.5px/18px var(--mono); background: var(--white); border: 1px solid #b9c3d1; border-top-color: #8e9bb0; padding: 3px 6px; min-height: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fld select, .erp input, .erp select { font: 400 12.5px/18px var(--mono); border: 1px solid #8e9bb0; background: var(--white); padding: 3px 4px; color: var(--midnight); max-width: 100%; }
.erp-grid-wrap { overflow-x: auto; background: var(--white); }
.erp-grid { width: 100%; border-collapse: collapse; font: 400 12.5px/18px var(--mono); }
.erp-grid th { position: sticky; top: 0; background: #dfe4eb; text-align: left; font: 500 11.5px/16px var(--sans); color: var(--slate); padding: 5px 8px; border-bottom: 1px solid #b9c3d1; border-right: 1px solid #cdd5e0; white-space: nowrap; }
.erp-grid td { padding: 5px 8px; border-bottom: 1px solid #e3e8ef; border-right: 1px solid #eef1f5; vertical-align: top; }
.erp-grid tr.row:nth-of-type(4n+1) td { background: #fbfcfd; }
.erp-grid .r { text-align: right; }
.erp-grid tr.row { cursor: pointer; }
.erp-grid tr.row:hover td { background: #eef3ff; }
.erp-grid tr.row.is-review td { background: #fdf6e8; }
.erp-grid tr.row.is-removed td { color: var(--steel); text-decoration: line-through; }
.erp-grid td.desc { font-family: var(--sans); font-size: 13px; min-width: 220px; }
.erp-grid td.desc .po { display: block; color: var(--slate); font-size: 11.5px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font: 600 11.5px/16px var(--sans); padding: 1px 7px; border-radius: 3px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--approve); background: var(--approve-bg); }
.pill-flag { color: var(--flag); background: var(--flag-bg); }
.pill-done { color: var(--cobalt-deep); background: #e6ecff; }
.pill-off { color: var(--slate); background: var(--fog); }
tr.detail td { background: #fffdf8; padding: 10px 12px 14px; border-bottom: 1px solid #d9cbb0; }
tr.detail.okd td { background: #f6fbf8; border-bottom-color: #cfe5d8; }
.why { font: 400 13px/19px var(--sans); color: var(--midnight); margin: 0 0 10px; padding-left: 18px; }
.fix { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; font-family: var(--sans); }
.fix label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--slate); }
.fix .item-sel { min-width: 260px; }
.fix .search { width: 220px; }
.fix .qty { width: 90px; text-align: right; }
.fix button { font: 500 12.5px/1 var(--sans); padding: 7px 12px; border-radius: 4px; border: 1px solid #8e9bb0; background: #eef1f5; cursor: pointer; color: var(--midnight); }
.fix button.go { background: var(--cobalt-deep); border-color: var(--cobalt-deep); color: var(--white); }
.fix button:disabled { opacity: .5; cursor: not-allowed; }
.erp-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; background: #e3e8ef; border-top: 1px solid #b9c3d1; flex-wrap: wrap; }
.erp-totals { font: 400 12.5px/18px var(--mono); display: flex; gap: 16px; flex-wrap: wrap; }
.erp-keys { display: flex; gap: 8px; }
.fkey { font: 500 12.5px/1 var(--sans); padding: 8px 12px; border: 1px solid #8e9bb0; border-radius: 3px; background: linear-gradient(#fbfcfd, #e9edf2); cursor: pointer; color: var(--midnight); }
.fkey b { font-family: var(--mono); font-weight: 500; color: var(--slate); margin-right: 4px; }
.fkey-go:not(:disabled) { background: var(--cobalt-deep); border-color: var(--cobalt-deep); color: var(--white); }
.fkey-go:not(:disabled) b { color: var(--cobalt-light); }
.fkey:disabled { opacity: .55; cursor: not-allowed; }
.erp-msg { padding: 0 10px; font: 400 13px/19px var(--sans); }
.erp-msg:not(:empty) { padding: 9px 10px; border-top: 1px solid #b9c3d1; background: #f9fafb; }
.erp-msg .done { color: var(--approve); font-weight: 600; }
.erp.released .erp-title { background: #10301f; }

.raw { margin-top: 14px; }
.raw summary { cursor: pointer; color: var(--cobalt-deep); font-size: 15px; }
.raw pre { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 12px; line-height: 18px; overflow: auto; max-height: 420px; }

.honest { padding-top: 56px; padding-bottom: 40px; }
.honest h2 { font-size: 28px; line-height: 36px; margin-bottom: 18px; }
.honest .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.honest .cols > div { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.honest h3 { font-size: 17px; margin-bottom: 6px; }
.honest ul { margin: 0; padding-left: 18px; color: var(--slate); }
.honest li { margin: 6px 0; }
.foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 22px; padding-bottom: 40px; border-top: 1px solid var(--line); font-size: 15px; flex-wrap: wrap; }

@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .source { position: static; }
  .source-body { height: 60vh; }
  .erp-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .own, .honest .cols { grid-template-columns: 1fr; }
  .run-bar { flex-direction: column; align-items: stretch; }
  .top-nav a:not(.btn) { display: none; }
  .erp-head { grid-template-columns: 1fr; }
  .fld.wide { grid-column: auto; }
}
