/* ATRAK TMS — design system (enterprise / ERP) */
:root {
  /* palet inti BCG: Midnight Green, Pulse Green, Fresh Green, Ivory (+ turunan untuk UI) */
  --midnight: #0c2b15; --pulse: #21bf61; --fresh: #96f878; --ivory: #fcfbfa; --neutral: #f1eeea; --nyanza: #e3fddb;
  --brand-950: #0c2b15; --brand-900: #0f3a1d; --brand: #157a41; --brand-700: #10612f; --brand-600: #1a9e55;
  --brand-100: #d3f3de; --brand-50: #ecfaf1; --accent: #96f878; --accent-600: #6fe04e; --accent-50: #f0fde9;
  --ink: #0f1a13; --ink-2: #47524b; --muted: #7c857f; --line: #e7e3dd; --line-2: #f0ede8; --bg: #fcfbfa; --card: #fff;
  --green: #0f8a3c; --blue: #454ac1; --amber: #a86b00; --red: #c63434; --violet: #454ac1;
  /* seri grafik — lolos validator buta warna (adjacent ΔE ≥ 15, kontras ≥ 3:1) */
  --s1: #1a9e55; --s2: #454ac1; --s3: #c28400; --s4: #0097a7; --s5: #e0661a; --s-other: #9aa19c;
  --good: #0f8a3c; --good-bg: #e6f6ec; --warn: #a86b00; --warn-bg: #fff4dc; --crit: #c63434; --crit-bg: #fde9e9;
  --radius: 16px; --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(12, 43, 21, .04), 0 4px 14px rgba(12, 43, 21, .04);
  --shadow: 0 1px 2px rgba(12, 43, 21, .04), 0 8px 24px rgba(12, 43, 21, .06);
  --shadow-lg: 0 24px 60px rgba(12, 43, 21, .22);
  --appbar-h: 64px; --side-w: 248px;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); font-size: 13.5px; line-height: 1.45; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--red); min-height: 1em; margin: 0; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; font-weight: 600; }
h2 { font-size: 14.5px; }
h3 { font-size: 13px; }
.ic { flex: none; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: #fff; }
.login-brand { background: radial-gradient(600px 420px at 100% 0%, rgba(150,248,120,.22), transparent 60%), radial-gradient(900px 500px at 0% 100%, rgba(33,191,97,.35), transparent 60%), linear-gradient(150deg, var(--midnight), #11401f 60%, #157a41); color: #e6f0ea; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; }
.lb-top { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; letter-spacing: .08em; color: #fff; }
.lb-logo { width: 44px; height: 44px; border-radius: 11px; }
.lb-copy h2 { font-size: 30px; line-height: 1.2; color: #fff; max-width: 460px; font-weight: 700; }
.lb-copy p { max-width: 460px; color: #b9cfc2; font-size: 15px; }
.lb-copy ul { padding: 0; list-style: none; display: grid; gap: 10px; margin-top: 24px; }
.lb-copy li { display: flex; gap: 10px; align-items: center; }
.lb-copy li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(150,248,120,.18); }
.login-brand small { color: #7f9a8b; }
.login-pane { display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; }
.login-card h1 { font-size: 22px; }
.login-card p { margin: 0; }
.login-logo { width: 48px; height: 48px; border-radius: 12px; display: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: var(--appbar-h) 1fr; min-height: 100vh; }
.shell.collapsed { --side-w: 64px; }
.appbar { grid-column: 1 / -1; position: sticky; top: 0; z-index: 900; height: var(--appbar-h); display: flex; align-items: center; gap: 12px; padding: 0 16px 0 10px; background: #fff; border-bottom: 1px solid var(--line); }
.appbar-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; min-width: 150px; }
.appbar-brand img { width: 32px; height: 32px; border-radius: 8px; }
.appbar-brand b { display: block; font-size: 15px; letter-spacing: .1em; line-height: 1.1; }
.appbar-brand small { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: .14em; }
.appbar-search { position: relative; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; width: min(360px, 30vw); height: 36px; color: var(--muted); }
.appbar-search input { border: none; background: transparent; outline: none; flex: 1; font: inherit; color: var(--ink); }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.date-nav { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.date-nav input { border: none; padding: 5px 6px; font: inherit; background: transparent; color: var(--ink); }
.org-select { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font-weight: 500; white-space: nowrap; }
.org-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-600); }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 0 4px; }
.live-dot i { width: 7px; height: 7px; border-radius: 50%; background: #9aa7a0; }
.live-dot.on { color: var(--green); }
.live-dot.on i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.pop-wrap { position: relative; }
.dot-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.avatar-btn { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--brand); color: var(--accent); font-weight: 700; cursor: pointer; }

.sidebar { grid-row: 2; position: sticky; top: var(--appbar-h); height: calc(100vh - var(--appbar-h)); background: var(--brand-900); color: #c4d6cb; display: flex; flex-direction: column; overflow: hidden; transition: width .18s; }
nav { padding: 10px 10px; overflow-y: auto; flex: 1; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #7c998a; padding: 14px 10px 6px; white-space: nowrap; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; color: #c4d6cb; text-decoration: none !important; font-weight: 500; white-space: nowrap; border: none; background: none; width: 100%; font: inherit; cursor: pointer; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(150,248,120,.16), rgba(150,248,120,.03)); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item.active .nav-ic { color: var(--accent); }
.nav-ic { width: 20px; display: grid; place-items: center; }
.side-foot { padding: 8px 10px 12px; border-top: 1px solid rgba(255,255,255,.07); }
.shell.collapsed .nav-label, .shell.collapsed .nav-group { display: none; }
.shell.collapsed .nav-item { justify-content: center; padding: 10px; }
.shell.collapsed .nav-group + .nav-item { margin-top: 10px; }

.main { grid-row: 2; min-width: 0; display: flex; flex-direction: column; }
.page-head { padding: 16px 24px 4px; }
.crumbs { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.crumbs b { color: var(--ink-2); font-weight: 500; }
.page-title-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.page-title-row h1 { font-size: 20px; }
.page-title-row p { margin: 0; font-size: 12.5px; }
.view { padding: 12px 24px 40px; display: grid; gap: 16px; align-content: start; }

/* ---------- buttons & inputs ---------- */
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: var(--radius-sm); padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; text-decoration: none !important; white-space: nowrap; height: 36px; transition: background .12s, border-color .12s; }
.btn:hover { border-color: #c9d2cd; background: #f8faf9; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-700); }
.btn.accent { background: var(--accent); border-color: var(--accent-600); color: var(--brand-950); }
.btn.danger { color: var(--red); border-color: #f2c4c4; }
.btn.danger:hover { background: #fff5f5; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { height: 30px; padding: 4px 10px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; height: 42px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 1px solid rgba(255,255,255,.25); padding: 0 9px; }
.icon-btn { border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: var(--radius-sm); width: 36px; height: 36px; cursor: pointer; display: inline-grid; place-items: center; text-decoration: none !important; }
.icon-btn:hover { background: var(--line-2); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.sm { width: 28px; height: 28px; }
input, select, textarea { font: inherit; color: inherit; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; color: var(--ink-2); font-weight: 500; display: flex; gap: 4px; align-items: center; }
.field > span .req { color: var(--red); }
.field input, .field select, .field textarea, .input { border: 1px solid #d5ddd8; border-radius: var(--radius-sm); padding: 8px 10px; background: #fff; width: 100%; min-height: 36px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
select.input { padding-right: 28px; }

.switch { position: relative; width: 34px; height: 20px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #cfd8d3; border-radius: 99px; transition: .15s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--brand-600); }
.switch input:checked + i::after { transform: translateX(14px); }
input[type=checkbox].cb { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; min-height: 52px; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-b { padding: 16px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-side { grid-template-columns: 380px minmax(0, 1fr); }

.kpi { padding: 14px 16px; display: grid; gap: 3px; position: relative; overflow: hidden; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi .bar { height: 5px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.kpi .bar > i { display: block; height: 100%; background: var(--brand-600); border-radius: 99px; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: 0; }
.kpi:hover::after { opacity: 1; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.badge.gray { background: #eef1ef; color: #4b5852; }
.badge.green { background: #dcf3e3; color: #166534; }
.badge.blue { background: #e0e9fd; color: #1e40af; }
.badge.amber { background: #fdf0d5; color: #92400e; }
.badge.red { background: #fde3e3; color: #991b1b; }
.badge.violet { background: #ece4fd; color: #5b21b6; }
.badge.lime { background: var(--accent-50); color: #4d6106; border: 1px solid #e4f6a5; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- tables ---------- */
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .02em; color: var(--ink-2); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f8faf9; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--brand); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover td { background: #f7faf8; }
.tbl tr.selected td { background: var(--brand-50); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .cb-col { width: 40px; padding-right: 0; }
.tbl .act-col { width: 120px; text-align: right; white-space: nowrap; }
.tbl-wrap { overflow: auto; max-height: 560px; }
.tbl tfoot td { font-weight: 700; background: #f8faf9; }
.tbl.dense td { white-space: nowrap; }
.tbl .trunc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-act { width: 30px; height: 30px; border-radius: 6px; border: none; background: transparent; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.row-act:hover { background: var(--line-2); color: var(--brand); }
.row-act.del:hover { color: var(--red); background: #fff1f1; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.toolbar .spacer { flex: 1; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid #d5ddd8; border-radius: var(--radius-sm); padding: 0 10px; height: 36px; min-width: 260px; flex: 1; max-width: 460px; color: var(--muted); background: #fff; }
.search-box input { border: none; outline: none; flex: 1; font: inherit; color: var(--ink); background: transparent; }
.search-box:focus-within { border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pager .spacer { flex: 1; }
.pager select { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); font-weight: 500; color: var(--brand); }

.page-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: -4px; }
.page-tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; text-decoration: none !important; margin-bottom: -1px; display: flex; gap: 8px; align-items: center; }
.page-tabs a:hover { color: var(--ink); }
.page-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.count { background: var(--line-2); color: var(--ink-2); border-radius: 99px; padding: 0 7px; font-size: 11px; font-weight: 600; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; font-size: 13px; border: 1px solid transparent; }
.alert.warn { background: #fffaeb; color: #8a4b08; border-color: #fbe3b0; }
.alert.danger { background: #fef3f2; color: #9f1d1d; border-color: #f8cfcf; }
.alert.info { background: #f0f5ff; color: #1e3a8a; border-color: #d5e2fd; }
.alert.brand { background: var(--accent-50); color: var(--brand-900); border-color: #e4f6a5; }
.alert-list { display: grid; gap: 8px; }

.menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 1200; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px; max-height: 420px; overflow: auto; }
.menu.right { left: auto; right: 0; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--ink); cursor: pointer; background: none; border: none; font: inherit; text-align: left; width: 100%; text-decoration: none !important; }
.menu-item:hover, .menu-item.hl { background: var(--brand-50); }
.menu-item .muted { margin-left: auto; font-size: 11.5px; }
.menu-sep { height: 1px; background: var(--line-2); margin: 4px 0; }
.menu-head { padding: 8px 10px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- maps ---------- */
.map { height: 520px; border-radius: 0 0 var(--radius) var(--radius); z-index: 1; }
.map.tall { height: calc(100vh - 190px); min-height: 520px; border-radius: var(--radius); }
.map-wrap { position: relative; }
.map-legend { position: absolute; left: 12px; bottom: 26px; z-index: 450; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12px; display: grid; gap: 6px; box-shadow: var(--shadow); max-width: 280px; }
.map-legend .row { display: flex; align-items: center; gap: 8px; }
.mk { background: none; border: none; }
.mk-pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); display: grid; place-items: center; }
.mk-pin span { transform: rotate(45deg); color: #fff; font-weight: 700; font-size: 11px; }
.mk-pin.ring { outline: 3px dashed rgba(180, 83, 9, .85); outline-offset: 2px; }
.mk-square { width: 30px; height: 30px; border-radius: 8px; color: #fff; display: grid; place-items: center; font-weight: 700; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.mk-truck { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 3px solid #fff; animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(26,77,53,.25), 0 2px 8px rgba(0,0,0,.35); } 50% { box-shadow: 0 0 0 9px rgba(200,240,43,.15), 0 2px 8px rgba(0,0,0,.35); } }
.leaflet-popup-content { font-family: Inter, system-ui, sans-serif; font-size: 13px; margin: 12px 14px; min-width: 200px; }
.leaflet-container { font-family: Inter, system-ui, sans-serif; }
.pop-title { font-weight: 700; margin-bottom: 4px; }
.pop-row { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }

/* ---------- trips & timeline ---------- */
.trip-list { display: grid; gap: 10px; max-height: calc(100vh - 290px); overflow: auto; padding: 12px; }
.trip { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.trip-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-left: 4px solid var(--c); cursor: pointer; flex-wrap: wrap; }
.trip-h b { font-size: 13px; }
.trip-h .meta { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; gap: 10px; }
.stops { list-style: none; margin: 0; padding: 4px 12px 10px 18px; }
.stops li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; }
.stops li:last-child { border-bottom: none; }
.seq { width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.timeline-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; padding: 6px 0; }
.timeline-track { position: relative; height: 26px; background: repeating-linear-gradient(90deg, #f8faf9 0 calc(100% / 10 - 1px), #e2e7e4 calc(100% / 10 - 1px) calc(100% / 10)); border-radius: 6px; }
.timeline-block { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; padding: 0 6px; overflow: hidden; white-space: nowrap; }
.timeline-axis { display: grid; grid-template-columns: repeat(10, 1fr); margin-left: 118px; font-size: 10.5px; color: var(--muted); }

.feed { display: grid; max-height: 360px; overflow: auto; }
.feed-item { display: grid; grid-template-columns: 46px 1fr; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.feed-item time { color: var(--muted); font-variant-numeric: tabular-nums; }
.feed-item.flash { animation: flash 2s ease-out; }
@keyframes flash { from { background: var(--accent-50); } to { background: transparent; } }

.tabs { display: flex; gap: 4px; background: var(--line-2); padding: 4px; border-radius: 9px; }
.tabs button { border: none; background: none; padding: 6px 12px; border-radius: 6px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.week { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.day-col { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 6px; align-content: start; min-height: 160px; }
.day-col h3 { display: flex; justify-content: space-between; }
.chip { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px; border-radius: 7px; background: var(--brand-50); border: 1px solid var(--brand-100); font-size: 12px; }
.photo-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--line-2); display: grid; place-items: center; color: var(--muted); font-size: 18px; }
.mat-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--line-2); min-width: 120px; }
.mat-bar i { display: block; height: 100%; }

/* ---------- modal & drawer ---------- */
.modal { position: fixed; inset: 0; background: rgba(12, 36, 25, .45); z-index: 2000; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px); }
.modal-card { background: #fff; border-radius: 14px; width: min(640px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-card .card-h { position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-foot, .drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: #fff; z-index: 2; }
.drawer { position: fixed; inset: 0; background: rgba(12, 36, 25, .35); z-index: 1900; display: flex; justify-content: flex-end; }
.drawer-card { background: #fff; width: min(560px, 100%); height: 100%; overflow: auto; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease-out; }
.drawer-card form { display: flex; flex-direction: column; flex: 1; }
.drawer-card .drawer-body { padding: 18px; flex: 1; display: grid; gap: 14px; align-content: start; }
.drawer-card .card-h { position: sticky; top: 0; background: #fff; z-index: 2; }
@keyframes slide { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 0; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.kv > div { padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.kv > div:nth-child(odd) { background: #f8faf9; color: var(--muted); font-size: 12.5px; }
.kv > div:nth-last-child(-n+2) { border-bottom: none; }
.picker-map { height: 220px; border-radius: 8px; border: 1px solid var(--line); margin-top: 6px; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 3000; }
.toast { background: var(--brand-950); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 380px; transition: opacity .4s, transform .4s; border-left: 3px solid var(--accent); }
.toast.err { background: #7f1d1d; border-left-color: #fca5a5; }
.toast.out { opacity: 0; transform: translateY(8px); }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sp .8s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
.chart-box { position: relative; height: 260px; }

/* alur stok gudang */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.flow-step { position: relative; display: grid; gap: 2px; padding: 12px 18px 12px 16px; border: 1px solid var(--line); background: #fff; border-left-width: 4px; }
.flow-step:not(:last-child) { border-right: none; }
.flow-step:not(:last-child)::after { content: ""; position: absolute; right: -9px; top: 50%; width: 16px; height: 16px; background: #fff; border-top: 1px solid var(--line); border-right: 1px solid var(--line); transform: translateY(-50%) rotate(45deg); z-index: 1; }
.flow-step b { font-size: 18px; font-variant-numeric: tabular-nums; }
.flow-step.amber { border-left-color: var(--amber); }
.flow-step.gray { border-left-color: #94a3b8; }
.flow-step.blue { border-left-color: var(--blue); }
.flow-step.green { border-left-color: var(--green); }
.flow-step.violet { border-left-color: var(--violet); }
@media (max-width: 1100px) { .flow { grid-template-columns: 1fr 1fr; gap: 8px; } .flow-step { border-right: 1px solid var(--line) !important; } .flow-step::after { display: none; } }

/* panel ringkasan hasil optimasi */
.sum-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.sum-vehicles { border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
.sum-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.sum-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; align-content: start; }
.sum-card h3 { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--brand); margin-bottom: 4px; }
.sum-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.sum-row span { color: var(--muted); }
.sum-row b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .sum-wrap { grid-template-columns: 1fr; } }

.trip.sel { box-shadow: 0 0 0 2px var(--brand-100); border-color: var(--brand-600); }
details summary { cursor: pointer; }

/* form sortir manual */
.sort-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 64px 30px; gap: 8px; align-items: center; }
.sort-row .input { min-height: 36px; }

/* field editor (tipe data) */
.fe-row { display: grid; grid-template-columns: 24px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 64px 64px 70px; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
.fe-row.head { font-size: 11.5px; color: var(--ink-2); font-weight: 600; background: #f8faf9; }
.fe-row .input { min-height: 32px; padding: 5px 8px; }
.fe-row.sys .lock { color: var(--muted); }
.type-card { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.type-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }

@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-side { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .appbar-search, .org-select { display: none; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-logo { display: block; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: var(--appbar-h); z-index: 1500; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .main { grid-column: 1; }
  .page-head { padding: 14px 16px 0; }
  .view { padding: 12px 16px 32px; }
  .g-2, .g-3, .g-4, .form-grid { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  .date-nav #todayBtn, .live-dot, #helpBtn { display: none; }
  .appbar-brand { min-width: 0; }
  .appbar-brand span { display: none; }
  .fe-row { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; }
}

/* =====================================================================
   TEMA BCG (Midnight · Pulse · Fresh · Ivory) — berlaku untuk semua halaman
   ===================================================================== */
body { -webkit-font-smoothing: antialiased; font-size: 13.5px; }
h1, h2, h3 { letter-spacing: -.015em; font-weight: 700; }
.appbar { background: rgba(252, 251, 250, .88); backdrop-filter: blur(10px); border-bottom-color: var(--line-2); isolation: isolate; }
.sidebar { background: radial-gradient(420px 320px at 0% 100%, rgba(33, 191, 97, .22), transparent 70%), linear-gradient(180deg, var(--midnight) 0%, #0e3219 100%); color: #c9d8cd; }
.nav-group { color: #6f9179; letter-spacing: .14em; }
.nav-item { color: #c9d8cd; border-radius: 10px; padding: 9px 12px; }
.nav-item.active::before { background: var(--fresh); left: -10px; }
.nav-item.active .nav-ic { color: var(--fresh); }
@media (min-width: 861px) {
  /* kolom gelap menyambung dari sidebar sampai ke atas (logo di area gelap) */
  .appbar::before { content: ""; position: absolute; left: 0; top: 0; bottom: -1px; width: var(--side-w); background: var(--midnight); z-index: -1; transition: width .18s; }
  .appbar > #menuBtn { color: #c9d8cd; }
  .appbar > #menuBtn:hover { background: rgba(255, 255, 255, .08); }
  .appbar-brand { color: #fff; min-width: calc(var(--side-w) - 60px); }
  .appbar-brand small { color: #8fb39b; }
  .shell.collapsed .appbar-brand span { display: none; }
  .shell.collapsed .appbar-brand { min-width: 0; }
}
.appbar-search, .date-nav, .org-select { border-radius: 12px; background: #fff; border-color: var(--line); }
.org-dot { background: var(--pulse); box-shadow: 0 0 0 3px rgba(33, 191, 97, .18); }
.avatar-btn { border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--pulse)); color: #fff; }
.page-head { padding: 22px 28px 4px; }
.page-title-row h1 { font-size: 22px; font-weight: 800; }
.view { padding: 14px 28px 48px; gap: 20px; max-width: 1560px; }
.card { border-color: var(--line-2); box-shadow: var(--shadow); }
.card-h { border-bottom-color: var(--line-2); padding: 14px 20px; }
.card-h h2 { font-size: 15px; }
.card-b { padding: 18px 20px; }
.btn { border-radius: 10px; }
.btn.primary { background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn.accent { background: var(--fresh); border-color: var(--fresh); color: var(--midnight); }
.tbl th { background: #faf8f5; color: var(--ink-2); }
.tbl tbody tr:hover td { background: #fbfaf7; }
.tbl tfoot td { background: #faf8f5; }
.kpi::after { display: none; }
.kpi .value { font-weight: 800; }
.badge.green { background: var(--good-bg); color: var(--good); }
.badge.amber { background: var(--warn-bg); color: var(--warn); }
.badge.red { background: var(--crit-bg); color: var(--crit); }
.badge.violet, .badge.blue { background: #ebecfb; color: #3a3fa6; }
.tabs { background: var(--neutral); border-radius: 12px; flex-wrap: wrap; max-width: 100%; }
.tabs button { border-radius: 9px; }
.badge.lime { background: var(--nyanza); color: var(--brand); border: 0; }
.badge.gray { background: var(--neutral); color: var(--ink-2); }
.alert { border-radius: 12px; padding: 11px 14px; }
.alert.warn { background: var(--warn-bg); color: #7a4e00; border-color: #f6e1b0; }
.alert.danger { background: var(--crit-bg); color: #8f2525; border-color: #f5cccc; }
.alert.info { background: #f1f2fd; color: #34398f; border-color: #dcdef8; }
.alert.brand { background: var(--nyanza); color: var(--brand-900); border-color: #c8f3b8; }
/* alur stok (Stok & Sortir): kartu bergaris warna di atas, tanpa panah */
.flow { gap: 12px; }
.flow-step { border: 1px solid var(--line-2) !important; border-top: 4px solid var(--c, var(--line)) !important; border-radius: 12px; background: var(--ivory); padding: 14px 16px; }
.flow-step:not(:last-child)::after { display: none; }
.flow-step b { font-size: 20px; font-weight: 800; }
.flow-step.amber { --c: var(--s3); } .flow-step.gray { --c: var(--s-other); } .flow-step.blue { --c: var(--s4); }
.flow-step.green { --c: var(--s1); } .flow-step.violet { --c: var(--s2); }
.empty { color: var(--muted); }
/* tabel & tab lebar digulir di dalam kartunya sendiri, tidak melebarkan halaman (terutama di HP) */
.view > *, .grid > *, .card { min-width: 0; }
.card-b.flush { overflow-x: auto; }
.page-tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.page-tabs a { flex: none; }
.drawer-card { border-radius: 18px 0 0 18px; }
.modal-card { border-radius: 18px; }
.toast { border-radius: 12px; }
.map { border-radius: 0 0 var(--radius) var(--radius); }

/* =====================================================================
   DASHBOARD
   ===================================================================== */
.d-hero { position: relative; overflow: hidden; border-radius: 22px; padding: 30px 32px; color: #e8f3ea;
  background: radial-gradient(520px 300px at 92% -10%, rgba(150, 248, 120, .30), transparent 60%),
    radial-gradient(480px 340px at 70% 120%, rgba(33, 191, 97, .45), transparent 65%),
    linear-gradient(120deg, var(--midnight) 0%, #11401f 55%, #157a41 100%);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr); gap: 28px; align-items: end; }
.d-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000); mask-image: linear-gradient(90deg, transparent 30%, #000); }
.d-hero > * { position: relative; z-index: 1; }
.d-eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--fresh); font-weight: 700; }
.d-hero h2 { margin: 8px 0 6px; font-size: 28px; line-height: 1.18; letter-spacing: -.02em; color: #fff; font-weight: 800; }
.d-hero p { margin: 0; color: #b5cfbd; max-width: 460px; font-size: 14px; }
.d-cta { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.d-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; border: 0; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; text-decoration: none !important; transition: transform .15s ease; }
.d-btn:hover { transform: translateY(-1px); }
.d-btn.fresh { background: var(--fresh); color: var(--midnight); box-shadow: 0 8px 24px rgba(150, 248, 120, .25); }
.d-btn.ghost { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .18); }
.d-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.d-stat { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; padding: 16px 18px; }
.d-stat > span { font-size: 12px; color: #a9c5b1; }
.d-stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: #fff; margin: 4px 0 2px; line-height: 1.15; }
.d-stat b small { font-size: 15px; font-weight: 600; color: #a9c5b1; margin-left: 3px; }
.d-stat em { font-style: normal; font-size: 12px; color: var(--fresh); }
.d-stat .bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .12); margin-top: 10px; overflow: hidden; }
.d-stat .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--pulse), var(--fresh)); }

.d-todo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.d-td { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--ivory); border: 1px solid var(--line-2); min-width: 0; }
.d-td .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.d-td b { display: block; font-size: 13.5px; }
.d-td span.t { font-size: 12.5px; color: var(--ink-2); }
.d-link { color: var(--brand); font-weight: 700; font-size: 12.5px; text-decoration: none !important; white-space: nowrap; }
.d-link:hover { color: var(--brand-700); }
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; border-radius: 99px; padding: 2px 8px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.st.danger { color: var(--crit); background: var(--crit-bg); }
.st.warn { color: var(--warn); background: var(--warn-bg); }
.st.good { color: var(--good); background: var(--good-bg); }
.st.info { color: #3a3fa6; background: #ebecfb; }

.d-kpi { padding: 18px 20px; position: relative; }
.d-kpi .lbl { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.d-kpi .val { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.d-kpi .val small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.d-kpi .sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 20px; }
.d-kpi .spark { margin-top: 12px; height: 44px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 12px; border-radius: 99px; padding: 1px 7px; }
.delta.up { color: var(--good); background: var(--good-bg); }
.delta.down { color: var(--crit); background: var(--crit-bg); }
.delta.flat { color: var(--ink-2); background: var(--neutral); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.viz svg text { font-family: inherit; }
.viz .axis text { fill: var(--muted); font-size: 11px; }
.viz .grid-l { stroke: var(--line-2); stroke-width: 1; }
.viz .base-l { stroke: #d9d4cd; stroke-width: 1; }
.seg { display: inline-flex; background: var(--neutral); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.viz-tip { position: fixed; z-index: 3000; pointer-events: none; background: var(--midnight); color: #e8f3ea; border-radius: 10px; padding: 9px 12px; font-size: 12px; box-shadow: 0 10px 30px rgba(12, 43, 21, .25); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; min-width: 150px; }
.viz-tip.on { opacity: 1; transform: none; }
.viz-tip b { color: #fff; display: block; margin-bottom: 4px; }
.viz-tip .row { display: flex; justify-content: space-between; gap: 14px; }
.viz-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
details.tblv { margin-top: 12px; font-size: 12.5px; }
details.tblv summary { color: var(--brand); font-weight: 700; }
details.tblv table { width: 100%; border-collapse: collapse; margin-top: 8px; }
details.tblv td, details.tblv th { padding: 5px 6px; border-bottom: 1px solid var(--line-2); text-align: right; font-variant-numeric: tabular-nums; }
details.tblv td:first-child, details.tblv th:first-child { text-align: left; }

.sflow { display: grid; gap: 10px; }
.sf { display: grid; grid-template-columns: 128px minmax(0, 1fr) 76px; gap: 12px; align-items: center; font-size: 13px; }
.sf .track { height: 30px; border-radius: 8px; background: var(--neutral); position: relative; overflow: hidden; }
.sf .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.sf .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.sf small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.sf-conv { font-size: 11.5px; color: var(--muted); padding-left: 140px; margin: -4px 0; }
.d-note { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--nyanza); font-size: 12.5px; color: var(--brand); }

.gantt { display: grid; gap: 20px; padding-top: 10px; }
.gt-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; }
.gt-row b { font-size: 13px; display: block; }
.gt-row small { color: var(--muted); font-size: 11.5px; }
.gt-track { position: relative; height: 34px; border-radius: 9px; background: var(--ivory); border: 1px solid var(--line-2); }
.gt-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.gt-blk { position: absolute; top: 4px; bottom: 4px; border-radius: 7px; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; padding: 0 8px; white-space: nowrap; overflow: hidden; cursor: default; min-width: 6px; }
.gt-blk.completed { background: var(--brand-600); }
.gt-blk.started { background: linear-gradient(90deg, var(--brand-600), var(--pulse)); box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(33, 191, 97, .35); }
.gt-blk.planned { background: #fff; color: var(--brand); border: 1.5px solid var(--brand-600); }
.gt-blk.delivery { background: var(--s2); }
.gt-blk.delivery.planned { background: #fff; color: var(--s2); border-color: var(--s2); }
.gt-blk.cancelled { background: var(--line); color: var(--muted); }
.gt-now { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--crit); border-radius: 2px; z-index: 2; }
.gt-now::after { content: "sekarang"; position: absolute; top: -16px; left: -22px; font-size: 10.5px; font-weight: 700; color: var(--crit); }
.gt-axis { position: relative; height: 16px; margin: 8px 0 0 164px; font-size: 11px; color: var(--muted); }
.gt-axis span { position: absolute; transform: translateX(-50%); }

.stackbar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; gap: 2px; margin: 4px 0 14px; background: var(--neutral); }
.stackbar i { display: block; height: 100%; }
.mat-list { display: grid; gap: 8px; }
.mat-list > div { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 13px; }
.mat-list i { width: 10px; height: 10px; border-radius: 3px; }
.mat-list .k { font-weight: 700; font-variant-numeric: tabular-nums; }
.mat-list .p { color: var(--muted); width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

.cp-list { display: grid; gap: 4px; }
.cp-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 6px; border-radius: 10px; }
.cp-row:hover { background: var(--ivory); }
.cp-av { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: var(--brand); background: var(--nyanza); }
.cp-row b { font-size: 13.5px; }
.cp-row .meta { font-size: 11.5px; color: var(--muted); }
.cp-bar { height: 4px; border-radius: 99px; background: var(--neutral); margin-top: 5px; overflow: hidden; }
.cp-bar i { display: block; height: 100%; background: var(--s1); border-radius: 99px; }

/* =====================================================================
   OPTIMASI RUTE
   ===================================================================== */
.stepper-card { display: flex; align-items: center; gap: 20px; padding: 16px 20px; flex-wrap: wrap; }
.stepper { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 10px; padding: 6px 4px; min-width: 0; flex: 1; position: relative; }
.step:not(:last-child)::after { content: ""; flex: 1; height: 2px; min-width: 24px; background: var(--line); border-radius: 2px; margin-left: 6px; }
.step.done:not(:last-child)::after { background: var(--brand-600); }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 13px; background: var(--neutral); color: var(--muted); }
.step.now .step-n { background: var(--midnight); color: var(--fresh); box-shadow: 0 0 0 4px rgba(150, 248, 120, .35); }
.step.done .step-n { background: var(--brand-600); color: #fff; }
.step b { display: block; font-size: 13.5px; white-space: nowrap; }
.step small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.step:not(.now):not(.done) b { color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; }
.who .cp-av { width: 30px; height: 30px; font-size: 11px; flex: none; }
.opt-list { display: grid; gap: 10px; }
.opt-list > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; font-size: 13px; }
.opt-list span { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.opt-list b { font-weight: 600; }
details.adv > summary { color: var(--brand); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.p-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line-2); }
.p-kpis > div { padding: 16px 20px; display: grid; gap: 2px; border-right: 1px solid var(--line-2); min-width: 0; }
.p-kpis > div:last-child { border-right: 0; }
.p-kpis span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.p-kpis b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.p-kpis b .of { font-size: 14px; color: var(--muted); font-weight: 600; }
.p-kpis small { font-size: 12px; color: var(--muted); }
.ubars { padding: 14px 20px 16px; display: grid; gap: 10px; border-bottom: 1px solid var(--line-2); }
.ubars-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.ubar { display: grid; grid-template-columns: 170px minmax(0, 1fr) 52px; gap: 12px; align-items: center; font-size: 13px; }
.ubar span { font-weight: 600; }
.ubar small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.ubar .track { height: 10px; border-radius: 99px; background: var(--neutral); overflow: hidden; }
.ubar .track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-600), var(--pulse)); }
.ubar b { text-align: right; font-variant-numeric: tabular-nums; }
.ubar.off { opacity: .55; }
@media (max-width: 860px) {
  .p-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-kpis > div:nth-child(2) { border-right: 0; }
  .p-kpis > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-2); }
  .ubar { grid-template-columns: 110px minmax(0, 1fr) 46px; }
  .step:not(:last-child)::after { display: none; }
  .stepper { flex-direction: column; align-items: stretch; gap: 4px; }
  .step { flex: none; }
  .step b, .step small { white-space: normal; }
  .stepper-card .btn { width: 100%; justify-content: center; }
  .opt-list > div { grid-template-columns: 110px minmax(0, 1fr); }
}

/* =====================================================================
   TRACKING LIVE + KARTU RIT (dipakai juga di Optimasi Rute)
   ===================================================================== */
.live-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.live-strip > div { padding: 14px 18px; border-right: 1px solid var(--line-2); display: grid; gap: 2px; align-content: start; min-width: 0; }
.live-strip > div:last-child { border-right: 0; }
.live-strip span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.live-strip b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.live-strip b small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: -4px; }
.live-strip b.gps { font-size: 16px; }
.live-strip > div > small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-strip .bar { height: 6px; border-radius: 99px; background: var(--neutral); overflow: hidden; margin-top: 6px; }
.live-strip .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-600), var(--pulse)); }
.live-strip.deliv-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .live-strip.deliv-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-strip.deliv-strip > div { border-bottom: 1px solid var(--line-2); }
  .live-strip.deliv-strip > div:nth-child(even) { border-right: 0; }
  .live-strip.deliv-strip > div:nth-child(odd) { border-right: 1px solid var(--line-2); }
  .live-strip.deliv-strip > div:last-child { grid-column: auto; }
}
.live-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--pulse); box-shadow: 0 0 0 4px rgba(33, 191, 97, .18); animation: livepulse 2s infinite; flex: none; }
@keyframes livepulse { 50% { box-shadow: 0 0 0 7px rgba(33, 191, 97, .04); } }
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.live-map { overflow: hidden; }
.live-map .map.tall { height: calc(100vh - 250px); min-height: 520px; border-radius: var(--radius); }
.live-side { display: flex; flex-direction: column; max-height: calc(100vh - 250px); min-height: 520px; }
.live-side .trip-list, .live-side .feed { flex: 1; max-height: none; overflow: auto; }
.live-side [hidden] { display: none !important; }
.veh-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px 0; }
.veh-chips:empty { display: none; }
.veh-chips button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 11px; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.veh-chips button.on { background: var(--midnight); border-color: var(--midnight); color: #fff; }
.veh-chips .dot { width: 8px; height: 8px; }

.trip { border-color: var(--line-2); border-radius: 12px; box-shadow: var(--shadow-sm); }
.trip-h { border-left: 0; padding: 12px 14px 8px; }
.trip-h:hover { background: var(--ivory); }
.trip-prog { height: 4px; margin: 0 14px 6px; border-radius: 99px; background: var(--neutral); overflow: hidden; }
.trip-prog i { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--brand-600)); }
.stops { padding: 2px 14px 10px 14px; position: relative; }
.stops li { position: relative; border-bottom: 0; padding: 7px 0; }
.stops li:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 26px; bottom: -8px; width: 2px; background: var(--line-2); }
.seq { position: relative; z-index: 1; box-shadow: 0 0 0 3px #fff; }
.feed-item { padding: 10px 16px; align-items: start; }
.feed-item .fdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 1px; }

@media (max-width: 1280px) {
  .live-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .live-strip > div:nth-child(3) { border-right: 0; }
  .live-strip > div:nth-child(-n+3) { border-bottom: 1px solid var(--line-2); }
  .live-grid { grid-template-columns: minmax(0, 1fr); }
  .live-side { max-height: none; min-height: 0; }
  .live-map .map.tall { height: 60vh; min-height: 380px; }
}
@media (max-width: 560px) {
  .live-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-strip > div { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .live-strip > div:nth-child(odd) { border-right: 1px solid var(--line-2); }
  .live-strip > div:last-child { grid-column: 1 / -1; border-right: 0; }
}

.rise { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } .sf .track i { transition: none; } .d-btn { transition: none; } }

@media (max-width: 1280px) { .d-hero { grid-template-columns: minmax(0, 1fr); } .d-todo { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .page-head { padding: 16px 16px 0; } .view { padding: 12px 16px 32px; }
  .d-hero { padding: 22px 18px; border-radius: 18px; } .d-hero h2 { font-size: 22px; }
  .gt-row { grid-template-columns: 96px minmax(0, 1fr); } .gt-axis { margin-left: 110px; }
}
@media (max-width: 560px) {
  .appbar { gap: 6px; padding: 0 10px 0 6px; }
  .date-nav #prevDay, .date-nav #nextDay { display: none; }
  .date-nav input { width: 128px; }
  .d-stats { grid-template-columns: minmax(0, 1fr); }
  .sf { grid-template-columns: 80px minmax(0, 1fr) 60px; } .sf-conv { padding-left: 92px; }
}

/* =====================================================================
   TAMPILAN 2026 — kaca hijau mint, huruf Geist, ikon Phosphor.
   Blok ini sengaja di akhir file agar menimpa gaya lama tanpa mengubah markup halaman.
   ===================================================================== */
:root {
  --deep: #0e3224; --ink-x: #0c2b15; --ink-x2: #16452a; --text-x: #1b2a21; --muted-x: #66766d; --faint-x: #93a199;
  --canvas: #e9f0ec; --canvas-2: #f4f7f5; --mint: #dcebe3; --lime: #96f878;
  --line-x: rgba(12, 43, 21, .08); --line-y: rgba(12, 43, 21, .14);
  --sh-x: 0 1px 2px rgba(12, 43, 21, .05), 0 14px 34px -16px rgba(12, 43, 21, .18);
  --sh-float: 0 2px 6px rgba(12, 43, 21, .06), 0 24px 48px -20px rgba(12, 43, 21, .28);
  --ease-x: cubic-bezier(.23, 1, .32, 1);
  --radius: 24px; --radius-sm: 12px; --side-w: 264px;
  font-family: "Geist", "Segoe UI", system-ui, sans-serif; color: var(--text-x);
}
html, body { font-size: 14px; background: var(--deep); color: var(--text-x); font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-weight: 500; letter-spacing: -.015em; color: var(--ink-x); }
.muted { color: var(--muted-x); }
a { color: var(--brand); }
.mono { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; }
i.ph { line-height: 1; }
.ic { display: inline-block; vertical-align: -0.15em; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 440px); grid-template-rows: 1fr auto; min-height: 0; background: #0b2018; overflow: hidden; }
.login.hidden { display: none !important; }
.login-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); animation: login-drift 24s ease-out forwards; }
@keyframes login-drift { to { transform: scale(1); } }
.login::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(8, 26, 17, .78) 0%, rgba(8, 26, 17, .35) 45%, rgba(8, 26, 17, .1) 70%), linear-gradient(0deg, rgba(8, 26, 17, .55), transparent 40%); }
.login-top { position: absolute; z-index: 3; top: 28px; left: 36px; right: 36px; display: flex; justify-content: space-between; align-items: center; color: rgba(255, 255, 255, .82); font-size: 14px; }
.login .login-logo { display: flex; align-items: center; gap: 12px; width: auto; height: auto; border-radius: 0; font-weight: 600; font-size: 21px; letter-spacing: .02em; color: #fff; }
.mark-logo { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: rgba(250, 252, 251, .94); box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
.mark-logo img { width: 34px; height: 34px; }
.login-copy { position: relative; z-index: 2; align-self: end; padding: 0 36px 56px; color: #fff; max-width: 780px; }
.login-copy h1 { margin: 0; color: #fff; font-size: clamp(48px, 7.4vw, 104px); line-height: .95; font-weight: 600; letter-spacing: -.045em; }
.login-copy p { margin: 22px 0 0; max-width: 46ch; font-size: 17px; color: rgba(255, 255, 255, .82); }
.login .login-card { position: relative; z-index: 2; align-self: center; width: auto; margin: 0 36px 0 0; padding: 30px 28px; border-radius: 26px; background: rgba(250, 252, 251, .88); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); box-shadow: var(--sh-float); display: grid; gap: 14px; }
.login-card h2 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.login-card > p { margin: -6px 0 2px; }
.login-card .btn.block { height: 48px; font-size: 15px; }
.login-card .alt { margin: 0; text-align: center; font-size: 14px; color: var(--muted-x); }
.login-strip { position: relative; z-index: 2; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(250, 252, 251, .94); }
.login-strip div { padding: 16px 36px; border-left: 1px solid var(--line-x); font-size: 14px; color: var(--muted-x); }
.login-strip div:first-child { border-left: 0; }
.login-strip b { display: block; font-size: 17px; font-weight: 500; color: var(--ink-x); letter-spacing: -.01em; }

/* ---------- kerangka ---------- */
.shell { position: fixed; inset: 12px; z-index: 10; min-height: 0; border-radius: 28px; overflow: hidden; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  background: linear-gradient(180deg, #e3ece7 0%, #eef3f0 38%, #f3f6f4 100%); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .5); }
.shell.hidden { display: none !important; }
.shell.collapsed { --side-w: 84px; }
.sidebar { grid-row: auto; position: relative; top: auto; height: auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 20px 14px 12px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
  background: transparent; color: var(--text-x); border-right: 1px solid var(--line-x); transition: none; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 2px; font-weight: 600; font-size: 19px; letter-spacing: .02em; color: var(--ink-x); text-decoration: none !important; white-space: nowrap; }
.side-brand img { width: 36px; height: 36px; border-radius: 11px; flex: none; }
.side-brand em { font-style: normal; font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--muted-x); background: rgba(255, 255, 255, .7); padding: 2px 8px; border-radius: 99px; vertical-align: 2px; }
.sidebar .appbar-search { display: flex !important; position: relative; width: auto; height: 40px; padding: 0 12px 0 14px; border: 0; border-radius: 99px; background: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 1px var(--line-x); color: var(--faint-x); }
.sidebar .appbar-search input { min-width: 0; font-size: 14px; }
.sidebar .appbar-search kbd { font: 500 11px "Geist Mono", monospace; color: var(--faint-x); background: rgba(255, 255, 255, .85); padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.sidebar .appbar-search .menu { left: 0; right: 0; min-width: 0; }
.side-live { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8); }
.side-live-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-live b { display: block; margin-top: 6px; font-weight: 500; color: var(--ink-x); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { padding: 0; font-size: 12.5px; color: var(--muted-x); gap: 7px; }
.live-dot i { width: 8px; height: 8px; background: #aab4ae; }
.live-dot.on { color: var(--muted-x); }
.live-dot.on i { background: var(--pulse); box-shadow: 0 0 0 0 rgba(33, 191, 97, .5); animation: x-pulse 2s infinite; }
@keyframes x-pulse { 70% { box-shadow: 0 0 0 7px rgba(33, 191, 97, 0); } 100% { box-shadow: 0 0 0 0 rgba(33, 191, 97, 0); } }
nav { padding: 0; overflow: visible; flex: none; }
.nav-group { margin: 0; padding: 12px 12px 4px; font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--faint-x); font-weight: 400; }
.nav-item { height: 42px; padding: 0 12px; gap: 12px; border-radius: 14px; color: #33443a; font-weight: 400; font-size: 14.5px; transition: background .16s, color .16s; }
.nav-item .nav-ic { color: #4a5b51; width: 22px; }
.nav-item .nav-ic i { font-size: 19px !important; }
.nav-item:hover { background: rgba(255, 255, 255, .55); color: var(--ink-x); text-decoration: none; }
.nav-item.active { background: #fff; color: var(--ink-x); font-weight: 500; box-shadow: var(--sh-x); }
.nav-item.active::before { display: none; }
.nav-item.active .nav-ic { color: var(--brand); }
.side-foot { margin-top: auto; padding: 8px 0 0; border-top: 1px solid var(--line-x); }
.shell.collapsed .appbar-search, .shell.collapsed .side-live, .shell.collapsed .side-brand .nav-label { display: none !important; }
.shell.collapsed .side-brand { justify-content: center; padding: 0; }
.shell.collapsed .nav-item { justify-content: center; padding: 0; }
.side-scrim { display: none; }

.main { grid-row: auto; grid-column: auto; position: relative; display: block; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.appbar { grid-column: auto; position: sticky; top: 0; z-index: 900; height: auto; min-height: 76px; display: flex; align-items: center; gap: 14px; padding: 16px 28px 12px;
  background: linear-gradient(180deg, rgba(233, 240, 236, .96), rgba(233, 240, 236, .78)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 0; isolation: auto; }
.appbar::before { display: none !important; }
.page-titles { min-width: 0; }
.page-titles .crumbs { display: none; }
.page-titles h1 { margin: 0; font-size: 24px; font-weight: 500; letter-spacing: -.025em; color: var(--ink-x); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-titles p { margin: 1px 0 0; font-size: 13.5px; color: var(--muted-x); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.round-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; display: inline-grid; place-items: center; background: var(--ink-x); color: #fff; cursor: pointer; text-decoration: none !important; transition: transform 160ms var(--ease-x), background .2s; }
.round-btn:hover { background: var(--ink-x2); }
.round-btn:active { transform: scale(.94); }
.round-btn.light { background: #fff; color: var(--ink-x); box-shadow: inset 0 0 0 1px var(--line-x); }
.round-btn.light:hover { background: var(--canvas-2); }
.round-btn.sm { width: 32px; height: 32px; }
.date-nav { display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 5px; border: 0; border-radius: 99px; background: var(--ink-x); color: #fff; }
.date-nav input { color: #fff; color-scheme: dark; font-weight: 500; font-size: 13.5px; padding: 4px 4px; width: 132px; }
.date-btn { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; }
.date-btn:hover { background: rgba(255, 255, 255, .12); }
.org-select { height: 40px; padding: 0 16px; gap: 8px; border: 0; border-radius: 99px; background: var(--ink-x); color: #fff; font-weight: 500; font-size: 13.5px; }
.dot-badge { top: 2px; right: 2px; background: var(--lime); color: var(--ink-x); border-color: var(--ink-x); }
.avatar-btn { width: 40px; height: 40px; border-radius: 13px; background: var(--mint); color: var(--ink-x); font-weight: 600; font-size: 14px; }
.view { max-width: none; padding: 8px 28px 40px; gap: 16px; }

/* ---------- komponen umum ---------- */
.card { border: 0; border-radius: var(--radius); box-shadow: var(--sh-x); background: #fff; }
.card-h { min-height: 56px; padding: 16px 22px; border-bottom: 1px solid var(--line-x); gap: 12px; }
.card-h h2 { font-size: 17px; font-weight: 500; }
.card-h p.small, .card-h .muted.small { margin: 2px 0 0; font-size: 13px; }
.card-b { padding: 18px 22px; }
.btn { height: 38px; padding: 0 16px; border: 0; border-radius: 99px; background: #fff; color: var(--ink-x); box-shadow: inset 0 0 0 1px var(--line-y); font-weight: 500; gap: 8px; transition: transform 160ms var(--ease-x), background .2s; }
.btn:hover { background: var(--canvas-2); border: 0; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--ink-x); color: #fff; box-shadow: none; border: 0; }
.btn.primary:hover { background: var(--ink-x2); }
.btn.accent { background: var(--lime); color: var(--ink-x); box-shadow: none; }
.btn.danger { color: var(--crit); box-shadow: inset 0 0 0 1px #f2c4c4; }
.btn.danger:hover { background: #fff5f5; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(12, 43, 21, .05); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn.block { height: 46px; border-radius: 99px; }
.btn-group .btn:first-child { border-radius: 99px 0 0 99px; }
.btn-group .btn:last-child { border-radius: 0 99px 99px 0; }
.icon-btn { border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-x); background: #fff; color: var(--ink-x); }
.icon-btn.ghost { box-shadow: none; background: transparent; }
.field > span { font-size: 13px; color: var(--muted-x); font-weight: 500; }
.field input, .field select, .field textarea, .input { min-height: 42px; padding: 9px 14px; border: 0; border-radius: 14px; background: var(--canvas-2); box-shadow: inset 0 0 0 1px var(--line-x); transition: box-shadow .2s, background .2s; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--brand); border: 0; }
.search-box { height: 40px; border: 0; border-radius: 99px; background: var(--canvas-2); box-shadow: inset 0 0 0 1px var(--line-x); }
.search-box:focus-within { box-shadow: inset 0 0 0 1.5px var(--brand); }
.badge { border-radius: 99px; padding: 3px 10px; font-weight: 500; font-size: 12px; }
.badge.gray { background: var(--canvas-2); color: #44544a; }
.badge.lime { background: var(--mint); color: var(--brand); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--canvas-2); color: var(--ink-x); }
.pill.jalan { background: var(--ink-x); color: #fff; }
.pill.ok { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--crit-bg); color: var(--crit); }
.pill.line { background: transparent; box-shadow: inset 0 0 0 1px var(--line-y); color: var(--muted-x); }
.side-live .pill { height: 22px; font-size: 11.5px; background: var(--ink-x); color: #fff; }
.tbl th { background: transparent; color: var(--muted-x); font-weight: 500; font-size: 12.5px; letter-spacing: 0; border-bottom: 1px solid var(--line-x); padding: 12px 14px; }
.tbl td { border-bottom: 1px solid var(--line-x); padding: 12px 14px; }
.tbl tbody tr:hover td { background: var(--canvas-2); }
.tbl tr.selected td { background: var(--mint); }
.tbl tfoot td { background: var(--canvas-2); font-weight: 600; }
.toolbar { border-bottom: 1px solid var(--line-x); padding: 12px 22px; }
.pager { border-top: 1px solid var(--line-x); padding: 10px 22px; }
.tabs, .seg { background: var(--canvas-2); box-shadow: inset 0 0 0 1px var(--line-x); border-radius: 99px; padding: 3px; }
.tabs button, .seg button { border-radius: 99px; font-weight: 500; font-size: 13px; padding: 6px 13px; color: var(--muted-x); }
.tabs button.active, .seg button.on { background: #fff; color: var(--ink-x); box-shadow: 0 1px 3px rgba(12, 43, 21, .12); }
.page-tabs { border-bottom: 1px solid var(--line-x); gap: 6px; }
.page-tabs a { font-weight: 500; color: var(--muted-x); border-radius: 12px 12px 0 0; }
.page-tabs a.active { color: var(--ink-x); border-bottom-color: var(--ink-x); }
.alert { border-radius: 16px; padding: 12px 16px; border: 0; }
.alert.warn { background: var(--warn-bg); color: #7a4e00; }
.alert.danger { background: var(--crit-bg); color: #8f2525; }
.alert.info { background: #eef4f1; color: #2c4a3a; }
.alert.brand { background: var(--mint); color: var(--ink-x); }
.menu { border: 0; border-radius: 18px; padding: 8px; box-shadow: var(--sh-float); }
.menu-item { border-radius: 12px; padding: 9px 12px; }
.menu-item:hover, .menu-item.hl { background: var(--canvas-2); }
.menu-head { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.modal { background: rgba(8, 26, 17, .45); }
.modal-card { border-radius: 26px; }
.drawer { background: rgba(8, 26, 17, .32); }
.drawer-card { border-radius: 26px 0 0 26px; }
.modal-foot, .drawer-foot { border-top: 1px solid var(--line-x); }
.kv { border: 1px solid var(--line-x); border-radius: 16px; }
.kv > div:nth-child(odd) { background: var(--canvas-2); }
.toast { border-radius: 16px; background: var(--ink-x); border-left: 0; box-shadow: var(--sh-float); padding: 12px 16px; }
.toast.err { background: #8f2525; }
.empty { color: var(--muted-x); }
.kpi .value, .d-kpi .val, .p-kpis b, .live-strip b, .flow-step b { font-weight: 400; letter-spacing: -.03em; color: var(--ink-x); }
.d-kpi .val { font-size: 32px; }
.p-kpis b, .live-strip b { font-size: 26px; }
.flow-step { background: var(--canvas-2); border-radius: 18px; }
.trip { border: 0; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line-x); }
.day-col { border: 0; border-radius: 18px; background: var(--canvas-2); }
.chip { border: 0; background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(12, 43, 21, .06); }
.cp-av, .who .cp-av { border-radius: 11px; background: var(--mint); color: var(--ink-x); font-weight: 600; }
.d-note { background: var(--mint); color: var(--ink-x); border-radius: 16px; }
.delta { font-weight: 500; }
.stackbar { border-radius: 6px; }
.viz-tip { background: #fff; color: var(--muted-x); box-shadow: var(--sh-float); border-radius: 14px; }
.viz-tip b { color: var(--ink-x); }
.gt-track { background: var(--canvas-2); border: 0; border-radius: 10px; }

/* ---------- peta ---------- */
.map, .map.tall { border-radius: 0 0 var(--radius) var(--radius); background: #eef1ec; }
.map.tall { border-radius: var(--radius); }
.map-legend { border: 0; border-radius: 16px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--sh-float); }
.mk-square { border-radius: 11px; box-shadow: 0 6px 16px rgba(12, 43, 21, .35); }
.mk-truck { width: 34px; height: 34px; color: #fff; font-size: 17px; }
.mk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-x); border: 2px solid #fff; }
.mk3d { line-height: 0; cursor: pointer; }
.leaflet-container, .maplibregl-map { font-family: "Geist", system-ui, sans-serif; }
.leaflet-popup-content-wrapper, .maplibregl-popup-content { border-radius: 16px; box-shadow: var(--sh-float); }
.leaflet-popup-content { font-family: "Geist", system-ui, sans-serif; }
.maplibregl-popup-content { padding: 12px 14px; font-size: 13px; min-width: 200px; }
.maplibregl-popup-close-button { font-size: 18px; padding: 2px 8px; }
.maplibregl-ctrl-group { border-radius: 14px !important; box-shadow: var(--sh-x) !important; overflow: hidden; }
.leaflet-control-layers, .leaflet-bar { border: 0 !important; border-radius: 14px !important; box-shadow: var(--sh-x) !important; overflow: hidden; }
.live-map .map.tall, .live-side { height: calc(100vh - 230px); max-height: none; }

/* ---------- dashboard ---------- */
.dash-hero { position: relative; height: 300px; padding: 0; overflow: hidden; background: #f2f5f3; }
.dash-hero-img { position: absolute; right: 0; top: 0; width: 78%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.dash-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #eef3f0 18%, rgba(238, 243, 240, .82) 34%, rgba(238, 243, 240, 0) 62%); pointer-events: none; }
.hero-chips { position: absolute; z-index: 2; left: 24px; top: 26px; display: grid; gap: 10px; justify-items: start; }
.hero-chips .glass-chip:nth-child(2) { margin-left: 70px; }
.hero-chips .glass-chip:nth-child(3) { margin-left: 28px; }
.glass-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 6px; border-radius: 99px; background: rgba(255, 255, 255, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--sh-x); font-size: 14px; font-weight: 500; color: var(--ink-x); white-space: nowrap; }
.glass-chip i { width: 28px; height: 28px; border-radius: 50%; display: grid !important; place-items: center; background: #fff; }
.hero-kpis { position: absolute; z-index: 2; right: 22px; top: 22px; display: grid; grid-template-columns: repeat(3, minmax(140px, 190px)); gap: 10px; }
.hero-kpi { padding: 16px 16px 14px; border-radius: 18px; background: rgba(255, 255, 255, .76); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 10px 30px -18px rgba(12, 43, 21, .3); color: inherit; text-decoration: none !important; transition: transform .2s var(--ease-x); min-width: 0; }
.hero-kpi:hover { transform: translateY(-2px); }
.hk-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hk-top > i { width: 32px; height: 32px; border-radius: 50%; display: grid !important; place-items: center; background: #fff; box-shadow: inset 0 0 0 1px var(--line-x); color: var(--ink-x); flex: none; }
.hero-kpi .big { font-size: 38px; font-weight: 300; letter-spacing: -.04em; line-height: 1; color: var(--ink-x); white-space: nowrap; }
.hero-kpi .big small { font-size: 15px; letter-spacing: 0; color: var(--muted-x); font-weight: 400; margin-left: 4px; }
.hero-kpi p { margin: 8px 0 0; font-size: 13px; color: var(--muted-x); }
.hero-foot { position: absolute; z-index: 2; left: 24px; bottom: 22px; display: flex; gap: 8px; }
.dash-alerts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dash-alert { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; border-radius: 18px; background: rgba(255, 255, 255, .62); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .85); font-size: 14px; min-width: 0; }
.da-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--mint); color: var(--brand); }
.dash-alert.danger .da-ic { background: var(--crit-bg); color: var(--crit); }
.dash-alert.warn .da-ic { background: var(--warn-bg); color: var(--warn); }
.da-t { min-width: 0; flex: 1; }
.da-t b { display: block; font-weight: 500; color: var(--ink-x); }
.da-t span { color: var(--muted-x); font-size: 13.5px; }
.dash-alert .btn { flex: none; }
.dash-more { grid-column: 1 / -1; justify-self: start; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr) minmax(0, 1fr); grid-template-areas: "orders chart fleet" "orders tiles fleet"; gap: 16px; align-items: start; }
.dg-orders { grid-area: orders; } .dg-chart { grid-area: chart; } .dg-fleet { grid-area: fleet; }
.dg-tiles { grid-area: tiles; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.olist { display: grid; padding-top: 6px; max-height: 560px; overflow: auto; }
.oitem { display: grid; gap: 3px; padding: 12px 0; border-top: 1px solid var(--line-x); }
.oitem:first-child { border-top: 0; }
.oitem .r1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.oitem b { font-weight: 500; color: var(--ink-x); font-size: 15px; }
.oitem .r2 { font-size: 13.5px; color: var(--muted-x); }
.oitem .r3 { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--faint-x); }
.oitem .r3 span { display: inline-flex; align-items: center; gap: 5px; }
.fleet-photo { height: 176px; margin: 0 0 14px; border-radius: 18px; overflow: hidden; background: var(--canvas-2); }
.fleet-photo img { width: 100%; height: 100%; object-fit: cover; transition: opacity .26s; }
.fleet-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.fleet-stats span { display: block; font-size: 12.5px; color: var(--muted-x); }
.fleet-stats b { font-size: 21px; font-weight: 400; letter-spacing: -.02em; color: var(--ink-x); }
.fleet-note { margin: 16px 0 0; font-size: 13.5px; color: var(--muted-x); line-height: 1.5; }
.tile { padding: 16px; border-radius: 20px; }
.tile h3 { margin: 0 0 10px; font-size: 14px; font-weight: 500; display: flex; justify-content: space-between; gap: 6px; }
.tile.dark { background: var(--ink-x); }
.tile.dark h3 { color: #fff; }
.tile.dark h3 span { color: var(--lime); }
.tile.dark p { margin: 10px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.tile p { margin: 6px 0 0; }
.tile-big { font-size: 30px; font-weight: 300; letter-spacing: -.03em; color: var(--ink-x); line-height: 1.1; }
.ring { display: grid; place-items: center; }
.ring text { font: 300 22px "Geist", sans-serif; fill: var(--ink-x); }
.ring-arc { transition: stroke-dashoffset 1s var(--ease-x); }
.dots { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.dots i { aspect-ratio: 1.6; border-radius: 3px; background: rgba(255, 255, 255, .12); }
.dots i.on { background: var(--lime); }
.cp-row:hover { background: var(--canvas-2); }

@media (max-width: 1280px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); grid-template-areas: "chart chart" "orders fleet" "tiles tiles"; }
  .hero-kpis { grid-template-columns: repeat(3, minmax(120px, 160px)); }
}
@media (max-width: 1100px) { .org-select { display: none; } }
@media (max-width: 900px) {
  .shell { inset: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr); box-shadow: none; }
  .shell.collapsed { --side-w: 264px; }
  .sidebar { position: fixed; z-index: 1500; left: 0; top: 0; bottom: 0; height: auto; width: 284px; background: #eef3f0; transform: translateX(-100%); transition: transform .28s var(--ease-x); box-shadow: var(--sh-float); }
  .shell.side-open .sidebar { transform: none; }
  .shell.side-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 1400; background: rgba(8, 26, 17, .35); }
  .shell.collapsed .appbar-search, .shell.collapsed .side-live { display: flex !important; }
  .shell.collapsed .side-live { display: block !important; }
  .shell.collapsed .side-brand .nav-label { display: inline !important; }
  .shell.collapsed .nav-label, .shell.collapsed .nav-group { display: block; }
  .shell.collapsed .nav-item { justify-content: flex-start; padding: 0 12px; }
  .appbar { padding: 12px 16px; gap: 10px; flex-wrap: wrap; min-height: 0; }
  .page-titles { flex: 1; }
  .page-titles h1 { font-size: 20px; }
  .page-titles p, #todayBtn, #helpBtn { display: none; }
  .appbar-right { width: 100%; justify-content: flex-end; }
  .view { padding: 4px 16px 32px; }
  .dash-hero { height: 430px; }
  .dash-hero-img { width: 100%; height: 55%; top: auto; bottom: 0; }
  .dash-hero::after { background: linear-gradient(180deg, #eef3f0 40%, rgba(238, 243, 240, 0) 70%); }
  .hero-chips { top: 16px; left: 16px; }
  .hero-chips .glass-chip:nth-child(n) { margin-left: 0; }
  .hero-kpis { left: 14px; right: 14px; top: auto; bottom: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hero-kpi { padding: 12px; }
  .hero-kpi .big { font-size: 24px; }
  .hero-kpi p { font-size: 12px; line-height: 1.35; }
  .hk-top > i, .hero-foot { display: none !important; }
  .dash-alerts, .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-grid { grid-template-areas: "chart" "orders" "fleet" "tiles"; }
  .dg-tiles { grid-template-columns: 1fr 1fr; }
  .dg-tiles > :last-child { grid-column: 1 / -1; }
  .dash-alert { flex-wrap: wrap; }
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto auto; overflow-y: auto; }
  .login-top { left: 20px; right: 20px; top: 20px; }
  .login-top > span { display: none; }
  .login-copy { padding: 120px 20px 24px; }
  .login .login-card { margin: 0 16px 16px; }
  .login-strip div { padding: 12px 14px; font-size: 12.5px; }
  .login-strip b { font-size: 14px; }
  .live-map .map.tall { height: 58vh; }
  .live-side { height: auto; }
}
@media (prefers-reduced-motion: reduce) { .login-bg, .live-dot.on i { animation: none; } .ring-arc { transition: none; } }
