/* ==========================================================================
   Bahtera Kargo — design system
   Referensi: SiCepat (widget Cek Resi/Cek Ongkir bertab di atas banner, kartu
   abu bergaris, tombol pill), Anteraja (field ganda lacak/tarif), FleetYu
   (baris rute dengan chip ID + chip meta, pill status bergaris, bar utilisasi).
   Lihat study-cases/cargo-shipping-company-website/design-system.md
   ========================================================================== */

/* ---------- Token ---------- */
:root {
  --font: "Poppins", system-ui, sans-serif;

  --ink: #141b2d;        /* teks utama */
  --ink-2: #5e6675;      /* meta */
  --ink-3: #98a0ad;      /* placeholder, nonaktif */
  --line: #e4e7ec;
  --line-2: #d0d5dd;
  --bg: #ffffff;
  --soft: #f6f7f9;       /* bar tab, kartu abu, field */
  --soft-2: #eef0f4;

  --brand: #f25c05;      /* oranye brand asli: tombol aksi */
  --brand-ink: #c44a03;  /* hover, teks oranye */
  --brand-soft: #fff1e8; /* latar tag oranye kecil */
  --navy: #0b2a7a;       /* navy brand asli: link, progres, aktif */
  --navy-soft: #ebeffa;

  --ok: #12805c;   --ok-soft: #e7f5ef;
  --warn: #b54708; --warn-soft: #fef3e6;
  --bad: #c4320a;  --bad-soft: #fdece7;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --sh-card: 0 10px 30px rgba(16, 24, 40, .10);
  --sh-tab: 0 1px 3px rgba(16, 24, 40, .10);

  --w: 1200px;
  --gutter: 32px;
}
@media (max-width: 720px) { :root { --gutter: 16px; } }

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 400 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
[data-lucide] { width: 18px; height: 18px; stroke-width: 1.75; flex: none; }
.i-sm { width: 16px; height: 16px; }

/* Router layar (lapak.js) */
[data-screen] { display: none; }
[data-screen].is-active { display: block; }

.wrap { max-width: calc(var(--w) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.link { color: var(--navy); font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ---------- Tipografi ---------- */
.t-hero { font-weight: 600; font-size: 44px; line-height: 1.15; letter-spacing: -0.02em; }
.t-h1 { font-weight: 600; font-size: 30px; line-height: 1.2; letter-spacing: -0.015em; }
.t-h2 { font-weight: 600; font-size: 24px; line-height: 1.3; letter-spacing: -0.01em; }
.t-h3 { font-weight: 600; font-size: 17px; line-height: 1.4; }
.t-meta { font-size: 14px; color: var(--ink-2); }
.t-small { font-size: 13px; color: var(--ink-2); }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.sec-head p { margin-top: 4px; }
@media (max-width: 720px) { .t-hero { font-size: 30px; } .t-h1 { font-size: 24px; } .t-h2 { font-size: 20px; } }

/* ---------- Tombol ---------- */
.btn { height: 44px; padding: 0 22px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 500; font-size: 15px; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
.btn-secondary:hover { background: var(--soft); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.text-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-ink); font-weight: 500; font-size: 14px; }

/* ---------- Header ---------- */
.nav { border-bottom: 1px solid var(--line); background: #fff; }
.nav__in { height: 72px; display: flex; align-items: center; gap: 40px; }
.wordmark { font-weight: 700; font-size: 21px; letter-spacing: -0.03em; color: var(--navy); white-space: nowrap; }
.wordmark span { color: var(--brand); font-weight: 600; }
.nav__links { display: flex; gap: 32px; font-size: 15px; color: var(--ink); }
.nav__links a { padding: 24px 0; border-bottom: 2px solid transparent; }
.nav__links a.is-active { border-color: var(--brand); font-weight: 500; }
.nav__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
@media (max-width: 960px) { .nav__links { display: none; } }
@media (max-width: 720px) { .nav__right .btn-secondary { display: none; } }

/* ---------- Banner + widget (pola SiCepat) ---------- */
.banner { position: relative; height: 420px; border-radius: var(--r-lg); overflow: hidden; background: var(--soft-2); }
.photo { position: relative; overflow: hidden; background: var(--soft-2); }
.photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner .photo { position: absolute; inset: 0; }
.widget { position: relative; margin: -110px 32px 0; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-card); border: 1px solid var(--line); padding: 16px 24px 24px; z-index: 2; }
@media (max-width: 720px) { .banner { height: 240px; } .widget { margin: -48px 0 0; padding: 12px 16px 18px; } }

/* Tab bersegmen di bar abu */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--soft); border-radius: var(--r-sm); padding: 4px; }
.seg > button { height: 42px; border-radius: 6px; font-size: 15px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.seg > button.is-active { background: #fff; color: var(--brand-ink); box-shadow: var(--sh-tab); }
@media (max-width: 720px) { .seg > button { font-size: 13px; gap: 4px; } .seg > button svg { display: none; } }

/* ---------- Field ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input { height: 46px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 14px; display: flex; align-items: center; gap: 10px; background: #fff; min-width: 0; }
.input svg { color: var(--ink-3); }
.input input, .input select { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; font-size: 15px; appearance: none; }
.input input::placeholder { color: var(--ink-3); }
.input .unit { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.input:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-soft); }
.row { display: grid; gap: 12px; align-items: end; }

/* ---------- Kartu abu bergaris (SiCepat) ---------- */
.card { border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.card--soft { background: var(--soft); }
.card__pad { padding: 20px 24px; }
.icon-box { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; flex: none; }
.icon-box--navy { background: var(--navy-soft); color: var(--navy); }

/* ---------- Daftar baris (moda, rute, kiriman) ---------- */
.list { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: #fff; }
.list__row { display: grid; gap: 20px; align-items: center; padding: 18px 24px; }
.list__row + .list__row { border-top: 1px solid var(--line); }
.list__head { background: var(--soft); font-size: 13px; color: var(--ink-2); font-weight: 500; padding-top: 12px; padding-bottom: 12px; }
.scroll-x { overflow-x: auto; }
.scroll-x > .list { min-width: 760px; }

/* Chip ID & meta (FleetYu) */
.id-chip { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 6px; background: var(--soft-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meta-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.meta-chip svg { width: 13px; height: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* Pill status bergaris */
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; border: 1px solid currentColor; white-space: nowrap; }
.pill--ok { color: var(--ok); background: var(--ok-soft); border-color: #b7e0cf; }
.pill--warn { color: var(--warn); background: var(--warn-soft); border-color: #f6d3ae; }
.pill--bad { color: var(--bad); background: var(--bad-soft); border-color: #f5c3b4; }
.pill--navy { color: var(--navy); background: var(--navy-soft); border-color: #c8d2f0; }
.pill--mute { color: var(--ink-2); background: var(--soft); border-color: var(--line); }

/* Filter chip */
.fchip { height: 36px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line-2); font-size: 14px; font-weight: 500; white-space: nowrap; background: #fff; }
.fchip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Bar utilisasi */
.meter { height: 6px; border-radius: 3px; background: var(--soft-2); overflow: hidden; }
.meter > i { display: block; height: 100%; width: var(--v, 0%); background: var(--navy); border-radius: 3px; transition: width .3s; }
.meter--brand > i { background: var(--brand); }
.meter-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.meter-label b { color: var(--ink); font-weight: 600; }

/* Check list */
.checks { display: flex; flex-direction: column; gap: 12px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks svg { color: var(--ok); margin-top: 3px; }

/* ---------- Pilihan layanan (radio baris) ---------- */
.opt { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 22px; cursor: pointer; text-align: left; width: 100%; }
.opt + .opt { border-top: 1px solid var(--line); }
.opt__radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); }
.opt.is-selected { background: #fffaf6; box-shadow: inset 3px 0 0 var(--brand); }
.opt.is-selected .opt__radio { border: 6px solid var(--brand); }
.opt__price { text-align: right; font-weight: 600; font-size: 17px; white-space: nowrap; }
.opt__price small { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-2); }

/* Stepper */
.stepper { display: inline-flex; align-items: center; height: 46px; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.stepper button { width: 42px; height: 100%; display: grid; place-items: center; color: var(--ink-2); }
.stepper button:hover { background: var(--soft); }
.stepper output { min-width: 48px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Slot tanggal & jam */
.slots { display: flex; gap: 8px; flex-wrap: wrap; }
.slot { min-width: 96px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); text-align: left; font-size: 14px; background: #fff; }
.slot b { display: block; font-weight: 600; font-size: 15px; }
.slot small { color: var(--ink-2); font-size: 12.5px; }
.slot.is-selected { border: 2px solid var(--brand); padding: 9px 13px; }
.slot.is-off { background: var(--soft); color: var(--ink-3); border-color: var(--soft); pointer-events: none; }
.slot.is-off small { color: var(--ink-3); }

/* Toggle add-on */
.addon { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 20px; cursor: pointer; }
.addon + .addon { border-top: 1px solid var(--line); }
.addon input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--brand); }

/* Bar aksi bawah (sticky) */
.actionbar { position: sticky; bottom: 0; z-index: 5; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(16, 24, 40, .06); }
.actionbar__in { min-height: 84px; display: flex; align-items: center; gap: 24px; padding-top: 12px; padding-bottom: 12px; }
.actionbar__total { margin-left: auto; text-align: right; }
.actionbar__total b { display: block; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .actionbar__in { flex-wrap: wrap; gap: 10px; } .actionbar__sum { display: none; } .actionbar__total { margin-left: 0; text-align: left; } .actionbar .btn { margin-left: auto; } }

/* Ringkasan rute */
.route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 0; border: 1px solid var(--line-2); border-radius: var(--r-md); background: #fff; align-items: stretch; }
.route__end { padding: 14px 20px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.route__end small { font-size: 12.5px; color: var(--ink-2); }
.route__end b { font-size: 17px; font-weight: 600; }
.route__swap { align-self: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; background: #fff; margin: 0 -18px; z-index: 1; }
.route__end + .route__end { border-left: 1px solid var(--line); padding-left: 32px; }
.route__edit { border-left: 1px solid var(--line); display: flex; align-items: center; padding: 0 20px; }
@media (max-width: 720px) { .route { grid-template-columns: 1fr; } .route__swap { display: none; } .route__end + .route__end { border-left: 0; border-top: 1px solid var(--line); padding-left: 20px; } .route__edit { border-left: 0; border-top: 1px solid var(--line); padding: 12px 20px; } }

/* Langkah (crumbs) */
.steps { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-3); flex-wrap: wrap; }
.steps b { color: var(--ink); font-weight: 500; }
.steps .done { color: var(--ok); }

/* ---------- Milestone horizontal ---------- */
.miles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.mile { position: relative; display: flex; flex-direction: column; gap: 4px; padding-top: 34px; padding-right: 12px; }
.mile::before { content: ""; position: absolute; top: 11px; left: 0; right: 0; height: 3px; background: var(--soft-2); }
.mile.is-done::before, .mile.is-now::before { background: var(--navy); }
.mile.is-now::before { background: linear-gradient(90deg, var(--navy) 50%, var(--soft-2) 50%); }
.mile__dot { position: absolute; top: 0; left: 0; width: 25px; height: 25px; border-radius: 50%; background: #fff; border: 2px solid var(--line-2); display: grid; place-items: center; z-index: 1; }
.mile__dot svg { width: 14px; height: 14px; }
.mile.is-done .mile__dot { background: var(--navy); border-color: var(--navy); color: #fff; }
.mile.is-now .mile__dot { border: 7px solid var(--navy); }
.mile b { font-size: 14px; font-weight: 600; }
.mile span { font-size: 13px; color: var(--ink-2); }
.mile.is-next b { color: var(--ink-2); font-weight: 500; }
@media (max-width: 720px) {
  .miles { grid-template-columns: 1fr; gap: 0; }
  .mile { padding: 0 0 18px 40px; }
  .mile::before { top: 0; bottom: 0; left: 11px; right: auto; width: 3px; height: auto; }
  .mile.is-now::before { background: linear-gradient(180deg, var(--navy) 50%, var(--soft-2) 50%); }
  .mile:last-child::before { display: none; }
}

/* ---------- Timeline vertikal (riwayat) ---------- */
.log { display: flex; flex-direction: column; }
.log__item { display: grid; grid-template-columns: 112px 18px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 22px; }
.log__item::before { content: ""; position: absolute; left: 134px; top: 14px; bottom: -2px; width: 2px; background: var(--line); }
.log__item:last-child::before { display: none; }
.log__time { font-size: 13px; color: var(--ink-2); text-align: right; line-height: 1.4; }
.log__time b { display: block; color: var(--ink); font-weight: 500; font-size: 14px; }
.log__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line-2); margin: 5px 0 0 3px; position: relative; z-index: 1; }
.log__item.is-now .log__dot { background: var(--navy); box-shadow: 0 0 0 4px var(--navy-soft); }
.log__body b { font-weight: 600; font-size: 15px; display: block; }
.log__body p { font-size: 14px; color: var(--ink-2); }
@media (max-width: 720px) { .log__item { grid-template-columns: 74px 18px minmax(0, 1fr); gap: 10px; } .log__item::before { left: 92px; } }

/* KV detail */
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 500; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Dokumen */
.doc { display: flex; align-items: center; gap: 12px; padding: 12px 0; font-size: 14px; }
.doc + .doc { border-top: 1px solid var(--line); }
.doc svg:first-child { color: var(--ink-2); }
.doc a { margin-left: auto; }

/* Layout dua kolom (lacak) */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
@media (max-width: 1024px) { .split { grid-template-columns: 1fr; } }

/* ---------- Papan muat gudang ---------- */
.ops { background: var(--soft); min-height: 100vh; }
.ops-bar { background: #fff; border-bottom: 1px solid var(--line); }
.ops-bar__in { min-height: 64px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 10px 24px; }
.ops-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; padding: 20px 24px 32px; align-items: start; }
@media (max-width: 1100px) { .ops-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .ops-grid { padding: 16px; } .ops-bar__in { padding: 10px 16px; } }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.wait { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 18px; align-items: center; }
.wait + .wait { border-top: 1px solid var(--line); }
.wait__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wait .btn { height: 34px; padding: 0 14px; font-size: 13.5px; }
.lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .lanes { grid-template-columns: repeat(3, minmax(260px, 1fr)); overflow-x: auto; padding-bottom: 6px; } }
.lane { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; text-align: left; cursor: pointer; }
.lane.is-selected { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy); }
.lane__head { padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.lane__title { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.lane__title b { font-size: 15px; font-weight: 600; display: block; }
.lane__meters { display: flex; flex-direction: column; gap: 10px; }
.lane__items { padding: 6px 18px 14px; display: flex; flex-direction: column; }
.load { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px 0; font-size: 13.5px; align-items: center; }
.load + .load { border-top: 1px dashed var(--line); }
.load b { font-weight: 600; font-variant-numeric: tabular-nums; }
.load small { display: block; color: var(--ink-2); font-size: 12.5px; }
.load.is-new { background: var(--brand-soft); margin: 0 -18px; padding: 10px 18px; }
.lane__foot { margin-top: auto; padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-2); }

/* ---------- Faktur (akun bisnis) ---------- */
.inv { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 20px; font-size: 14px; }
.inv + .inv { border-top: 1px solid var(--line); }
.inv b { font-weight: 600; }

/* ---------- Kantor ---------- */
.office { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 48px 0 32px; margin-top: 80px; }
.footer__grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; font-size: 14px; }
.footer__grid h4 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.footer__grid li + li { margin-top: 8px; }
.footer__grid a { color: var(--ink-2); }
@media (max-width: 720px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__grid > :first-child { grid-column: 1 / -1; } }

.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy-soft); color: var(--navy); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.ok-badge { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.wait > .id-chip { justify-self: start; }
.banner .photo > img { object-position: center 100%; }
