/* TRASK Supply Chain Tracker — navy/gold house palette. */

:root {
  --navy: #0f2942;
  --navy-2: #16395c;
  --navy-3: #1d4a75;
  --gold: #e0c898;
  --gold-2: #c9ab72;
  --ink: #1c2b3a;
  --muted: #6b7d8f;
  --faint: #93a3b3;
  --line: #e3e9ef;
  --line-2: #eef2f6;
  --bg: #f4f6f9;
  --card: #ffffff;
  --blue: #2563eb;
  --blue-bg: #eef4ff;
  --amber: #b45309;
  --amber-bg: #fff7ea;
  --red: #c72a2a;
  --red-bg: #fdf0f0;
  --green: #15803d;
  --green-bg: #eefaf1;
  --slate: #64748b;
  --shadow: 0 1px 2px rgba(16,39,66,.06), 0 1px 3px rgba(16,39,66,.05);
  --shadow-lg: 0 10px 40px rgba(16,39,66,.18);
  --r: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.2px; }
h2 { font-size: 15px; margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--line-2); padding: 1px 5px; border-radius: 5px; }

.boot { padding: 60px; color: var(--muted); }
.boot-error { max-width: 560px; margin: 80px auto; padding: 28px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }

/* ------------------------------------------------------------- layout */

.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--navy); color: #fff; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 18px 16px 20px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold), var(--gold-2));
  color: var(--navy); font-weight: 800; font-size: 13px; letter-spacing: .5px;
}
.brand-title { font-weight: 700; font-size: 14px; }
.brand-sub { font-size: 11px; color: #90a6bd; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: #c6d4e3; font-weight: 500; transition: background .12s, color .12s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.on { background: var(--navy-3); color: #fff; box-shadow: inset 2px 0 0 var(--gold); }
.nav-ico { width: 18px; text-align: center; opacity: .85; }
.nav-badge {
  margin-left: auto; background: var(--gold); color: var(--navy);
  font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 20px;
}

/* ---- review queue ---- */
.sug-list { display: flex; flex-direction: column; gap: 12px; }
.sug { padding: 16px 18px; }
.sug-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.sug-head > div:first-child { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sug-change { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.sug-row { display: flex; align-items: baseline; gap: 9px; font-size: 13px; flex-wrap: wrap; }
.sug-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--faint); min-width: 92px;
}
.sug-from { color: var(--muted); text-decoration: line-through; }
.sug-arrow { color: var(--faint); }
.sug-to { font-weight: 650; color: var(--navy); }
.sug-evidence {
  margin: 0 0 9px; padding: 9px 13px; border-left: 3px solid var(--gold);
  background: #fbfaf6; color: var(--ink); font-size: 13px; font-style: italic; border-radius: 0 7px 7px 0;
}
.sug-why { font-size: 12px; color: var(--muted); margin-bottom: 13px; }
.sug-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sug-actions { display: flex; gap: 8px; margin-left: auto; }
.linkish-dark { font-size: 12.5px; color: var(--blue); font-weight: 600; }
.linkish-dark:hover { text-decoration: underline; }
.kind-po { background: #f1ebdd; color: #8a6d2f; }

.sidebar-foot { padding: 12px 10px 14px; border-top: 1px solid rgba(255,255,255,.09); }
.who {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  background: rgba(255,255,255,.06); border: 0; border-radius: 8px; color: #fff;
  cursor: pointer; text-align: left; font: inherit;
}
.who:hover { background: rgba(255,255,255,.12); }
.who-txt { display: flex; flex-direction: column; min-width: 0; }
.who-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-role { font-size: 11px; color: #90a6bd; }
.avatar {
  width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--gold); color: var(--navy); font-weight: 700; font-size: 11px;
}
.mode-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-top: 10px; padding: 0 2px; }
.mode { font-size: 10.5px; padding: 3px 7px; border-radius: 20px; }
.mode-local { background: rgba(224,200,152,.16); color: var(--gold); }
.mode-live { background: rgba(34,197,94,.18); color: #7ae2a4; }
.linkish { background: none; border: 0; color: #90a6bd; font: inherit; font-size: 11.5px; cursor: pointer; padding: 0; }
.linkish:hover { color: #fff; text-decoration: underline; }

.main { padding: 24px 28px 60px; max-width: 1500px; min-width: 0; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.page-sub { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* -------------------------------------------------------------- pieces */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.table-card { overflow: hidden; }

.btn {
  font: inherit; font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; transition: background .12s, border-color .12s;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-text { color: var(--red); border-color: transparent; }
.btn-danger-text:hover { background: var(--red-bg); }
.icon-btn {
  background: none; border: 0; cursor: pointer; color: var(--faint); font-size: 18px;
  line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.icon-btn:hover { background: var(--red-bg); color: var(--red); }

.inp {
  font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; color: var(--ink); width: 100%;
}
.inp:focus { outline: 2px solid rgba(37,99,235,.28); outline-offset: -1px; border-color: var(--blue); }
.inp:disabled { background: var(--line-2); color: var(--muted); }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: right 13px center, right 8px center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
.search { width: 260px; }
.inp-group { display: flex; gap: 6px; }
.inp-group select { width: 92px; flex: none; }

.tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); }
.tab:hover { background: #fff; color: var(--ink); }
.tab.on { background: var(--card); color: var(--navy); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tab-count { font-size: 11px; background: var(--line-2); border-radius: 20px; padding: 1px 6px; margin-left: 3px; color: var(--muted); }
.tabs-spacer { flex: 1; }

/* -------------------------------------------------------------- tables */

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--faint); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfcfe;
  position: sticky; top: 0; z-index: 1;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-rfq], .tbl tbody tr[data-po], .tbl tbody tr[data-goto] { cursor: pointer; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl-tight td { padding: 8px 12px; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl th.num { text-align: right; }
.row-red { background: var(--red-bg); box-shadow: inset 3px 0 0 var(--red); }
.row-red:hover { background: #fbe7e7; }
.row-amber { background: var(--amber-bg); box-shadow: inset 3px 0 0 #e0a23c; }
.row-amber:hover { background: #fdf1de; }
.row-actions { width: 34px; text-align: right; }

.sub { color: var(--muted); font-size: 11.5px; }
.strong { font-weight: 650; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.fwd { color: var(--faint); }
.t-red { color: var(--red); } .t-amber { color: var(--amber); }
.t-green { color: var(--green); } .t-blue { color: var(--blue); }

.pill { display: inline-block; font-size: 11px; font-weight: 650; padding: 2px 9px; border-radius: 20px; background: var(--line-2); color: var(--slate); white-space: nowrap; }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }
.pill.slate { background: var(--line-2); color: var(--slate); }

.empty { padding: 42px 20px; text-align: center; }
.empty-title { font-weight: 650; color: var(--ink); }
.empty-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* ----------------------------------------------------------- dashboard */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; display: block; }
a.kpi:hover { border-color: var(--navy-3); }
.kpi-top { display: flex; align-items: baseline; justify-content: space-between; }
.kpi-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); }
.kpi-num { font-size: 30px; font-weight: 700; letter-spacing: -1px; }
.kpi-row { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.chip { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: var(--line-2); color: var(--slate); }
.chip-red { background: var(--red-bg); color: var(--red); }
.chip-amber { background: var(--amber-bg); color: var(--amber); }
.kpi-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.kpi-mini .v { display: block; font-size: 20px; font-weight: 700; }
.kpi-mini .k { display: block; font-size: 10.5px; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; margin-bottom: 16px; }
.dash-grid > .card { overflow: hidden; }

.chart { display: flex; align-items: flex-end; gap: 14px; height: 168px; padding: 18px 18px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-bars { flex: 1; display: flex; align-items: flex-end; gap: 4px; width: 100%; justify-content: center; }
.bar { width: 20px; border-radius: 4px 4px 0 0; min-height: 3px; position: relative; display: flex; justify-content: center; }
.bar span { position: absolute; top: -16px; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.bar-sent { background: var(--navy-3); }
.bar-recv { background: var(--gold); }
.chart-x { font-size: 11px; color: var(--muted); padding: 7px 0 0; }
.legend { display: flex; gap: 16px; justify-content: center; padding: 8px 0 16px; font-size: 11.5px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-sent { background: var(--navy-3); } .sw-recv { background: var(--gold); }

.rig-tag {
  display: inline-block; margin-left: 6px; font-size: 9.5px; font-weight: 700;
  letter-spacing: .3px; padding: 1px 6px; border-radius: 5px;
  background: #ede7f7; color: #5b46a3; vertical-align: 1px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.chip-rig { background: #ede7f7; color: #5b46a3; }

.centre-filter { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 2px; gap: 2px; }
.seg {
  font: inherit; font-size: 12px; font-weight: 600; padding: 5px 11px; border: 0;
  border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
}
.seg:hover { color: var(--ink); }
.seg.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }

.kindtag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; letter-spacing: .4px; }
.kind-rfq { background: var(--blue-bg); color: var(--blue); }
.kind-po { background: #f1ebdd; color: #8a6d2f; }

/* ------------------------------------------------------------- stages */

.stage-chip { display: inline-block; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 6px; white-space: nowrap; background: var(--line-2); color: var(--slate); }
.stage-1 { background: #eef2f6; color: #56677a; }
.stage-2 { background: #e9f0fb; color: #35618f; }
.stage-3 { background: #ece9fb; color: #5245a8; }
.stage-4 { background: #fdf3e0; color: #92671d; }
.stage-5 { background: var(--blue-bg); color: var(--blue); }
.stage-6 { background: #fdecec; color: #a63232; }
.stage-7 { background: #e8f6ef; color: #17714a; }
.stage-8 { background: var(--green-bg); color: var(--green); }

.prog { display: flex; gap: 2px; margin-top: 6px; }
.prog i { width: 9px; height: 4px; border-radius: 2px; background: var(--line); }
.prog i.on { background: var(--navy-3); }
.prog i.stuck { background: var(--red); }

.docdots { display: inline-flex; gap: 3px; }
.docdots i {
  width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center;
  font-size: 9.5px; font-weight: 700; font-style: normal;
  background: var(--line-2); color: var(--faint); border: 1px solid var(--line);
}
.docdots i.on { background: var(--green-bg); color: var(--green); border-color: #bfe6cd; }

.acid {
  margin-top: 5px; font-size: 9.5px; font-weight: 700; letter-spacing: .3px;
  padding: 1px 6px; border-radius: 5px; display: inline-block;
}
.acid-ok { background: var(--green-bg); color: var(--green); }
.acid-missing { background: var(--red-bg); color: var(--red); }
/* Still early in the pipeline — worth knowing, not worth worrying about yet. */
.acid-pending { background: var(--line-2); color: var(--faint); }

.flag { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; margin-bottom: 3px; }
.flag-red { background: var(--red-bg); color: var(--red); }
.flag-amber { background: var(--amber-bg); color: var(--amber); }
.alert-stack { margin-bottom: 14px; }
.alert-stack .flag { font-size: 12.5px; padding: 7px 11px; }

/* ----------------------------------------------------------- timeline */

.tl-card { padding: 14px 18px 18px; overflow-x: auto; }
.tl-axis { margin-bottom: 10px; }
.tl-row, .tl-axis { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: center; }
.tl-row { padding: 6px 0; cursor: pointer; border-radius: 7px; }
.tl-row:hover { background: #f8fafc; }
.tl-label { display: flex; flex-direction: column; min-width: 0; }
.tl-label .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; height: 24px; background: #fafbfd; border-radius: 6px; }
.tl-axis .tl-track { background: none; height: 18px; border-bottom: 1px solid var(--line); }
.tl-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-tick-label { position: absolute; top: 0; font-size: 10.5px; color: var(--faint); transform: translateX(2px); }
.tl-now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--red); opacity: .55; }
.tl-now-label { position: absolute; top: -2px; left: 4px; font-size: 10px; color: var(--red); font-weight: 700; }
.tl-bar {
  position: absolute; top: 3px; height: 18px; border-radius: 5px; overflow: hidden;
  display: flex; align-items: center; min-width: 26px;
}
.tl-blue { background: #dce8fb; } .tl-amber { background: #fbecd6; } .tl-red { background: #f9dede; }
.tl-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(15,41,66,.22); }
.tl-blue .tl-fill { background: rgba(37,99,235,.35); }
.tl-amber .tl-fill { background: rgba(180,83,9,.32); }
.tl-red .tl-fill { background: rgba(199,42,42,.32); }
.tl-text { position: relative; font-size: 10.5px; font-weight: 650; padding: 0 7px; white-space: nowrap; color: #2b3a4a; }

/* ---------------------------------------------------------- suppliers */

.sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.sup-card { padding: 16px; cursor: pointer; transition: border-color .12s, transform .12s; }
.sup-card:hover { border-color: var(--navy-3); transform: translateY(-1px); }
.sup-top { display: flex; gap: 11px; align-items: center; }
.sup-name { font-weight: 650; }
.tag-row { display: flex; gap: 5px; flex-wrap: wrap; margin: 11px 0 0; }
.sup-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-2); }
.sup-stats .k { display: block; font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .4px; }
.sup-stats .v { display: block; font-weight: 700; font-size: 15px; }
.scorecard { margin-top: 18px; padding: 14px 16px; background: #fafbfd; border: 1px solid var(--line); border-radius: var(--r); }
.scorecard-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); }
.scorecard .sup-stats { margin-top: 10px; padding-top: 10px; }

.group-card { margin-bottom: 14px; overflow: hidden; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.group-name { font-weight: 700; }
.group-stats { display: flex; gap: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

/* -------------------------------------------------------------- modal */

.modal-host { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12,26,42,.45); backdrop-filter: blur(2px); }
.modal {
  position: relative; background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line-2); }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-err { margin: 0 20px; padding: 9px 12px; background: var(--red-bg); color: var(--red); border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: #fbfcfe; }
.modal-foot-actions { display: flex; gap: 8px; margin-left: auto; }
.confirm-text { margin: 4px 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-wide { grid-column: 1 / -1; }
.field-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--faint); }
.field-hint { font-size: 11px; color: var(--faint); }
.supplier-new { margin-top: 6px; }

.checks { display: flex; flex-wrap: wrap; gap: 7px; }
.check { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 20px; font-size: 12.5px; cursor: pointer; }
.check:has(input:checked) { background: var(--blue-bg); border-color: #b9cdf5; color: var(--blue); font-weight: 600; }
.check input { margin: 0; }
.check em { font-style: normal; color: var(--faint); font-size: 11px; }
.check-warn { border-color: #f0c98d; background: var(--amber-bg); }
.doc-checks .check { border-radius: 9px; }

.section-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); margin: 20px 0 9px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.detail-grid .k { display: block; font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .4px; }
.detail-grid .v { display: block; font-weight: 600; margin-top: 2px; }
.notes { margin: 0; color: var(--muted); white-space: pre-wrap; }
.hint-row { font-size: 11.5px; color: var(--faint); margin-top: 8px; }

.pipeline { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.pstep {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer;
  font: inherit; font-size: 10.5px; color: var(--muted); text-align: center; transition: all .12s;
}
.pstep:hover:not(:disabled) { border-color: var(--navy-3); background: #f6f9fd; }
.pstep:disabled { cursor: default; opacity: .75; }
.pstep-n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--faint); font-weight: 700; font-size: 10.5px; }
.pstep-l { font-weight: 600; line-height: 1.2; }
.pstep-d { font-size: 9.5px; color: var(--faint); }
.pstep.done { background: #f3f8f5; border-color: #cfe6d9; color: var(--green); }
.pstep.done .pstep-n { background: var(--green); color: #fff; }
.pstep.now { border-color: var(--navy); background: #eef3f9; color: var(--navy); box-shadow: 0 0 0 2px rgba(15,41,66,.1); }
.pstep.now .pstep-n { background: var(--navy); color: #fff; }
.pstep.stuck { border-color: var(--red); background: var(--red-bg); color: var(--red); box-shadow: 0 0 0 2px rgba(199,42,42,.12); }
.pstep.stuck .pstep-n { background: var(--red); color: #fff; }

.history { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.history li { padding: 5px 0 5px 14px; position: relative; }
.history li::before { content: ''; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--navy-3); }
.h-stage { font-weight: 650; font-size: 13px; }
.h-meta { display: block; font-size: 11.5px; color: var(--muted); }

.user-list, .export-list { display: flex; flex-direction: column; gap: 7px; }
.user-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font: inherit; text-align: left; }
.user-row:hover { background: #f8fafc; }
.user-row.on { border-color: var(--navy); background: #eef3f9; }
.user-row .who-name, .user-row .who-role { display: block; }
.user-row .who-role { color: var(--muted); }

.settings-block { margin-bottom: 20px; }
.settings-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); margin-bottom: 7px; }
.settings-text { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* -------------------------------------------------------------- toast */

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 14px);
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 9px;
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; z-index: 80;
  opacity: 0; transition: opacity .2s, transform .2s;
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.toast-err { background: var(--red); }

/* --------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { flex-direction: row; overflow-x: auto; padding: 0 10px 10px; }
  .nav-item { white-space: nowrap; }
  .sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .mode-row { margin: 0; flex-direction: column; align-items: flex-end; gap: 3px; }
  .main { padding: 18px 14px 50px; }
  .form-grid { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .tl-row, .tl-axis { grid-template-columns: 140px 1fr; }
  /* Registers stay legible by scrolling sideways inside their card rather than
     squeezing every column — and the page itself never scrolls sideways. */
  .main { overflow-x: hidden; }
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card .tbl { min-width: 620px; }
  .table-card .tbl { min-width: 780px; }
}

/* ------------------------------------------------------------ v2 additions */

/* who a record is for — only non-TRASK companies are tagged */
.co-tag {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .3px;
  padding: 1px 6px; border-radius: 5px; background: #e6f2ef; color: #1f6b5a; vertical-align: 1px; font-family: inherit;
}
.urgent-tag {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .3px;
  padding: 1px 6px; border-radius: 5px; background: var(--red-bg); color: var(--red); vertical-align: 1px; font-family: inherit;
}
.req-link { margin-top: 2px; }
.company-filter { width: auto; min-width: 170px; }
.kind-req { background: #e6f2ef; color: #1f6b5a; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* whose move — the line that says who is holding a request */
.move-who { font-weight: 700; font-size: 12.5px; }
.move-red { color: var(--red); } .move-amber { color: var(--amber); }
.move-blue { color: var(--blue); } .move-slate { color: var(--slate); }
.move-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 9px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--line-2);
}
.move-bar-amber { background: var(--amber-bg); border-color: #f3dcb6; }
.move-bar-red { background: var(--red-bg); border-color: #f2caca; }
.move-bar-blue { background: var(--blue-bg); border-color: #d4e2fd; }
.move-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.move-text { margin-top: 2px; }
.move-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* request detail */
.req-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 6px; }
.detail-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); margin: 16px 0 6px; }
.req-grid .detail-label:first-child, .req-grid > div > .detail-label:first-child { margin-top: 0; }
.detail-text { font-weight: 550; }
.detail-note { margin-top: 6px; padding: 8px 10px; background: var(--line-2); border-radius: 7px; font-size: 13px; }
.empty-inline { padding: 12px 14px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; }
.quote-group { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 10px; overflow: hidden; }
.quote-head { padding: 8px 12px; background: var(--line-2); border-bottom: 1px solid var(--line); }
.row-best td { background: var(--green-bg); }
.best-tag { font-size: 10px; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .4px; margin-left: 4px; }

/* the handoff, step by step */
.handoff { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.handoff li { display: grid; grid-template-columns: 160px 90px 1fr 70px; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--line-2); color: var(--faint); }
.handoff li:first-child { border-top: 0; }
.handoff li.done { color: var(--ink); }
.handoff li.done .h-label::before { content: '●'; color: var(--green); margin-right: 7px; font-size: 9px; vertical-align: 2px; }
.handoff li:not(.done) .h-label::before { content: '○'; margin-right: 7px; font-size: 9px; vertical-align: 2px; }
.h-gap { text-align: right; }

.folder-row { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.folder-path { flex: 1; min-width: 0; padding: 7px 10px; background: var(--line-2); border-radius: 7px; font-size: 12px; overflow-x: auto; white-space: nowrap; }

/* several suppliers for one RFQ code */
.checklist { max-height: 168px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.check { display: flex; gap: 7px; align-items: baseline; padding: 3px 4px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.check:hover { background: var(--line-2); }

/* sign-in (shared database only) */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--navy); grid-column: 1 / -1; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 14px; padding: 26px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }
.login-card .brand { padding: 0; border: 0; }
.login-card .brand-title { color: var(--ink); }
.login-card .brand-sub { color: var(--muted); }
.login-card h1 { font-size: 19px; }
.login-btn { width: 100%; justify-content: center; padding: 10px; }

@media (max-width: 820px) {
  .req-grid { grid-template-columns: 1fr; }
  .checklist { grid-template-columns: 1fr; }
  .handoff li { grid-template-columns: 1fr auto; }
  .handoff .h-who, .handoff .h-gap { display: none; }
}

/* shown only when running on sample data in the browser — never in the shared register */
.local-note { margin: 0 0 16px; padding: 9px 13px; border-radius: 8px; background: var(--amber-bg); border: 1px solid #f3dcb6; color: #7a4a0c; font-size: 12.5px; }

/* nobody has acknowledged it yet — visible from across the room */
.row-unack { background: var(--amber-bg); box-shadow: inset 4px 0 0 var(--amber); }
.row-unack:hover { background: #fdf0da; }
.row-unack td.strong { color: var(--amber); }
.inp-sm { padding: 3px 24px 3px 7px; font-size: 12px; height: auto; width: auto; max-width: 150px; }
.assign-inline { margin-top: 3px; }
.tab-count-hot { background: var(--amber); color: #fff; }

/* ---------------------------------------------------------------- stock */
.place-chip { display: inline-block; margin: 1px 4px 1px 0; padding: 2px 8px; border-radius: 6px; background: var(--line-2); font-size: 12px; white-space: nowrap; }
.place-chip .co-tag { margin-left: 4px; }
.stock-tbl .cat-row td { background: var(--line-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding-top: 7px; padding-bottom: 7px; }
.stock-tbl tbody + tbody .cat-row td { border-top: 8px solid var(--card); }
.clickable { cursor: pointer; }
.clickable:hover { color: var(--blue); }
.stock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stock-kpis > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.stock-kpis .k { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); }
.stock-kpis .v { display: block; font-size: 22px; font-weight: 700; margin-top: 2px; }
.stock-kpis small { font-size: 12px; font-weight: 500; color: var(--muted); }
.held-list { border: 1px solid #f3dcb6; background: var(--amber-bg); border-radius: 9px; padding: 4px 10px; margin-bottom: 8px; }
.held-row { display: grid; grid-template-columns: 80px 1fr auto auto; gap: 10px; align-items: center; padding: 5px 0; border-top: 1px solid #f3dcb6; font-size: 13px; }
.held-row:first-child { border-top: 0; }
.stock-search-row { margin-bottom: 6px; }
.stock-search-row .inp { width: 100%; max-width: 360px; }
.match-tbl td { vertical-align: top; }
.receive-row { display: grid; grid-template-columns: 2fr 2fr 1fr 1fr; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.linkish-dark { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
@media (max-width: 820px) {
  .receive-row, .stock-kpis { grid-template-columns: 1fr; }
  .held-row { grid-template-columns: 1fr; }
}

/* Microsoft sign-in */
.ms-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px;
  background: #fff; color: #1f1f1f; border: 1px solid #8c8c8c; font-weight: 600; }
.ms-btn:hover { background: #f3f3f3; }
.ms-btn:disabled { opacity: .7; cursor: progress; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 11.5px; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login-form { display: flex; flex-direction: column; gap: 12px; }

.toast-warn { background: var(--amber); max-width: min(560px, 92vw); }
.sync-state { display: block; font-size: 11px; color: var(--faint); margin-top: 6px; padding: 0 2px; }
.sync-state.offline { color: #f7c56b; font-weight: 600; }

/* ---- files attached to a request ---- */
.att-block { margin-bottom: 4px; }
.att-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.att-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.att-icon {
  flex: none; width: 38px; text-align: center; font-size: 9.5px; font-weight: 800;
  letter-spacing: .4px; color: var(--slate); background: var(--line-2);
  border-radius: 5px; padding: 3px 0;
}
.att-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.att-name {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
  color: var(--blue); cursor: pointer; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.att-name:hover { text-decoration: underline; }
.att-add { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-wrap: wrap; }
.att-hint { font-size: 11.5px; }

/* An order's warnings, shown under the order they belong to. */
.po-alert-row td { padding-top: 0; border-bottom: 1px solid var(--line-2); }
.po-alert-row .flag { display: inline-block; margin-right: 6px; }
.tbl tbody tr[data-open-po] { cursor: pointer; }

/* ---- follow-ups ---- */
.fu-tick {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--faint); cursor: pointer; font-size: 12px; line-height: 1;
}
.fu-tick:hover { border-color: var(--green); color: var(--green); background: var(--green-bg); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.client-new { margin-top: 6px; }

/* A follow-up that has become a request. */
.fu-linked { display: flex; align-items: center; gap: 7px; margin-top: 5px; flex-wrap: wrap; font-size: 12px; }

/* ---- follow-up list ---- */
.fu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fu-row {
  display: flex; align-items: flex-start; gap: 11px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.fu-row.fu-late  { background: var(--red-bg);   border-color: #f0c9c9; }
.fu-row.fu-today { background: var(--amber-bg); border-color: #f0d9b0; }
.fu-main { flex: 1; min-width: 0; }
.fu-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fu-due { margin-left: auto; font-size: 12px; white-space: nowrap; font-weight: 600; }
.fu-actions { display: flex; gap: 6px; flex: none; }
.fu-actions .btn-sm { white-space: nowrap; }
@media (max-width: 820px) {
  .fu-row { flex-wrap: wrap; }
  .fu-actions { width: 100%; justify-content: flex-end; }
}

/* A key or command shown once, meant to be copied whole. */
.key-box {
  margin: 10px 0 0;
  padding: 12px 14px;
  background: var(--ink-050, #f4f6f8);
  border: 1px solid var(--line, #dde3e9);
  border-radius: 8px;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
}
