/* GGOCS Shipments — team side */
:root {
  --paper: #F2F5F4;
  --card: #FFFFFF;
  --ink: #243030;
  --ink-2: #53605F;
  --ink-3: #87918F;
  --line: #DAE2E0;
  --line-2: #EAF0EE;
  --navy: #14307A;
  --navy-2: #0D2462;
  --teal: #1DA6A5;
  --emerald: #13955A;
  --emerald-bg: #E4F4EA;
  --gold: #E3A423;
  --gold-bg: #FCF3DC;
  --rust: #BD432C;
  --rust-bg: #FBEBE7;
  --route: linear-gradient(90deg, #14307A 0%, #1DA6A5 38%, #13955A 68%, #E3A423 100%);
  --f-display: 'Saira', system-ui, sans-serif;
  --f-body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-row: 10px;
  --r-panel: 16px;
  --focus: 0 0 0 3px rgba(29, 166, 165, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
img { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.ic { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-in { max-width: 1180px; margin: 0 auto; height: 60px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 30px; height: auto; }
.brand-name { font: 600 21px/1 var(--f-display); letter-spacing: .01em; }
.brand-org { font: 600 12px/1 var(--f-display); color: var(--ink-3); padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; }
.topnav { display: flex; align-items: center; gap: 6px; }
.navlink { text-decoration: none; color: var(--ink-2); font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.navlink.is-on, .navlink:hover { color: var(--ink); background: var(--line-2); }

.page { max-width: 1180px; margin: 0 auto; padding: 24px 18px calc(64px + env(safe-area-inset-bottom)); }
.narrow { max-width: 720px; margin: 0 auto; }

/* ---------- Type ---------- */
.h1 { font: 600 30px/1.1 var(--f-display); margin: 0 0 6px; letter-spacing: .005em; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.fine { font-size: 13px; color: var(--ink-3); margin: 6px 0 0; }
em { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: .92em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn .ic { width: 17px; height: 17px; }
.btn-sm { height: 36px; padding: 0 13px; font-size: 14px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-danger { background: transparent; border-color: #EBC2B9; color: var(--rust); }
.btn-danger:hover { background: var(--rust-bg); }
.btn[disabled] { opacity: .55; cursor: default; }
.iconbtn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none;
}
.iconbtn:hover, .iconbtn.is-on { background: var(--line-2); color: var(--ink); }

/* ---------- Forms ---------- */
.stack { display: grid; gap: 14px; }
.stack-lg { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input:not([type=radio]):not([type=checkbox]), select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 84px; }
input[type=date] { min-width: 0; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }
input[readonly] { background: var(--line-2); }
.mono-in, .num { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.form-error { background: var(--rust-bg); color: var(--rust); padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.flash { background: var(--emerald-bg); color: #0C6A3F; padding: 12px 16px; border-radius: 12px; font-weight: 600; margin-bottom: 18px; }
fieldset { margin: 0; min-width: 0; }

/* ---------- Panels ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px; }
fieldset.panel { padding-top: 16px; }
.panel-title { font: 600 18px/1.2 var(--f-display); margin: 0; padding: 0; }
legend.panel-title { float: left; width: 100%; margin-bottom: 12px; }
legend.panel-title + * { clear: both; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.backlink .ic { width: 16px; height: 16px; }
.backlink:hover { color: var(--ink); }

/* ---------- Auth ---------- */
body.bare { background: var(--paper); }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; }
.auth-logo { width: 118px; height: auto; margin: 0 auto 18px; }
.auth-title { font: 600 26px/1 var(--f-display); text-align: center; margin: 0 0 8px; }
.auth-sub { text-align: center; color: var(--ink-2); margin: 0 0 20px; }
.signout { margin-top: 18px; }

/* ---------- Dashboard ---------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.search { position: relative; flex: 1; max-width: 440px; min-width: 240px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search input:not([type=radio]) { padding-left: 38px; background: var(--card); }

/* The pipeline: one connected strip that reads left to right like the route itself */
.pipeline {
  display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr));
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel);
  overflow-x: auto; scrollbar-width: none; position: relative;
}
.pipeline::-webkit-scrollbar { display: none; }
.pipeline::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--route); opacity: .9; }
.pipe {
  position: relative; display: grid; gap: 2px; text-align: left; padding: 14px 16px 16px;
  background: transparent; border: 0; border-right: 1px solid var(--line-2); cursor: pointer;
}
.pipe:last-child { border-right: 0; }
.pipe:hover { background: #F7FAF9; }
.pipe.is-on { background: #EEF3F2; }
.pipe.is-on::before { content: ''; position: absolute; left: 16px; right: 16px; bottom: 3px; height: 3px; background: var(--ink); border-radius: 3px 3px 0 0; }
.pipe-count { font: 600 28px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.pipe-label { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }

.chips { display: flex; gap: 8px; margin: 14px 0 16px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.chip b { font-family: var(--f-display); color: var(--ink); font-weight: 600; }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.is-on b { color: #fff; }
.chip-problem:not([disabled]) b { color: var(--rust); }
.chip-problem.is-on { background: var(--rust); border-color: var(--rust); }
.chip-problem.is-on b { color: #fff; }
.chip[disabled] { opacity: .5; cursor: default; }

.jlist { display: grid; gap: 8px; }
.jrow {
  display: grid; grid-template-columns: 40px minmax(160px, 1.3fr) minmax(150px, 1.2fr) minmax(170px, 1fr) 56px;
  align-items: center; gap: 16px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-row);
  text-decoration: none; color: var(--ink); transition: border-color .15s;
}
.jrow:hover { border-color: #B9C6C3; }
.jrow-mode { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--line-2); color: var(--navy); }
.jrow-main, .jrow-dest, .jrow-stage { display: grid; gap: 2px; min-width: 0; }
.jref { font: 600 18px/1.1 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.jclient { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jrow-dest span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jrow-dest small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stage-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.jrow-date { color: var(--ink-3); font-size: 13px; text-align: right; white-space: nowrap; }
.jlist-empty { text-align: center; color: var(--ink-3); padding: 28px 0; }

.bar { display: block; height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--route); background-size: 400px 100%; transition: width .4s ease; }
.bar-lg { height: 8px; }

.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--rust); background: var(--rust-bg); padding: 2px 8px 2px 6px; border-radius: 999px; }
.flag .ic { width: 14px; height: 14px; }

.empty { text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--r-panel); padding: 48px 20px; }
.empty img { margin: 0 auto 12px; }
.empty h2 { font: 600 22px/1.2 var(--f-display); margin: 0 0 6px; }
.empty p { color: var(--ink-2); margin: 0 0 18px; }

/* ---------- New job ---------- */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-box {
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center;
  padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; height: 100%;
  transition: border-color .15s, background-color .15s;
}
.choice-box .ic { grid-row: span 2; width: 24px; height: 24px; color: var(--ink-3); }
.choice-box b { font-weight: 700; }
.choice-box small { color: var(--ink-3); font-size: 13px; }
.choice input:checked + .choice-box { border-color: var(--navy); background: #F2F5FC; }
.choice input:checked + .choice-box .ic { color: var(--navy); }
.choice input:focus-visible + .choice-box { box-shadow: var(--focus); }
.sup-rows { display: grid; gap: 8px; margin: 12px 0; }
.sup-row { display: grid; grid-template-columns: 1fr 1fr 38px; gap: 8px; align-items: center; }

/* ---------- Job page ---------- */
.job-head { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 22px 22px 20px; margin-bottom: 18px; }
.job-id { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.job-mode { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--navy); background: #EDF1FA; padding: 5px 10px 5px 8px; border-radius: 8px; }
.job-mode .ic { width: 16px; height: 16px; }
.job-ref { font: 700 38px/1 var(--f-display); margin: 0; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.stage-pill { font-weight: 700; font-size: 13px; padding: 5px 11px; border-radius: 999px; background: var(--line-2); color: var(--ink); }
.stage-pill.stage-completed { background: var(--emerald-bg); color: #0C6A3F; }
.job-client { margin: 10px 0 12px; font-size: 16px; }
.job-progress { display: flex; align-items: center; gap: 12px; max-width: 520px; }
.job-progress .bar { flex: 1; }
.job-progress .muted { font: 600 14px/1 var(--f-display); min-width: 40px; }

.linkbox { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.linkbox-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.linkbox-row { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbox-row input { flex: 1 1 280px; font-variant-numeric: tabular-nums; color: var(--ink-2); min-height: 36px; height: 36px; padding: 6px 12px; }

.job-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.job-main, .job-side { display: grid; gap: 18px; min-width: 0; }
.job-side { position: sticky; top: 78px; }

/* Packing instructions: gold edge from the logo marks it as a work order for the warehouse */
.panel-packing { border-inline-start: 4px solid var(--gold); }
.panel-packing textarea { background: #FFFDF7; line-height: 1.55; }
.packing-save { margin-top: 10px; }
#packing:target, #packing.flash-in { box-shadow: 0 0 0 3px rgba(227, 164, 35, .35); }

/* Suppliers */
.sups { display: grid; gap: 10px; }
.sup { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; background: #FBFCFC; }
.sup-top { display: flex; gap: 6px; }
.sup-name { font-weight: 700; }
.sup input.sup-name, .sup input.sup-items, .sup input.sup-note { border-color: transparent; background: transparent; min-height: 34px; padding: 5px 8px; }
.sup input:hover { border-color: var(--line); background: #fff; }
.sup input:focus { background: #fff; }
.sup-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sup-status label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sup-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 12px; }

.sselect { min-height: 36px !important; padding: 5px 30px 5px 10px !important; font-weight: 700; font-size: 13px; border-radius: 8px !important; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2353605F' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 10px center !important; }
.sselect[data-s=done] { background-color: var(--emerald-bg) !important; border-color: #BFE3CD !important; color: #0C6A3F; }
.sselect[data-s=problem] { background-color: var(--rust-bg) !important; border-color: #EDC4BA !important; color: var(--rust); }
.sselect[data-s=na] { color: var(--ink-3); }

/* Steps */
.sgroup + .sgroup { margin-top: 8px; }
.sgroup-title { font-size: 12.5px; font-weight: 700; color: var(--ink-3); margin: 14px 0 4px; letter-spacing: .02em; }
.sgroup:first-of-type .sgroup-title { margin-top: 0; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; position: relative; padding: 10px 0; }
.step + .step { border-top: 1px solid var(--line-2); }
.step-body { display: grid; gap: 8px; min-width: 0; }
.step-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.step-label { font-weight: 700; font-size: 15.5px; }
.step[data-status=na] .step-label { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line); }
.step-hint { font-size: 13px; color: var(--ink-3); margin: -4px 0 0; }
.auto-count { font-weight: 700; color: var(--ink-2); }
.inline-link { font-weight: 700; color: var(--navy); }
.step-ctrl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.step-date { width: 160px !important; min-height: 36px !important; padding: 5px 10px !important; }
.step-note { min-height: 34px !important; padding: 5px 10px !important; font-size: 14px; border-style: dashed !important; background: transparent !important; }
.step-note:focus { border-style: solid !important; background: #fff !important; }

.sdot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); color: var(--ink-3); background: #fff; }
.sdot .ic { width: 15px; height: 15px; }
.sdot-done { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.sdot-problem { background: var(--rust); border-color: var(--rust); color: #fff; }
.sdot-na { border-style: dashed; }

.seg { display: inline-flex; background: var(--line-2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 0 11px; height: 30px; border-radius: 7px;
  font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.seg button:hover:not([disabled]) { color: var(--ink); }
.seg button.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20, 48, 122, .12); }
.seg button.is-on[data-s=done] { background: var(--emerald); color: #fff; }
.seg button.is-on[data-s=problem] { background: var(--rust); color: #fff; }
.seg button[disabled] { cursor: default; }
.seg button[disabled]:not(.is-on) { opacity: .5; }

.vis {
  display: inline-flex; align-items: center; border: 0; background: transparent; cursor: pointer;
  font-size: 12.5px; font-weight: 600; padding: 4px 8px; border-radius: 7px; white-space: nowrap;
}
.vis span { display: inline-flex; align-items: center; gap: 5px; }
.vis .ic { width: 15px; height: 15px; }
.vis[data-vis="1"] { color: var(--navy); }
.vis[data-vis="1"] .vis-off, .vis[data-vis="0"] .vis-on { display: none; }
.vis[data-vis="0"] { color: var(--ink-3); background: var(--line-2); }
.vis:hover { background: var(--line-2); }

.danger { padding: 4px 4px 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 11px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--rust); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .job-grid { grid-template-columns: 1fr; }
  .job-side { position: static; }
}
@media (max-width: 760px) {
  .page { padding: 16px 12px 72px; }
  .h1 { font-size: 26px; }
  .brand-org { display: none; }
  .navlink { display: none; }
  .jrow { grid-template-columns: 40px 1fr auto; grid-template-areas: "mode main date" "mode dest dest" "mode stage stage"; row-gap: 8px; column-gap: 12px; align-items: start; }
  .jrow-mode { grid-area: mode; }
  .jrow-main { grid-area: main; }
  .jrow-dest { grid-area: dest; }
  .jrow-stage { grid-area: stage; }
  .jrow-date { grid-area: date; }
  .job-head { padding: 18px 16px; }
  .job-ref { font-size: 32px; }
  .panel { padding: 16px; }
  .grid-2, .choice-grid { grid-template-columns: 1fr; }
  .grid-2.tight { grid-template-columns: 1fr 1fr; }
  .sup-status { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .sup-add { grid-template-columns: 1fr; }
  .sup-row { grid-template-columns: 1fr 38px; }
  .sup-row input:nth-child(2) { grid-row: 2; }
  .step { grid-template-columns: 26px 1fr; gap: 10px; }
  .sdot { width: 26px; height: 26px; }
  .seg { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .seg button { padding: 0 4px; }
  .step-date { width: 100% !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
