/* gdg — warehouse app. Off-white ground, coral accent, white cards. */

:root {
  color-scheme: light;
  --bg: #f5f5f3;
  --paper: #fff;
  --ink: #24282d;
  --muted: #68717a;
  --line: #e0e3e5;
  --soft: #f0f2f2;
  --accent: #d64a34;
  --tint: #fff0e9;
  --good: #22824e;
  --amber: #bb780b;
  --red: #bc3537;
  --slate: #4a5a6a;
  --r: 8px;
}

* { box-sizing: border-box }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 -apple-system, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit }
button, summary { cursor: pointer; touch-action: manipulation }
button { border: 0; background: none }
button:disabled { opacity: .45; cursor: default }
h1, h2, h3, p { margin: 0 }
h2 { font-size: 15px; letter-spacing: -.2px }
h3 { font-size: 13px }
:focus-visible { outline: 3px solid #f5b49b; outline-offset: 2px }

.num { font-variant-numeric: tabular-nums }
.muted { color: var(--muted) }
.small { font-size: 12px }
.r { text-align: right; white-space: nowrap }
.push { margin-left: auto }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
.skip:focus { position: fixed; top: 8px; left: 8px; background: var(--paper); padding: 12px; z-index: 60; border-radius: 6px }

/* Buttons. `.primary` is also used on the <a> that opens the print file. */
.primary, .ghost, .link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  white-space: nowrap;
  text-decoration: none;
}
.primary {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 9px 16px;
  min-height: 38px;
}
.primary:hover:not(:disabled) { background: #bd3e2c }
.ghost {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-size: 13px;
  min-height: 38px;
}
.ghost:hover:not(:disabled) { background: var(--soft) }
.link { color: var(--accent); font-size: 12px; padding: 4px 6px }
.link:hover:not(:disabled) { background: var(--tint) }
.link.quiet { color: var(--muted) }

/* Brand + header */
.brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 650; white-space: nowrap }
.mark {
  display: grid; place-items: center;
  width: 29px; height: 29px;
  background: var(--accent); color: #fff;
  border-radius: 8px; font-size: 17px;
}

.top { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10 }
.top-inner {
  max-width: 1440px; margin: auto;
  min-height: 62px;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 24px;
}
.top-tools { display: flex; align-items: center; gap: 10px; margin-left: auto }
.top-tools select { max-width: 200px }
.who { font-size: 12px; color: var(--muted) }
.language { font-size: 12px; font-weight: 600; color: var(--muted); padding: 7px 9px; border-radius: 6px }
.language:hover { background: var(--soft) }

select, input[type="search"], input[type="text"], input[type="time"], input[type="password"] {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 6px;
  min-width: 0;
}

.menubar {
  max-width: 1440px; margin: auto;
  display: flex; align-items: center; gap: 22px;
  padding: 0 24px;
  overflow-x: auto;
}
.menu-tab {
  padding: 2px 0 11px;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.menu-tab[aria-current="page"] { color: var(--ink); font-weight: 650; border-bottom-color: var(--accent) }

/* Banners */
.banners { max-width: 1440px; margin: auto; padding: 0 24px }
.banner {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fcebec; color: #8f2a2c;
  border: 1px solid #f3d3d4;
  border-radius: var(--r);
  padding: 11px 14px;
  margin-top: 14px;
  font-size: 13px;
}
.banner.ok { background: #eaf5ee; color: #1c6a41; border-color: #cfe7d8 }
.banner button { margin-left: auto; color: inherit; font-size: 16px; line-height: 1; padding: 0 4px }

main { max-width: 1440px; margin: auto; padding: 22px 24px 56px }

/* Sub navigation inside a menu */
.subnav { display: flex; align-items: center; gap: 8px; margin-bottom: 18px }
.subtab { font-size: 13px; color: var(--muted); padding: 6px 12px; border-radius: 6px }
.subtab[aria-current="page"] { background: var(--paper); color: var(--ink); font-weight: 650; border: 1px solid var(--line) }

/* Figures */
.figs { display: flex; gap: 46px; flex-wrap: wrap; margin: 4px 0 22px }
.fig { display: flex; flex-direction: column; gap: 2px }
.fig-value { font-size: 34px; font-weight: 650; letter-spacing: -1px; line-height: 1.15 }
.fig-label { font-size: 12px; color: var(--muted) }

/* Cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; min-width: 0 }
.card + .card { margin-top: 20px }
.card-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line) }
.card-body { padding: 16px }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line) }
.search { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 2px 8px }
.search input { border: 0; background: transparent; outline: none; width: 180px; font-size: 13px; padding: 7px 2px }
.search:focus-within { outline: 2px solid #f5b49b; outline-offset: 1px }
.chips { display: flex; align-items: center; gap: 3px; flex-wrap: wrap }
.chip { border-radius: 5px; padding: 6px 9px; font-size: 12px; color: var(--muted); white-space: nowrap }
.chip:hover { background: var(--soft) }
.chip[aria-pressed="true"] { background: var(--soft); color: var(--ink); font-weight: 600 }
.bolt { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 7px; padding: 7px 10px; font-size: 12px; font-weight: 700; cursor: pointer }
.bolt:hover { color: var(--ink) }
.bolt[aria-pressed="true"] { background: var(--amber, #b7791f); border-color: var(--amber, #b7791f); color: #fff }
.updating { font-size: 12px; color: var(--muted) }
.warn { font-size: 13px; color: var(--amber); margin: 0 0 14px }
.warn:empty { display: none }

/* Print hero: the three figures and the one button */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 20px }
.hero .figs { margin-bottom: 0 }
.fig-note { display: block; font-size: 11px; color: var(--muted); margin-top: 2px }
.primary.big { font-size: 16px; font-weight: 700; padding: 15px 28px; min-width: 260px; border-radius: 8px }
.pickbar { display: flex; align-items: center; gap: 14px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: #fafbfa; position: sticky; top: 0; z-index: 2 }
.pick-all { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; cursor: pointer }
.pick-all input { width: 17px; height: 17px; accent-color: var(--accent) }
.pickbar .rowcount { padding: 0; border: 0 }
.th-sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap }
.th-sort:hover { color: var(--ink) }
th[aria-sort="ascending"] .th-sort, th[aria-sort="descending"] .th-sort { color: var(--ink); font-weight: 700 }
.sortbar { display: none; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-left: auto }
.sortbar select { font-size: 13px; padding: 5px 6px }
.sortbar .ghost { padding: 5px 9px }
.item-name { font-size: 15px; font-weight: 700; letter-spacing: .2px }
[hidden] { display: none !important }

/* Daftar Ambil: big tap targets for a phone in the rack room */
.pick-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px }
.pick + .pick { margin-top: 14px }
.pick-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px }
.pick-top select { flex: 1 1 220px; max-width: 420px; font-size: 15px; font-weight: 600; padding: 10px 12px }
.pick-no { font-size: 15px; font-weight: 700 }
.pick-done { margin-left: auto; font-weight: 700 }
.pick-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line) }
.pick-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; min-height: 52px }
.pick-rows li:last-child .pick-row { border-bottom: 0 }
.pick-row input { width: 24px; height: 24px; flex: none; accent-color: var(--accent) }
.pick-name { flex: 1; font-size: 15px; font-weight: 600 }
.pick-where { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px }
.pick-qty { font-size: 20px; font-weight: 700; min-width: 36px; text-align: right }
.pick-row:has(input:checked) { background: #f4f6f3 }
.pick-row:has(input:checked) .pick-name, .pick-row:has(input:checked) .pick-qty { color: var(--muted); text-decoration: line-through }
.small { font-size: 12px }

/* Tables */
table { border-collapse: collapse; width: 100%; font-size: 12px }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle }
th { font-size: 11px; font-weight: 500; color: var(--muted); background: #fafbfa; position: sticky; top: 0; z-index: 1 }
tbody tr:last-child td { border-bottom: 0 }
tbody tr:hover { background: #fafaf8 }
.table-wrap { overflow: auto; max-height: 68vh }
.c-tick { width: 34px; padding-right: 0 }
.c-tick input { width: 17px; height: 17px; accent-color: var(--accent) }
.c-act { text-align: right; white-space: nowrap }
.sn { font-family: ui-monospace, "Consolas", monospace; font-size: 12px; color: var(--muted) }
.sn b { color: var(--ink); font-size: 13px; letter-spacing: .2px }
.items { display: block; max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.reason { display: block; color: var(--red); font-size: 11px; margin-top: 2px; max-width: 330px }
.rowcount { padding: 10px 14px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line) }
.empty { display: flex; align-items: center; justify-content: center; min-height: 120px; color: var(--muted); font-size: 13px; padding: 16px; text-align: center }

.tag {
  display: inline-block; margin-left: 6px;
  font-size: 10px; font-weight: 600;
  background: var(--soft); color: var(--muted);
  border-radius: 4px; padding: 1px 5px;
}
.tag.code { font-family: ui-monospace, "Consolas", monospace; font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--ink); background: #fff; border: 1.5px solid var(--ink); padding: 1px 6px }
.tag.new { background: #e3f4e8; color: var(--green, #1d7a3e) }
.attention { border-left: 4px solid var(--red); margin-bottom: 20px }
.count-badge { background: var(--red); color: #fff; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 1px 8px }
.attn { list-style: none; margin: 0; padding: 0 }
.attn li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 12px }
.attn li:last-child { border-bottom: 0 }
.attn .tag, td > .tag.code { margin-left: 0 }
td { white-space: normal }
.q-table td:nth-child(2) { white-space: nowrap }
.attn-meta { color: var(--muted) }
.attn .reason { flex: 1 1 100%; max-width: none; margin-top: 0 }
.tag.hot { background: var(--tint); color: var(--accent) }

.due { white-space: nowrap }
.due.late { color: var(--red); font-weight: 600 }

.pill {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  border-radius: 5px; padding: 3px 7px;
  white-space: nowrap;
}
.st-new { background: #fff3d9; color: var(--amber) }
.st-wait { background: #eef1f4; color: var(--slate) }
.st-done { background: #eaf5ee; color: var(--good) }
.st-fail { background: #fcebec; color: var(--red) }
.st-check { color: var(--red); border: 1px solid #f0c3c4; background: var(--paper) }
.st-sc { background: var(--soft); color: var(--muted) }

/* Batch history + settings rows */
.batch { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 12px; flex-wrap: wrap }
.batch:last-child { border-bottom: 0 }
.batch time { color: var(--muted) }

/* Dialogs */
dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 48px);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 50px #1c253033;
}
dialog::backdrop { background: #1c253055 }
.dlg-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line) }
.dlg-head button { margin-left: auto; font-size: 18px; line-height: 1; color: var(--muted); padding: 2px 6px; border-radius: 5px }
.dlg-body { padding: 18px 20px; overflow-y: auto; max-height: 62dvh }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap }
.headline { font-size: 18px; font-weight: 650; letter-spacing: -.3px; margin-bottom: 12px }
.lines { list-style: none; margin: 0; padding: 0; font-size: 13px }
.lines li { padding: 6px 0; border-bottom: 1px solid var(--line) }
.lines li:last-child { border-bottom: 0 }
.lines .bad { color: var(--red) }
details { margin-top: 12px; font-size: 12px }
summary { color: var(--muted); padding: 4px 0 }
.dlg-body fieldset { border: 0; padding: 0; margin: 0 0 16px }
.dlg-body legend { font-size: 12px; font-weight: 650; padding: 0 0 6px }
.opt { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px }
.opt input { width: 16px; height: 16px; accent-color: var(--accent) }
.field { display: block; margin-bottom: 16px }
.field > span { display: block; font-size: 12px; font-weight: 650; margin-bottom: 5px }
.field select, .field input { width: 100% }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px }

.phase { font-size: 15px; font-weight: 600; margin-bottom: 12px }
.bar { height: 8px; background: var(--soft); border-radius: 5px; overflow: hidden }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s }
.sum-figs { display: flex; gap: 32px; margin-bottom: 16px }
.sum-head { font-size: 12px; font-weight: 650; margin: 18px 0 6px }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px }
.login main { width: 100%; max-width: 350px; padding: 0 }
.login .brand { font-size: 19px; margin-bottom: 40px }
.login .mark { width: 34px; height: 34px; border-radius: 10px; font-size: 19px }
.login h1 { font-size: 26px; letter-spacing: -.5px; margin: 0 0 20px }
.login label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 6px }
.login input { width: 100%; padding: 12px }
.login .primary { width: 100%; margin-top: 24px; padding: 13px; font-size: 15px }
.error { color: #b42318; font-size: 13px; margin: 0 }
.error:empty { display: none }

/* Phone */
@media (max-width: 760px) {
  .top-inner { padding: 10px 14px; gap: 10px; flex-wrap: wrap; min-height: 54px }
  .menubar, .banners { padding: 0 14px }
  main { padding: 18px 14px 40px }
  .figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px }
  .fig-value { font-size: 26px }
  .fig-label { font-size: 11px }
  .fig-note { font-size: 10px }
  .who { display: none }
  .search input { width: 100%; flex: 1 }
  .toolbar .search { flex: 1 1 100% }
  .toolbar .primary { flex: 1 1 100% }
  .hero { align-items: stretch; flex-direction: column; gap: 14px }
  .primary.big { position: fixed; left: 14px; right: 14px; bottom: 12px; width: auto; min-width: 0; z-index: 20; box-shadow: 0 6px 18px rgba(0, 0, 0, .22) }
  main { padding-bottom: 96px }
  .toolbar select { flex: 1 1 100%; max-width: none }
  .toolbar .push { margin-left: 0 }
  .pickbar { flex-wrap: wrap; gap: 8px 14px }
  .sortbar { display: inline-flex; flex: 1 1 100%; margin-left: 0 }
  .sortbar select { flex: 1 }
  .table-wrap { max-height: none }

  .stack thead { display: none }
  .stack tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line) }
  .stack td { display: block; border: 0; padding: 2px 0; text-align: left }
  .stack td:empty { display: none }
  .stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted) }
  .stack .items, .stack .reason { max-width: none; white-space: normal }
  .stack td.c-act { margin-top: 6px; text-align: left }
  .stack .link { padding: 6px 8px; margin-left: -8px }
  .q-table tr { position: relative; padding-left: 40px }
  .q-table td.c-tick { position: absolute; left: 12px; top: 13px; width: auto; padding: 0 }
}

@media (pointer: coarse) {
  input, select { font-size: 16px }
  .chip { min-height: 38px; display: inline-flex; align-items: center }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important }
}

/* Pemberitahuan: pembeli mengajukan batal (ikut tercetak). Hilang sendiri setelah 10 detik. */
.cancel-notice { position: fixed; top: 14px; right: 14px; z-index: 80; width: min(430px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: hidden; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); padding: 12px 14px 0; text-align: left }
.cancel-notice.open { overflow: auto; padding-bottom: 12px }
.cancel-notice ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px }
.cancel-notice li { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: baseline; min-width: 0 }
.cancel-notice .cn-shop { font-size: 12px; font-weight: 600; white-space: nowrap }
.cancel-notice .cn-items { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.cancel-notice.open .cn-items { white-space: normal }
.cancel-notice .cn-text { margin: 10px 0 0; font-size: 13px; font-weight: 600; color: var(--amber) }
.cancel-notice .cn-more, .cancel-notice .cn-close { margin: 8px 0 0; padding: 6px 0; background: none; border: 0; color: var(--ink); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; text-align: left }
.cancel-notice .cn-bar { display: block; height: 3px; margin: 12px -14px 0; background: var(--amber); transform-origin: left; animation: cn-count 10s linear forwards }
@keyframes cn-count { to { transform: scaleX(0) } }
@media (prefers-reduced-motion: reduce) { .cancel-notice .cn-bar { animation: none } }
