/* GMP Stok & Harga — gaya aplikasi (sama dengan rancangan di canvas) */
@font-face { font-family: "PJS"; src: url(/fonts/pjs-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PJS"; src: url(/fonts/pjs-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "PJS"; src: url(/fonts/pjs-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PJS"; src: url(/fonts/pjs-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "PJS"; src: url(/fonts/pjs-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "PlexMono"; src: url(/fonts/plexmono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PlexMono"; src: url(/fonts/plexmono-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #f3f4f2; --surface: #fff; --surface-2: #eceeeb; --line: #d3d7d2; --line-2: #c9cdc8;
  --ink: #202327; --ink-2: #4f545b; --ink-3: #80858c; --dark: #202327; --dark-2: #3a3f46;
  --blue: #2a63d4; --blue-bg: #e3ecfd; --blue-ink: #1d4aa3;
  --violet: #7448d0; --violet-bg: #eee7fb; --violet-ink: #5a35a8;
  --amber: #b25f00; --amber-bg: #fdefd9; --amber-ink: #8a4a00; --amber-line: #f0c27a;
  --green: #2a7f39; --green-bg: #e0f2e2; --green-ink: #1f6a2c;
  --teal: #0a7f84; --teal-bg: #daf1f1; --teal-ink: #0a6b6f;
  --red: #c0302a; --red-bg: #fbe5e3; --red-ink: #9b241f;
  --changed: #efe8fb; --changed-line: #b9a2ea; --override: #e6effd; --override-line: #9fbbef;
  --f-ui: "PJS", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "PlexMono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 13.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); } a:hover { color: var(--blue-ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--ink-3); } .sub { font-size: 12px; color: var(--ink-2); }
.boot { padding: 40px; color: var(--ink-3); }

/* layout */
.top { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 10px 20px; background: var(--dark); color: #fff; padding-top: calc(10px + env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 220px; }
.brand img { width: 30px; height: 30px; }
.brand .eyebrow { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #b9bec5; }
.brand h1 { margin: 0; font-size: 16px; font-weight: 800; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav a { color: #b9bec5; text-decoration: none; padding: 7px 11px; border-radius: 6px; font-weight: 600; }
.nav a.on { color: #fff; background: var(--dark-2); }
.nav a:hover { color: #fff; }
.who { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--violet); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: none; }
.avatar.sm { width: 20px; height: 20px; font-size: 10px; }
.iconbtn { position: relative; width: 38px; height: 38px; border-radius: 8px; border: 1px solid #4a5058; background: transparent; color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.badge-dot { position: absolute; top: -5px; right: -5px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }
main.page { padding: 16px 20px 60px; max-width: 1680px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.section-h { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
h2.title { margin: 0; font-size: 18px; font-weight: 800; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 6px; padding: 0 12px; min-height: 36px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--dark); color: #fff; border-color: var(--dark); }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--red-ink); }
.btn.sm { min-height: 28px; padding: 0 8px; font-size: 12px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.input, select.input, textarea.input { border: 1px solid var(--line-2); background: #fff; border-radius: 6px; padding: 7px 10px; min-height: 36px; width: 100%; }
textarea.input { min-height: 64px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.req { color: var(--red); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 0 12px; min-height: 34px; font-weight: 600; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--dark); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 0 12px; min-height: 32px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--dark); color: #fff; border-color: var(--dark); }
.chip .n { font-family: var(--f-mono); font-size: 12px; opacity: .7; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.toolbar .search { flex: 1 1 280px; }

/* pills & tags */
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-baru { color: var(--blue-ink); background: var(--blue-bg); }
.st-dicek { color: var(--violet-ink); background: #f0eafc; }
.st-vendor { color: var(--violet-ink); background: var(--violet-bg); }
.st-konf { color: var(--amber-ink); background: var(--amber-bg); }
.st-dijawab { color: var(--green-ink); background: var(--green-bg); }
.st-kirim { color: var(--teal-ink); background: var(--teal-bg); }
.st-tidak, .st-batal { color: var(--ink-2); background: #ebecee; }
.st-open { color: var(--blue-ink); background: var(--blue-bg); }
.st-partial { color: var(--violet-ink); background: var(--violet-bg); }
.st-answered { color: var(--green-ink); background: var(--green-bg); }
.st-sent { color: var(--teal-ink); background: var(--teal-bg); }
.st-cancelled { color: var(--ink-2); background: #ebecee; }
.tag { display: inline-block; border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.tag.red { color: var(--red-ink); background: var(--red-bg); } .tag.amber { color: var(--amber-ink); background: var(--amber-bg); }
.tag.green { color: var(--green-ink); background: var(--green-bg); } .tag.gray { color: var(--ink-2); background: #ebecee; }
.age { font-family: var(--f-mono); font-weight: 700; font-size: 11px; border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.age.green { background: var(--green-bg); color: var(--green-ink); } .age.yellow { background: var(--amber-bg); color: var(--amber-ink); } .age.red { background: var(--red-bg); color: var(--red-ink); }
.rail-green { box-shadow: inset 4px 0 0 var(--green); } .rail-yellow { box-shadow: inset 4px 0 0 #d98a00; } .rail-red { box-shadow: inset 4px 0 0 var(--red); }

/* banners */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-radius: var(--r); padding: 10px 14px; border: 1px solid var(--line); background: #fff; }
.banner.amber { background: #fdf3e2; border-color: var(--amber-line); color: #6b3a00; }
.banner.violet { background: #f3eefc; border-color: var(--changed-line); color: #4a2b8f; }
.banner.red { background: var(--red-bg); border-color: #efb3ad; color: var(--red-ink); }
.banner.blue { background: #eef1f8; border-color: #c8d4ee; color: #1d3a7a; }

/* tables */
.tablewrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: auto; max-height: calc(100vh - 230px); }
table.t { border-collapse: separate; border-spacing: 0; width: 100%; }
table.t th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.t th .rs { position: absolute; top: 0; right: 0; bottom: 0; width: 7px; cursor: col-resize; border-right: 2px solid var(--line-2); opacity: .6; }
table.t th .rs:hover { opacity: 1; border-right-color: var(--blue); }
table.t td { padding: 6px 8px; border-bottom: 1px solid #e3e6e2; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #f7f8f6; }
table.t tr.group td { background: #eef1f8; white-space: normal; }
table.t tr.brand td { background: var(--dark); color: #fff; font-weight: 800; }
table.t tr.sel td { background: #fffaf0; }
table.t tr.locked td { color: var(--ink-3); }
table.t td.calc { background: #f6f7f5; }
table.t td.warn { background: var(--red-bg); color: var(--red-ink); font-weight: 700; }
table.t td.changed { background: var(--changed); box-shadow: inset 0 0 0 1px var(--changed-line); }
table.t td.override { background: var(--override); box-shadow: inset 0 0 0 1px var(--override-line); }
table.t td.cell-edit { padding: 2px 4px; }
.cellin { width: 100%; min-width: 50px; border: 1px solid var(--line-2); border-radius: 4px; padding: 4px 6px; background: #fff; font-family: inherit; }
.cellin.num { text-align: right; font-family: var(--f-mono); }
.cellin:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 2px #2a63d433; }
td.focus-cell { box-shadow: inset 0 0 0 2px var(--blue); }

/* board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; align-items: start; padding-bottom: 6px; }
.col { background: var(--surface-2); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.col.auto { background: #f0eeea; outline: 2px dashed #d3c4a8; outline-offset: -2px; }
.col.over { outline: 2px dashed var(--blue); outline-offset: -2px; }
.col.blocked { opacity: .45; }
.col-h { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px; font-weight: 800; }
.col-h .n { font-size: 12px; color: var(--ink-2); font-family: var(--f-mono); font-weight: 400; }
.kcard { background: #fff; border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; text-align: left; }
.kcard.green { border-left-color: var(--green); } .kcard.yellow { border-left-color: #d98a00; } .kcard.red { border-left-color: var(--red); }
.kcard[draggable=true] { cursor: grab; }
.bar { flex: 1; display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #e3e6e2; }
.bar span { display: block; height: 8px; }
.bg-baru { background: var(--blue); } .bg-dicek { background: var(--violet); } .bg-vendor { background: var(--violet-ink); } .bg-konf { background: var(--amber); } .bg-dijawab { background: var(--green); } .bg-kirim { background: var(--teal); } .bg-tidak { background: var(--ink-3); }

/* modal */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(20,22,26,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; box-shadow: 0 16px 40px rgba(20,22,26,.25); width: min(780px, 100%); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.modal.wide { width: min(1100px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.modal-h h3 { margin: 0; font-size: 15px; font-weight: 800; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; background: var(--dark); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100% - 32px); }
.toast.err { background: var(--red-ink); }

/* history & photos */
.lightbox { position: relative; height: 340px; border-radius: 8px; background: #2b2f34; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lightbox img { max-width: 100%; max-height: 100%; }
.lightbox .nav-l, .lightbox .nav-r { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); cursor: pointer; font-size: 18px; }
.lightbox .nav-l { left: 8px; } .lightbox .nav-r { right: 8px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs img, .thumbs .pdf { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; cursor: pointer; background: #e3e6e2; }
.thumbs .on { border-color: var(--blue); }
.thumbs .pdf { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.watermark { position: fixed; inset: 0; pointer-events: none; z-index: 5; background-repeat: repeat; opacity: .05; }

/* auth */
.authwrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.authcard { width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.authcard h1 { margin: 0; font-size: 20px; font-weight: 800; }
.qr { display: flex; justify-content: center; } .qr img { width: 200px; height: 200px; image-rendering: pixelated; }

@media (max-width: 760px) {
  .top { padding: 8px 12px; } main.page { padding: 12px 12px 80px; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .hide-m { display: none !important; }
  .tablewrap { max-height: none; }
  .board { grid-auto-columns: 82%; }
}
@media (prefers-reduced-motion: no-preference) { .modal { animation: pop .14s ease-out; } @keyframes pop { from { transform: translateY(8px); opacity: .6; } } }
.input.override { background: var(--override); border-color: var(--override-line); }
.tabs-v { display:flex; flex-wrap:wrap; gap:6px; }
table.t.compact td, table.t.compact th { padding: 4px 6px; }
table.t td input.input { padding: 4px 6px; min-height: 0; }
label.f .req { display: inline; }
.only-m { display: none; }
@media (max-width: 760px) {
  .only-m { display: flex; }
  .mline { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
  .mline.green { border-left-color: var(--green); } .mline.yellow { border-left-color: #d98a00; } .mline.red { border-left-color: var(--red); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .kpis .card { padding: 8px 10px; } .kpis .mono { font-size: 15px !important; }
}
a.chip { text-decoration: none; color: inherit; }
