/* ===== Media Cargo — soft glass design system ===== */
:root {
  --red: #E11E26;
  --red-600: #C2161D;
  --red-700: #9E1318;
  /* Warna utama & aksen bisa ditimpa per merek (shared/_brand_head). Komponen
     RGB-nya terpisah supaya rgba() di bawah ikut berganti. */
  --red-rgb: 225,30,38;
  --gold-rgb: 203,161,53;
  --red-soft: rgba(var(--red-rgb),.10);
  --red-soft-2: rgba(var(--red-rgb),.16);
  --gold: #CBA135;
  --gold-dark: #A9851B;
  --gold-soft: rgba(var(--gold-rgb),.16);

  --ink: #20242b;
  --muted: #66707c;
  --faint: #9aa3af;
  --line: rgba(20,28,40,.10);
  --line-2: rgba(20,28,40,.06);

  /* glass surfaces */
  --glass: rgba(255,255,255,.66);
  --glass-strong: rgba(255,255,255,.82);
  --glass-border: rgba(255,255,255,.7);
  --blur: saturate(160%) blur(14px);

  --slate-bg:#eef1f5; --slate-ink:#516074;
  --blue-bg:#e9f1ff;  --blue-ink:#2563eb;
  --amber-bg:#fdf1df; --amber-ink:#b4730b;
  --indigo-bg:#eeecfe;--indigo-ink:#5b4be0;
  --green-bg:#e6f7ee; --green-ink:#1c8a4e;
  --rose-bg:#fdecec;  --rose-ink:#cf2230;

  /* Grafik: satu seri memakai biru; tangga biru untuk kategori berurutan
     (umur piutang, muda → tua). Sudah dicek kontras & beda kecerahannya
     terhadap kartu terang (#f9fafc). Merah merek sengaja tidak dipakai —
     di grafik merah terbaca sebagai "buruk". */
  --chart-series: #2a78d6;
  --chart-ramp-1: #86b6ef; --chart-ramp-2: #5598e7; --chart-ramp-3: #2a78d6;
  --chart-ramp-4: #1c5cab; --chart-ramp-5: #104281;
  --chart-grid: #e1e0d9;
  --chart-axis: #c3c2b7;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(20,28,40,.04), 0 12px 30px -16px rgba(20,28,40,.22);
  --shadow-lg: 0 24px 60px -24px rgba(20,28,40,.32);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: #eef1f7;
}
/* soft brand-tinted ambient background */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1100px 600px at 110% -10%, rgba(var(--red-rgb),.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(var(--gold-rgb),.12), transparent 55%),
    linear-gradient(180deg, #f7f9fc, #eef1f7);
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-600); }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; font-weight: 750; }
h2 { font-size: 15px; margin: 26px 0 12px; letter-spacing: -.005em; font-weight: 700; }

/* ===== App shell ===== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px; flex-shrink: 0;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40;
}
.sidebar .logo-chip { margin: 18px 18px 8px; padding: 12px 14px;
  background: rgba(255,255,255,.7); border: 1px solid var(--glass-border);
  border-radius: 14px; box-shadow: var(--shadow); }
.sidebar .logo-chip img { width: 100%; display: block; }

.nav { padding: 8px 12px; overflow-y: auto; flex: 1; }
.nav .group { margin: 16px 8px 6px; font-size: 10.5px; font-weight: 800;
  letter-spacing: .13em; text-transform: uppercase; color: var(--faint); }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin: 2px 0; border-radius: 11px;
  color: var(--ink); font-weight: 560; font-size: 14px;
  transition: background .15s, color .15s, transform .12s;
}
.nav a .ico { width: 20px; text-align: center; font-size: 15px; opacity: .85; }
.nav a:hover { background: rgba(20,28,40,.05); transform: translateX(2px); }
.nav a.active {
  background: linear-gradient(100deg, var(--red-soft-2), var(--red-soft));
  color: var(--red-600); font-weight: 680;
  box-shadow: inset 3px 0 0 var(--red);
}
.nav a.active .ico { opacity: 1; }

/* Tombol "Pasang Aplikasi" (PWA) — tersembunyi sampai browser menawarkan pemasangan. */
.install-app { margin: 0 12px; justify-content: center; font-size: 13px; padding: 9px 12px; }
.install-app[hidden] { display: none; }

.userbox { margin: 12px; padding: 12px; border-radius: 13px;
  background: rgba(255,255,255,.55); border: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--red), var(--gold)); color: #fff;
  font-weight: 700; font-size: 13px; display: grid; place-items: center;
  box-shadow: 0 6px 14px -6px var(--red); }
.userbox .meta { flex: 1; min-width: 0; }
.userbox .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox .meta span { font-size: 11.5px; color: var(--muted); }
.userbox .meta b a { color: inherit; }
.userbox .meta b a:hover { color: var(--red); }
.userbox form { margin: 0; }
.userbox button { background: rgba(255,255,255,.7); border: 1px solid var(--line);
  color: var(--muted); padding: 6px 10px; font-size: 12px; border-radius: 9px; box-shadow: none; }
.userbox button:hover { background: #fff; color: var(--ink); transform: none; }

/* mobile top bar (hidden on desktop) */
.mobile-bar { display: none; }
.scrim { display: none; }

/* ===== Content ===== */
.content { flex: 1; min-width: 0; }
.container { max-width: 1600px; margin: 0 auto; padding: 26px 30px 70px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .muted { margin-top: 4px; }

/* speed-streak motif */
.streaks { position: relative; overflow: hidden; }
.streaks::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(100deg, transparent 0 9px, rgba(255,255,255,.10) 9px 10px);
  mask-image: linear-gradient(90deg, transparent, #000 45%); animation: drift 9s linear infinite; }
@keyframes drift { from { background-position: 0 0; } to { background-position: 120px 0; } }

/* Dashboard hero */
.hero { color: #fff; border-radius: var(--radius); padding: 26px 28px; margin-bottom: 24px;
  background: linear-gradient(110deg, var(--red-700), var(--red) 55%, #e1591f);
  box-shadow: 0 20px 50px -24px rgba(var(--red-rgb),.6); }
.hero h1 { color: #fff; }
.hero p { margin: 6px 0 0; color: rgba(255,255,255,.88); font-size: 14px; }
.hero .accent { height: 3px; width: 60px; background: var(--gold); border-radius: 3px; margin-bottom: 14px; }

/* ===== Cards & stats ===== */
.card { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat { position: relative; overflow: hidden; padding: 18px 20px; border-radius: var(--radius);
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s; }
.stat::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px;
  background: linear-gradient(180deg, var(--red), var(--gold)); }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat .num { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.stat .ico { position: absolute; right: 14px; top: 14px; font-size: 20px; opacity: .22; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 520px;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
th { background: rgba(255,255,255,.5); color: var(--muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(var(--red-rgb),.035); }
tr:last-child td { border-bottom: 0; }
tfoot th { background: transparent; color: var(--ink); }
.text-right { text-align: right; }

/* ===== Forms ===== */
form .field { margin-bottom: 15px; }
form .field small { display: block; margin-top: 5px; font-size: 12px; line-height: 1.4; }
label { display: block; font-size: 13px; color: var(--ink); margin-bottom: 5px; font-weight: 600; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 14px; background: rgba(255,255,255,.8); transition: border-color .15s, box-shadow .15s; font-family: inherit; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); background: #fff; }
/* Rincian Catat Pembayaran: Total − Diskon − Total bayar = Sisa. */
.pay-calc { width: 100%; min-width: 0; max-width: 420px; background: none; box-shadow: none; border: 0; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none; margin-left: auto; border-collapse: collapse; font-size: 14px; }
.pay-calc td { padding: 6px 0; border: 0; }
.pay-calc td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.pay-calc__sisa td { border-top: 1px solid var(--line); font-weight: 750; padding-top: 9px; }
.pay-calc__over { color: var(--red); }
/* Isian yang dihitung sendiri (mis. volume dari P×L×T): terlihat terkunci. */
input[readonly] { background: rgba(0,0,0,.04); color: var(--muted); cursor: not-allowed; }
.checkbox { display: flex; align-items: center; gap: 8px; }
/* Isian berawalan terkunci, mis. No. STT "MC-" + angka yang diketik. */
.prefixed { display: flex; align-items: stretch; }
.prefixed__lock { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: rgba(0,0,0,.04); font-weight: 750; letter-spacing: .04em; }
.prefixed input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; letter-spacing: .06em; }
.checkbox input { width: auto; }

/* Matriks izin role: modul (baris) × aksi (kolom) */
.perm-table { min-width: 620px; }
.perm-table th:not(:first-child), .perm-cell { text-align: center; width: 92px; }
.perm-cell { color: var(--muted); font-weight: 650; }
.perm-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--red); cursor: pointer; }
.perm-table td:first-child { font-size: 13px; }
.perm-table tr.perm-group th { text-align: left; background: var(--line-2); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); padding-top: 9px; padding-bottom: 9px; }
.perm-intro { margin: 4px 0 12px; font-size: 13px; }

/* ===== Buttons ===== */
.btn, button {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-size: 14px; font-weight: 650; cursor: pointer; font-family: inherit;
  background: linear-gradient(100deg, var(--red), var(--red-600)); color: #fff;
  box-shadow: 0 8px 18px -10px var(--red); transition: transform .15s, box-shadow .15s, filter .15s; }
.btn:hover, button:hover { transform: translateY(-1px); filter: brightness(1.05); color: #fff; box-shadow: 0 12px 24px -10px var(--red); }
.btn:active, button:active { transform: translateY(0); }
.btn-ghost { background: rgba(255,255,255,.8); color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.btn-gold { background: linear-gradient(100deg, var(--gold), var(--gold-dark)); box-shadow: 0 8px 18px -10px var(--gold); }
/* Merah tetap, bukan warna utama merek: "bahaya" harus terbaca sama di Media
   Cargo maupun MedEx (yang warna utamanya biru). */
.btn-danger { background: linear-gradient(100deg, #ec4a51, #9E1318); box-shadow: 0 8px 18px -10px #E11E26; }
.btn-danger:hover { box-shadow: 0 12px 24px -10px #E11E26; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* tombol CRUD bergambar (IconsHelper): persegi, ikon di tengah, nama di tooltip */
.btn-icon { padding: 0; width: 40px; height: 40px; justify-content: center; gap: 0; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn-icon.btn-sm svg { width: 16px; height: 16px; }
.btn-icon svg { flex: none; }
td.actions { gap: 6px; flex-wrap: nowrap; }

/* Dock aksi halaman (IconsHelper#dock). Lebar & tinggi tiap ikon diatur skrip
   di layout mengikuti jarak kursor; panelnya setinggi tetap dan ikon tumbuh ke
   atas (align-items: flex-end), jadi isi halaman di bawahnya tidak bergeser. */
.dock { display: flex; align-items: flex-end; gap: 10px; height: 58px; padding: 0 10px 8px;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: 18px; box-shadow: var(--shadow); }
.dock-item { position: relative; display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%; color: var(--ink);
  background: rgba(255,255,255,.9); border: 1px solid var(--line);
  transition: width .16s cubic-bezier(.2,.8,.3,1.2), height .16s cubic-bezier(.2,.8,.3,1.2), background .15s, color .15s; }
.dock-item:hover, .dock-item:focus-visible { color: var(--red-600); background: #fff; }
/* dock_print memakai <button>: lepaskan gaya tombol bawaan. */
button.dock-item { padding: 0; box-shadow: none; font: inherit; }
button.dock-item:hover { transform: none; filter: none; box-shadow: none; }
.dock-item.primary { color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--red), var(--red-600)); box-shadow: 0 8px 18px -10px var(--red); }
.dock-item.primary:hover { color: #fff; }
.dock-item.active { color: var(--red-600); box-shadow: inset 0 0 0 2px var(--red-soft-2); }
.dock-item.active::after { content: ""; position: absolute; bottom: -6px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--red); }
.dock-icon { display: grid; place-items: center; width: 50%; height: 50%; }
.dock-icon svg { width: 100%; height: 100%; }
/* Dock duduk di kepala halaman, jadi nama aksinya muncul di bawah ikon — di
   atasnya tidak ada ruang. */
.dock-label { position: absolute; top: calc(100% + 10px); left: 50%; transform: translate(-50%, -4px); z-index: 5;
  padding: 3px 9px; border-radius: 8px; white-space: nowrap; pointer-events: none;
  font-size: 12px; font-weight: 600; color: var(--ink); background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow); opacity: 0; transition: opacity .15s, transform .15s; }
.dock-item:hover .dock-label, .dock-item:focus-visible .dock-label { opacity: 1; transform: translate(-50%, 0); }
/* Layar sentuh tidak punya hover: nama aksi ditulis tetap di bawah ikon. */
@media (hover: none) {
  .dock { height: auto; padding: 8px 10px 6px; gap: 14px; }
  .dock-item { width: 40px; height: 40px; margin-bottom: 18px; }
  .dock-label { top: calc(100% + 3px); opacity: 1; transform: translateX(-50%);
    padding: 0; background: none; border: 0; box-shadow: none; font-size: 10.5px; color: var(--muted); }
  .dock-item.active::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dock-item { transition: none; } }
td.actions form { margin: 0; }

/* ===== Flash ===== */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; font-weight: 500; border: 1px solid transparent; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.flash-notice { background: var(--green-bg); color: var(--green-ink); border-color: #bfe6cc; }
.flash-alert { background: var(--rose-bg); color: var(--rose-ink); border-color: #f3c2c4; }

/* ===== Badges ===== */
/* kolom nomor urut di daftar */
.nowrap { white-space: nowrap; }
th.col-no, td.col-no { width: 1%; white-space: nowrap; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--slate-bg); color: var(--slate-ink); }
.badge-slate { background: var(--slate-bg); color: var(--slate-ink); }
.badge-blue  { background: var(--blue-bg);  color: var(--blue-ink); }
.badge-amber { background: var(--amber-bg); color: var(--amber-ink); }
.badge-indigo{ background: var(--indigo-bg);color: var(--indigo-ink); }
.badge-green { background: var(--green-bg); color: var(--green-ink); }
.badge-rose  { background: var(--rose-bg);  color: var(--rose-ink); }
.badge-gold  { background: var(--gold-soft);color: var(--gold-dark); }

/* ===== Toolbar / misc ===== */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; }
/* Pencarian langsung: kotak cari melebar mengisi baris, ikon kaca pembesar di
   dalamnya, tanpa tombol Cari — hasil diperbarui sambil mengetik. */
.toolbar .search-box { flex: 1 1 320px; max-width: 520px; padding-left: 38px;
  background: rgba(255,255,255,.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center; }
.toolbar .search-box:focus { background-color: #fff; }
.toolbar [hidden] { display: none; }
.toolbar .search-box ~ select { min-width: 170px; }
.toolbar .date-range { display: inline-flex; align-items: center; gap: 8px; }
.goods-cell { max-width: 220px; font-size: 13px; }
@media (max-width: 620px) { .toolbar .search-box { flex-basis: 100%; max-width: none; } .toolbar .search-box ~ select { flex: 1; } .toolbar .date-range { flex: 1 1 100%; } .toolbar .date-range input { flex: 1; min-width: 0; } }

/* ===== Pagination ===== */
.pagination { display: flex; gap: 14px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; margin-top: 14px; font-size: 13px; }
.pagination .pages { display: flex; gap: 6px; align-items: center; }
.pagination .page { display: inline-flex; align-items: center; justify-content: center; min-width: 34px;
  height: 34px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: rgba(255,255,255,.8); color: var(--ink); font-weight: 650; text-decoration: none; }
.pagination a.page:hover { background: #fff; border-color: var(--red); color: var(--red); }
.pagination .page.current { border-color: transparent; background: transparent; color: var(--muted); font-weight: 600; }
.pagination .page.disabled { color: var(--muted); opacity: .45; }
td form { display: inline; }
.row-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
small.muted { font-weight: 400; }
.empty { text-align: center; color: var(--muted); padding: 40px; }
.spread { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: space-between; }

/* ===== Barcode ===== */
.barcode-box { display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.barcode-box svg { display: block; }
.barcode-box .code { font-size: 12px; letter-spacing: .14em; color: var(--ink); font-weight: 600; }
.barcode-mini svg { height: 34px; }

/* ===== Nested item rows (addable) ===== */
.items-table td { padding: 8px; vertical-align: middle; }
.items-table input { padding: 8px 10px; }
.item-remove { background: var(--rose-bg); color: var(--rose-ink); border: none; padding: 7px 10px; border-radius: 9px; box-shadow: none; font-size: 13px; }
.item-remove:hover { background: #f7d2d4; color: var(--rose-ink); box-shadow: none; transform: none; }

/* ===== Sectioned form (TTB & friends) ===== */
.ttb-card { padding: 4px 22px 22px; }
.form-section { padding: 22px 2px; border-top: 1px solid var(--line-2); }
.form-section:first-of-type { border-top: 0; }
.form-section__head { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 18px; }
.form-section__no {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--red), var(--gold));
  box-shadow: 0 6px 14px -8px var(--red);
}
.form-section__head h3 { margin: 3px 0 0; font-size: 15.5px; font-weight: 750; letter-spacing: -.01em; }
.form-section__head p { margin: 3px 0 0; font-size: 12.5px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 16px; }
.form-grid .field { margin-bottom: 0; }
.field--wide { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

/* segmented control (radio pills) */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px;
  background: rgba(20,28,40,.05); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segmented label { margin: 0; padding: 8px 15px; border-radius: 9px; font-size: 13px; font-weight: 640;
  color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.segmented label:hover { color: var(--ink); }
.segmented input:checked + label { background: #fff; color: var(--red-600);
  box-shadow: 0 4px 10px -6px rgba(20,28,40,.4); }
.segmented input:focus-visible + label { box-shadow: 0 0 0 3px var(--red-soft); }

/* combobox: kotak isian yang mencari sambil diketik */
.combo { position: relative; }
.combo input[type=text] { padding-right: 36px; }
.combo__icon { position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  font-size: 13px; opacity: .4; pointer-events: none; }
.combo__menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 272px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.combo__item { display: flex; flex-direction: column; gap: 2px; padding: 8px 11px;
  border-radius: 9px; cursor: pointer; transition: background .12s; }
.combo__item:hover, .combo__item.is-active { background: var(--red-soft); }
.combo__label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 640; color: var(--ink); }
.combo__meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo__tag { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 750;
  text-transform: uppercase; letter-spacing: .04em; background: var(--gold-soft); color: var(--gold-dark); }
.combo__empty { padding: 9px 11px; font-size: 13px; color: var(--muted); }
/* di baris aksi, kotak cari mengambil sisa ruang seperti dropdown yang digantikannya */
.row-add .combo { flex: 1 1 260px; max-width: 380px; }

/* ===== Scan TTB ke manifest ===== */
.scan-card { margin-bottom: 14px; }
.scan-card__label { margin: 0 0 10px; font-weight: 650; }
.scan-card #scan-code { flex: 1 1 260px; max-width: 380px; font-variant-numeric: tabular-nums; }
.scan-card__reader { max-width: 420px; margin-top: 14px; border-radius: 12px; overflow: hidden; }
.scan-card__status { margin: 10px 0 0; font-size: 13px; }
.scan-card__label .badge { margin-left: 6px; vertical-align: middle; }
/* Daftar centang TTB siap muat di manifest */
.pick-toolbar { margin-bottom: 12px; }
.pick-toolbar #pick-q { flex: 1 1 240px; max-width: 380px; }
.pick-table th button { all: unset; cursor: pointer; }
.pick-table th button:hover { color: var(--red); }
.pick-table th button[data-dir="asc"]::after  { content: " ↑"; }
.pick-table th button[data-dir="desc"]::after { content: " ↓"; }
.pick-table tbody tr.is-picked td { background: var(--gold-soft); }
.pick-table td label { cursor: pointer; }
.pick-table .nowrap { white-space: nowrap; }
.pick-scroll { max-height: min(60vh, 560px); overflow: auto; border: 1px solid var(--glass-border); }
.pick-scroll .pick-table { border: 0; overflow: visible; box-shadow: none; }
.pick-table thead th { position: sticky; top: 0; z-index: 2; background: #fff; box-shadow: inset 0 -1px 0 var(--line); }
.pick-foot { margin-top: 12px; }
.pick-foot #pick-summary { color: var(--ink); font-weight: 600; }
/* ===== Tes Scanner ===== */
.scanner-test { display: grid; gap: 16px; }
.scanner-test__hero { display: flex; gap: 16px; align-items: center; border-left: 6px solid var(--line); }
.scanner-test__hero[data-state="ok"]   { border-left-color: var(--green-ink); background: var(--green-bg); }
.scanner-test__hero[data-state="warn"] { border-left-color: var(--amber-ink); background: var(--amber-bg); }
.scanner-test__icon { font-size: 38px; line-height: 1; }
.scanner-test__title { margin: 0; font-size: 18px; font-weight: 750; }
.scanner-test__hero .muted { margin: 4px 0 0; }
.scanner-test__focus { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.scanner-test__focus input { max-width: 380px; }
.scanner-test__help h3 { margin: 0 0 8px; font-size: 15px; }
.scanner-test__help ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; }
td.st-ok   { color: var(--green-ink); font-weight: 600; }
td.st-warn { color: var(--amber-ink); font-weight: 600; }
td.st-bad  { color: var(--rose-ink); font-weight: 600; }
.st-meaning { display: block; margin-top: 3px; font-weight: 500; }
.st-meaning.st-ok { color: var(--green-ink); }

.scan-log { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.scan-log:empty { display: none; }
.scan-log li { padding: 8px 11px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.scan-log li.is-ok { background: var(--green-bg); color: var(--green-ink); }
.scan-log li.is-error { background: var(--rose-bg); color: var(--rose-ink); }
.scan-log li:not(:first-child) { opacity: .6; font-weight: 500; }

/* items panel + live summary */
.items-panel { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: rgba(255,255,255,.5); }
.items-panel .table-wrap { border-radius: 0; }
.items-panel .items-table { min-width: 620px; box-shadow: none; border: 0; border-radius: 0; }
.items-panel .items-table thead th { background: rgba(255,255,255,.66); }
.items-table th.num-col, .items-table td.num-col { text-align: right; }
.items-table td.num-col input { text-align: right; }
.items-summary { display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  padding: 13px 16px; border-top: 1px solid var(--line-2); background: rgba(255,255,255,.42); }
.items-summary .metric { display: flex; flex-direction: column; line-height: 1.15; }
.items-summary .metric b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.items-summary .metric span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* sticky action bar inside the card */
.form-footer { position: sticky; bottom: 0; z-index: 5;
  margin: 22px -22px -22px; padding: 14px 22px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-top: 1px solid var(--glass-border); border-radius: 0 0 var(--radius) var(--radius); }
.form-footer .spacer { margin-right: auto; font-size: 12.5px; }
@media (max-width: 620px) {
  .form-footer .spacer { display: none; }
  .form-footer { justify-content: flex-end; }
}

/* ===== Modal (scanner) ===== */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  background: rgba(15,18,24,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); padding: 18px; }
.modal.open { display: flex; }
.modal-card { width: 100%; max-width: 460px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-lg); }
.modal-card h3 { margin: 0 0 4px; }
#scanner-view { width: 100%; border-radius: 12px; overflow: hidden; background: #000; margin: 14px 0; }
#scanner-view video { width: 100% !important; display: block; }

/* ===== Login ===== */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-shell { width: 100%; max-width: 980px; min-height: 620px; display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg);
  animation: auth-in .5s ease-out both; }
.auth-brand { position: relative; overflow: hidden; color: #fff; padding: 48px 44px;
  background: linear-gradient(150deg, var(--red-700), var(--red) 60%, #e1591f); }
.auth-map { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.auth-brand__body { position: relative; z-index: 1; }
.auth-brand__body > * { animation: auth-rise .5s ease-out both; }
.auth-brand__body > :nth-child(2) { animation-delay: .1s; }
.auth-brand__body > :nth-child(3) { animation-delay: .2s; }
.auth-brand__body > :nth-child(4) { animation-delay: .3s; }
.auth-brand .logo-chip { background: #fff; border-radius: 16px; padding: 14px 16px; max-width: 230px; box-shadow: var(--shadow-lg); }
.auth-brand .logo-chip img { width: 100%; display: block; }
.auth-brand h2 { font-size: 24px; margin: 24px 0 8px; color: #fff; }
.auth-brand p { color: rgba(255,255,255,.85); max-width: 360px; }
.auth-brand .gold-line { width: 56px; height: 4px; background: var(--gold); border-radius: 4px; margin-top: 18px; }
.auth-form { display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 340px; animation: auth-rise .5s ease-out .15s both; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card > .muted { margin-bottom: 26px; }
.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.password-toggle { position: absolute; top: 0; right: 0; height: 100%; width: 42px; padding: 0; justify-content: center;
  background: none; border: 0; box-shadow: none; color: var(--faint); }
.password-toggle:hover { background: none; color: var(--ink); transform: none; box-shadow: none; filter: none; }
.password-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: -4px; border-radius: var(--radius-sm); }
.password-toggle .eye-closed, .password-toggle[aria-pressed=true] .eye-open { display: none; }
.password-toggle[aria-pressed=true] .eye-closed { display: block; }
.auth-submit { position: relative; overflow: hidden; width: 100%; justify-content: center; margin-top: 8px; padding: 12px 16px; }
.auth-submit svg { transition: transform .2s; }
.auth-submit:hover svg { transform: translateX(3px); }
.auth-submit::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); filter: blur(6px); transform: skewX(-20deg); }
.auth-submit:hover::after { animation: auth-shine .9s ease-in-out; }
@keyframes auth-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes auth-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes auth-shine { from { left: -40%; } to { left: 120%; } }
@media (prefers-reduced-motion: reduce) {
  .auth-shell, .auth-card, .auth-brand__body > * { animation: none; }
  .auth-submit:hover::after { animation: none; }
}
.errors { background: var(--rose-bg); color: var(--rose-ink); padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .mobile-bar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 45;
    padding: 10px 14px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--glass-border); }
  .mobile-bar img { height: 30px; }

  .app { flex-direction: column; }
  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: 270px;
    transform: translateX(-100%); transition: transform .25s ease; }
  .app.nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15,18,24,.4); }
  .container { padding: 18px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .auth-wrap { padding: 16px; place-items: start center; }
  .auth-shell { grid-template-columns: 1fr; min-height: 0; }
  .auth-brand { padding: 24px 24px 120px; }
  .auth-brand .logo-chip { max-width: 190px; padding: 12px 14px; }
  .auth-brand h2 { font-size: 21px; margin-top: 20px; }
  .auth-brand p { display: none; }
  .auth-form { padding: 28px 24px 32px; }
}
@media (min-width: 861px) { .mobile-bar { display: none; } }

/* ===== Bilah navigasi bawah (HP) =====
   Pil mengambang di bawah layar. Tab aktif melebar dan menampilkan namanya;
   tab lain hanya ikon. Di bawah laci menu (z-index 35/40), jadi laci menutupinya. */
.bottom-nav { display: none; }
@media (max-width: 860px) {
  .bottom-nav { display: flex; align-items: center; gap: 4px; position: fixed; z-index: 30;
    left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box; height: 52px; padding: 6px; max-width: calc(100vw - 20px);
    background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border); border-radius: 999px; box-shadow: var(--shadow-lg); }
  .bottom-nav__item { display: flex; align-items: center; flex: none; box-sizing: border-box;
    height: 40px; min-width: 44px; padding: 0 11px; border: 0; border-radius: 999px;
    background: transparent; color: var(--muted); box-shadow: none; font: inherit;
    -webkit-tap-highlight-color: transparent; transition: background .2s, color .2s, transform .1s; }
  .bottom-nav__item:hover, button.bottom-nav__item:hover { background: rgba(20,28,40,.05); color: var(--ink);
    transform: none; filter: none; box-shadow: none; }
  .bottom-nav__item:active, button.bottom-nav__item:active { transform: scale(.97); }
  .bottom-nav__item:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
  .bottom-nav__item svg { flex: none; }
  .bottom-nav__label { max-width: 0; margin-left: 0; opacity: 0; overflow: hidden; white-space: nowrap;
    text-overflow: ellipsis; font-size: 13px; font-weight: 650; line-height: 1.9; }
  .bottom-nav__item.is-active, .bottom-nav__item.is-active:hover { background: var(--red-soft); color: var(--red-600); }
  .bottom-nav__item.is-active .bottom-nav__label { max-width: 72px; margin-left: 8px; opacity: 1;
    animation: bottom-nav-open .38s cubic-bezier(.34,1.4,.64,1); }
}
@keyframes bottom-nav-open { from { max-width: 0; margin-left: 0; opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bottom-nav__item { transition: none; }
  .bottom-nav__item.is-active .bottom-nav__label { animation: none; }
}

/* ===== Print (labels & manifest report) ===== */
@media print {
  body::before, .sidebar, .mobile-bar, .bottom-nav, .scrim, .nav, .userbox, .toolbar, .actions, .dock, .btn, button, .no-print { display: none !important; }
  body { background: #fff; }
  a { color: inherit; }
  .content, .container { margin: 0; padding: 0; max-width: none; }
  .card, table, .stat { box-shadow: none; border-color: #ccc; background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ===== Loading manifest ===== */
/* Nomor TTB dan hitungan koli tidak dilipat di tengah. */
.manifest-items td:first-child, .manifest-items td:nth-child(2) { white-space: nowrap; }
.koli-shortfall { margin-top: 8px; font-weight: 400; }
.koli-shortfall summary { cursor: pointer; font-weight: 600; }
.koli-shortfall ul { list-style: none; padding: 0; margin: 8px 0 0; max-height: 280px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 16px; font-size: 13px; }
.koli-shortfall a { color: inherit; }
.unload-confirm { margin: 8px 0 0; }
.delivery-progress { margin: -4px 0 14px; font-size: 14px; }
.deliver-form input[name=code] { flex: 2 1 220px; }
.deliver-form input[name=received_by_name] { flex: 1 1 180px; }

/* Cetak: manifest bisa ratusan TTB, jadi barisnya dirapatkan supaya muat
   ±25 baris per halaman, bukan 7. */
@media print {
  .manifest-items { min-width: 0; }
  .manifest-items th, .manifest-items td { padding: 3px 6px; font-size: 10px; }
  .manifest-items tr { break-inside: avoid; }
  .manifest-items .barcode-mini svg { height: 20px; }
  .manifest-items .badge { padding: 0 4px; font-size: 10px; background: none; }
}

/* ===== Problem & Request ===== */
.is-overdue { color: var(--rose-ink); font-weight: 650; }

/* Notulensi tiket: satu kolom catatan bertanggal, garis tipis menyambungkannya
   supaya terbaca sebagai urutan waktu dan bukan sekadar tumpukan kartu. */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px #fff; }
.timeline .note-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.timeline .note-head b { font-weight: 650; }
.timeline .note-time { color: var(--muted); }
.timeline .note-body { margin: 4px 0 0; white-space: pre-wrap; }

/* Lampiran tiket: gambar sebagai kotak kecil yang dibuka penuh di tab baru,
   berkas lain sebagai tautan unduh. */
.files { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.files--edit { flex-direction: column; gap: 4px; margin: 0 0 6px; }
.file-thumb { display: block; width: 112px; height: 112px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-link { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; max-width: 100%; overflow-wrap: anywhere; }

/* ===== Surat Pengapalan ===== */
.letter-show { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; margin-bottom: 22px; align-items: start; }
.letter-show .card { margin: 0; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.letter-qr { text-align: center; }
.letter-qr .qr { width: 160px; margin: 0 auto 8px; }
.letter-qr .qr svg { width: 100%; height: auto; display: block; }
@media (max-width: 760px) { .letter-show { grid-template-columns: 1fr; } }

/* ===== Grafik (shared/_column_chart, shared/_bar_chart) ===== */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-bottom: 18px; }
.chart-grid .card, .chart-card { padding: 16px 18px 12px; }
.chart-note { font-size: 12.5px; margin: -6px 0 0; }
.chart { margin: 0; min-width: 0; }
.chart__title { font-size: 13px; font-weight: 650; color: var(--ink); margin-bottom: 12px; }

/* Kolom: garis bantu menempel di kiri (label sumbu), kolom mengisi sisanya. */
/* Sisa ruang kanan menampung separuh label kolom terakhir yang ditaruh di tengah. */
.chart__plot { position: relative; height: 150px; margin: 0 14px 0 44px; }
.chart__gridline { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--chart-grid); }
.chart__gridline:first-child { border-top-color: var(--chart-axis); }
.chart__gridline span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11px; line-height: 16px;
  color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart__cols { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.chart__col { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center;
  border-radius: 4px; outline: none; cursor: default; }
a.chart__col { cursor: pointer; }
.chart__bar { display: block; width: 100%; max-width: 24px; background: var(--chart-series);
  border-radius: 4px 4px 0 0; transition: filter .12s; }
.chart__col:hover, .chart__col:focus-visible { background: rgba(42,120,214,.07); }
.chart__col:hover .chart__bar, .chart__col:focus-visible .chart__bar { filter: brightness(1.15); }
.chart__col:focus-visible { box-shadow: 0 0 0 2px var(--chart-series); }
.chart__axis { display: flex; gap: 2px; margin: 6px 14px 0 44px; height: 16px; }
.chart__axis span { flex: 1 1 0; min-width: 0; position: relative; }
.chart__axis em { position: absolute; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px;
  line-height: 16px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart__axis .is-current em { color: var(--ink); font-weight: 700; }
/* Dua belas nama bulan tidak muat berdampingan di HP: tampilkan selang-seling,
   dihitung dari bulan berjalan supaya bulan terakhir tetap berlabel. */
@media (max-width: 520px) { .chart__axis--dense span:nth-last-child(even) em { display: none; } }

/* Batang mendatar: nilai di ujung batang, tempatnya disisihkan supaya muat. */
.hbar { display: grid; gap: 4px; }
.hbar__row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); align-items: center; gap: 10px;
  padding: 3px 4px; border-radius: 6px; outline: none; }
.hbar__row:hover, .hbar__row:focus-visible { background: rgba(42,120,214,.07); }
.hbar__row:focus-visible { box-shadow: 0 0 0 2px var(--chart-series); }
.hbar__label { font-size: 13px; color: var(--muted); }
.hbar__track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbar__bar { flex: none; height: 18px; width: calc((100% - 8.5rem) * var(--p)); border-radius: 0 4px 4px 0; }
.hbar__value { font-size: 13px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbar__bar--1 { background: var(--chart-ramp-1); }
.hbar__bar--2 { background: var(--chart-ramp-2); }
.hbar__bar--3 { background: var(--chart-ramp-3); }
.hbar__bar--4 { background: var(--chart-ramp-4); }
.hbar__bar--5 { background: var(--chart-ramp-5); }
@media (max-width: 520px) { .hbar__row { grid-template-columns: 6.5rem minmax(0, 1fr); } }

/* Tabel pengganti grafik: semua nilai bisa dibaca tanpa hover. */
.chart__table { margin-top: 10px; font-size: 13px; }
.chart__table summary { cursor: pointer; color: var(--muted); font-size: 12.5px; width: max-content; }
.chart__table table { min-width: 0; margin-top: 8px; box-shadow: none; }
.chart__table th, .chart__table td { padding: 6px 10px; font-size: 12.5px; }

/* Tooltip grafik (dipasang di layout, satu untuk semua grafik). */
.chart-tip { position: fixed; z-index: 60; pointer-events: none; padding: 7px 10px; border-radius: 9px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 12.5px;
  transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; }
.chart-tip strong { display: block; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-tip span { color: var(--muted); }

/* ===== Finance (Accounting & Tax) ===== */
.text-center { text-align: center; }
tr.group-row th { background: var(--slate-bg); color: var(--slate-ink); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
table.report td.indent { padding-left: 28px; }
table.report tr.subtotal th { border-top: 1px solid var(--line); }
table.report tr.grand th { font-size: 15px; }
.report-narrow { max-width: 720px; }
.balance-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .balance-sheet { grid-template-columns: 1fr; } }
.finance-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 22px; }
.finance-link { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; margin: 0; }
.finance-link:hover b { color: var(--red); }
.finance-link span { font-size: 13px; line-height: 1.45; }
.finance-steps { margin: 0; padding-left: 20px; display: grid; gap: 16px; line-height: 1.5; }
.finance-steps li.done::marker { color: var(--green-ink); }
.finance-start { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.finance-start .field { margin-bottom: 0; }
.finance-start-change { margin-top: 22px; }
.tax-profile { margin-bottom: 18px; }
a.stat-link { color: inherit; text-decoration: none; }
a.stat-link:hover .label { color: var(--red); }
tr.is-void td { color: var(--muted); text-decoration: line-through; }
tr.is-void td:last-child { text-decoration: none; }
.tax-profile form { margin-top: 12px; }
.tax-periods td .badge { margin-top: 4px; }
.tax-filings { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tax-filings .card { margin: 0; }
.tax-filing-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tax-filing-head h3 { margin: 0; }
.tax-skipped { margin: 0 0 10px; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.finance-start-change summary, details.card summary { cursor: pointer; font-weight: 650; }
.journal-lines select { min-width: 220px; }
.journal-lines input.money { min-width: 120px; }
@media print { .balance-sheet { grid-template-columns: 1fr 1fr; } }
.bill-totals { display: grid; gap: 6px; max-width: 420px; margin-left: auto; }
.bill-totals div { display: flex; justify-content: space-between; gap: 16px; }
.bill-totals .grand { border-top: 1px solid var(--line); padding-top: 8px; font-size: 16px; }

/* Rekonsiliasi bank */
.recon-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 8px; }
@media (max-width: 900px) { .recon-grid { grid-template-columns: 1fr; } }
form.inline { display: inline-block; margin: 2px 4px 2px 0; }
table.recon-lines td.recon-action { min-width: 260px; }
table.recon-lines tr.recon-unmatched td { background: var(--amber-bg); }
.recon-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0; }
.recon-form select, .recon-form input[type="text"] { max-width: 260px; font-size: 13px; padding: 6px 8px; }
.recon-record summary { cursor: pointer; font-size: 13px; color: var(--muted); margin: 4px 0; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
