:root {
  --ink: #0f172a; --muted: #64748b; --line: #e2e8f0; --bg: #f1f5f9; --card: #fff;
  --brand: #c2410c; --brand2: #ea580c; --blue: #2563eb; --green: #16a34a; --red: #dc2626; --amber: #d97706; --violet: #7c3aed;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
a { color: var(--blue); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: #111827; color: #fff; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand small { display: block; color: #9ca3af; font-size: 11px; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), #f59e0b); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #d1d5db; flex-wrap: wrap; justify-content: flex-end; }
.who b { color: #fff; }
main { max-width: 1280px; margin: 0 auto; padding: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.narrow { max-width: 440px; margin: 40px auto; }
.card h2 { margin: 0 0 4px; font-size: 20px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
label.f { display: block; margin: 12px 0 0; font-size: 12px; font-weight: 600; color: #334155; }
label.f input, label.f select, label.f textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; }
label.f input:focus, label.f select:focus, label.f textarea:focus { outline: 2px solid #fdba74; border-color: var(--brand2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 9px; border: 1px solid #cbd5e1; background: #fff; color: var(--ink); cursor: pointer; font-weight: 600; }
.btn:hover { background: #f8fafc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand2); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.red { color: var(--red); border-color: #fecaca; }
.btn.ghost { background: transparent; border-color: #374151; color: #e5e7eb; padding: 6px 10px; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; margin-top: 16px; }
.btn[disabled] { opacity: .55; cursor: wait; }
.links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }
.lnk { border: 0; background: none; padding: 0; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.msg { margin-top: 12px; padding: 9px 12px; border-radius: 9px; font-size: 13px; }
.msg.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.msg.ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.msg.info { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.qr { display: flex; justify-content: center; margin: 14px 0 6px; }
.qr svg { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 10px; }
.secret { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; background: #f8fafc; border: 1px dashed #cbd5e1; padding: 8px; border-radius: 8px; text-align: center; word-break: break-all; font-size: 13px; }
.code-in { text-align: center; font-size: 26px !important; letter-spacing: 8px; font-family: ui-monospace, Consolas, monospace; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; color: #334155; }
.tab.on { background: #111827; border-color: #111827; color: #fff; }
.tab .n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.bar input[type=search] { flex: 1; min-width: 200px; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 9px; }
.sec-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 15px; font-weight: 700; }
.sec-title .count { color: var(--muted); font-weight: 500; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.job { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.job.new { border-color: var(--brand2); box-shadow: 0 0 0 2px #fed7aa; }
.job .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.job .no { font-weight: 800; font-family: ui-monospace, Consolas, monospace; }
.job .kv { display: grid; grid-template-columns: 96px 1fr; gap: 2px 8px; font-size: 13px; }
.job .kv span:nth-child(odd) { color: var(--muted); }
.job .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #f1f5f9; color: #334155; white-space: nowrap; }
.pill.LTL { background: #e0f2fe; color: #075985; } .pill.FTL { background: #ede9fe; color: #5b21b6; }
.pill.OPEN { background: #fff7ed; color: #9a3412; } .pill.QUOTED { background: #fef3c7; color: #92400e; }
.pill.AWARDED { background: #dbeafe; color: #1e40af; } .pill.SCHEDULED { background: #e0e7ff; color: #3730a3; }
.pill.IN_TRANSIT { background: #cffafe; color: #155e75; } .pill.DELIVERED { background: #dcfce7; color: #166534; }
.pill.CLOSED { background: #e2e8f0; color: #334155; } .pill.CANCELLED { background: #fee2e2; color: #991b1b; }
.pill.LOST { background: #f1f5f9; color: #64748b; } .pill.ACTIVE { background: #fef3c7; color: #92400e; }
.pill.WITHDRAWN { background: #f1f5f9; color: #64748b; } .pill.new { background: var(--brand); color: #fff; }
.myq { background: #fffbeb; border: 1px solid #fde68a; border-radius: 9px; padding: 7px 10px; font-size: 13px; }
.won { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 9px; padding: 7px 10px; font-size: 13px; }
.steps { display: flex; gap: 4px; }
.steps i { flex: 1; height: 5px; border-radius: 4px; background: #e2e8f0; }
.steps i.on { background: var(--blue); }
.empty { padding: 26px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed #cbd5e1; border-radius: 12px; }
.deadline { font-size: 12px; color: var(--amber); font-weight: 600; }
.deadline.soon { color: var(--red); }
.flow { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.stage { flex: 1 0 118px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; position: relative; text-align: left; }
.stage:not(:last-child)::after { content: "\203A"; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 18px; z-index: 1; }
.stage b { display: block; font-size: 24px; line-height: 1.1; }
.stage span { font-size: 12px; color: var(--muted); }
.stage.on { border-color: #111827; box-shadow: 0 0 0 2px #111827 inset; }
.stage .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
table.t { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; }
table.t th { text-align: left; background: #f8fafc; color: #475569; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #fff7ed; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.lfd-red { color: var(--red); font-weight: 700; } .lfd-amber { color: var(--amber); font-weight: 700; }
.rail { display: inline-block; padding: 1px 6px; border-radius: 5px; font-size: 11px; font-weight: 800; color: #fff; }
.rail.CN { background: #dc2626; } .rail.CP { background: #b91c1c; filter: hue-rotate(-20deg); }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: flex; align-items: flex-start; justify-content: center; padding: 30px 12px; overflow-y: auto; z-index: 20; }
.modal[hidden] { display: none; }
.sheet { background: #fff; border-radius: 16px; width: 100%; max-width: 760px; padding: 22px; position: relative; }
.sheet h3 { margin: 0 0 4px; font-size: 18px; }
.x { position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 26px; cursor: pointer; color: #64748b; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; font-size: 13px; margin: 10px 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; word-break: break-word; }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 12px; }
.box h4 { margin: 0 0 8px; font-size: 14px; }
.files li, .events li { list-style: none; padding: 6px 0; border-bottom: 1px solid #f1f5f9; display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 13px; }
.files, .events { margin: 0; padding: 0; }
.events li { justify-content: flex-start; }
.events time { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 118px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 30; font-size: 13px; max-width: 90vw; }
.toast.err { background: var(--red); }
@media (max-width: 640px) {
  main { padding: 10px; }
  .row2 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { margin-top: 6px; }
  .hide-m { display: none; }
}
