/* Intan Ops — back office. Desktop-first: this screen is dense on purpose,
   because the warehouse person is comparing a PDF against parsed fields and
   needs both in view at once. The driver app has its own stylesheet. */
:root {
  --bg: #0d1117; --panel: #161b22; --line: #26303b;
  --ink: #e6edf3; --muted: #8b98a5;
  --accent: #00d4ff; --warn: #ffaa00; --bad: #ff5c5c; --good: #3fb950;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  min-height: 100dvh;
}
.loading { color: var(--muted); padding: 3rem; text-align: center; }

.wrap { max-width: 460px; margin: 0 auto; padding: 3rem 1.25rem; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h1 .thin { font-weight: 300; color: var(--muted); }
.sub { color: var(--muted); margin: 0 0 2rem; }

label { display: block; margin: 1rem 0 .35rem; font-size: .85rem; color: var(--muted); }
input, select {
  width: 100%; padding: .7rem .8rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); font: inherit;
  /* 16px stops iOS zooming the whole page when a field is focused. */
  font-size: 16px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button {
  width: 100%; margin-top: 1.25rem; padding: .8rem;
  background: var(--accent); color: #04121a; border: 0;
  border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer;
}
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

.msg { margin-top: 1rem; padding: .7rem .8rem; border-radius: var(--radius); font-size: .9rem; }
.msg.bad  { background: rgba(255,92,92,.12);  color: #ffb4b4; }
.msg.good { background: rgba(63,185,80,.12);  color: #9ae6a4; }

.card { background: var(--panel); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.row { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.muted { color: var(--muted); font-size: .85rem; }

/* ── shell ─────────────────────────────────────────────────────────── */
.bar {
  display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.brand { font-weight: 700; }
.bar nav { display: flex; gap: .25rem; flex: 1; }
.tab {
  width: auto; margin: 0; padding: .45rem .8rem; font-weight: 500; font-size: .9rem;
  background: transparent; color: var(--muted); border-radius: 8px;
}
.tab.on { background: var(--accent); color: #04121a; font-weight: 600; }
.searchbox { min-width: 16rem; }
.searchbox input { padding: .45rem .7rem; font-size: 14px; }
.small { width: auto; margin: 0; padding: .45rem .8rem; font-size: .85rem; }
.btnlink { display: inline-block; text-decoration: none; line-height: 1.6; }
main { padding: 1.25rem; max-width: 1500px; margin: 0 auto; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.cards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.item { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }

/* ── the morning pass ──────────────────────────────────────────────── */
/* Two columns because the job is comparing them. On a narrow screen the PDF
   stacks above the fields rather than shrinking to illegibility. */
.pass { display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; gap: 1.25rem; }
.pass-pdf iframe { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pass-fields { display: flex; flex-direction: column; gap: .5rem; }
@media (max-width: 1100px) {
  .pass { grid-template-columns: 1fr; }
  .pass-pdf iframe { height: 420px; }
}

.flags { display: flex; flex-direction: column; gap: .3rem; }
.flag {
  background: rgba(255,170,0,.12); color: #ffcc66;
  padding: .5rem .7rem; border-radius: 8px; font-size: .875rem;
}

/* The source text the whole checklist is derived from. */
.remark { border-left: 3px solid var(--warn); padding-left: .8rem; margin: .35rem 0; }
.remark-label { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); }
.remark-text {
  margin-top: .25rem; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .95rem; white-space: pre-wrap; word-break: break-word;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.actions { display: flex; gap: .75rem; margin-top: .5rem; }
.actions button { margin-top: 0; }

.intakebar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.intakebar > div:last-child { display: flex; gap: .5rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .5rem; }
.dot.good { background: var(--good); }
.dot.bad { background: var(--bad); }

/* ── board ─────────────────────────────────────────────────────────── */
.columns { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.column { background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; }
.mini { padding: .6rem; margin-bottom: .5rem; }
.mini.delivered { opacity: .6; }
.warnbox { background: rgba(255,170,0,.1); color: #ffcc66; }
.pills { margin-top: .35rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem;
        background: rgba(255,255,255,.07); color: var(--muted); }
.pill.cash { background: rgba(255,170,0,.16); color: #ffcc66; }
.pill.warn { background: rgba(255,92,92,.14); color: #ffb4b4; }
.status { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.status.delivered { color: var(--good); }
.status.en_route, .status.arrived { color: var(--accent); }
.status.failed { color: var(--bad); }

.docs { margin: .5rem 0; }
.doc { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; }
.doc input { width: 20px; height: 20px; accent-color: var(--good); }

.toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  padding: .7rem 1.2rem; border-radius: 999px; font-size: .9rem; z-index: 50;
  background: var(--bad); color: #fff;
}
.toast.good { background: var(--good); color: #05230d; }
