/* ==========================================================================
   BLACK BIRD · Sistem Pembukuan & Penagihan (v18 Hitam-Putih + Hijau & Merah Uang)
   Gaya: Swiss Editorial Ledger — Hitam (#0a0a0a), Putih (#ffffff),
   Hijau Uang (#15803d / #4ade80) & Merah Rupiah (#b91c1c / #f87171).
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f0f2f5;
  --surface-hover: #f4f4f5;

  --ink: #0a0a0a;
  --ink-2: #141417;
  --ink-line: #27272a;
  --ink-text: #ffffff;
  --ink-muted: #a1a1aa;

  --line: #e4e4e7;
  --line-strong: #18181b;
  --line-mid: #d4d4d8;

  --text: #0a0a0a;
  --muted: #52525b;
  --faint: #71717a;

  --primary: #0a0a0a;
  --primary-hover: #27272a;

  /* Hijau khusus nominal masuk / bersih Owner 1 / lunas */
  --money-green: #15803d;
  --money-green-dark: #166534;
  --money-green-bright: #4ade80;
  --money-green-soft: #f0fdf4;
  --money-green-border: #bbf7d0;

  /* Merah Rupiah khusus tagihan belum bayar / potongan Owner 2 / tunggakan */
  --money-red: #b91c1c;
  --money-red-dark: #991b1b;
  --money-red-bright: #f87171;
  --money-red-soft: #fef2f2;
  --money-red-border: #fecaca;

  --emerald: #15803d;
  --emerald-bg: #f0fdf4;
  --emerald-line: #86efac;

  --indigo: #15803d;
  --indigo-bg: #f0fdf4;
  --indigo-line: #bbf7d0;

  --amber: #b91c1c;
  --amber-bg: #fef2f2;
  --amber-line: #fecaca;

  --rose: #b91c1c;
  --rose-bg: #fef2f2;
  --rose-line: #fecaca;

  --radius-lg: 6px;
  --radius-md: 4px;
  --radius-sm: 3px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 18px -4px rgba(0, 0, 0, 0.12);
  --ring: 0 0 0 2px rgba(10, 10, 10, 0.25);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(#d4d4d8 0.75px, transparent 0.75px);
  background-size: 18px 18px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, dt, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:where(a) { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-radius: 3px;
}

[hidden] { display: none !important; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}
.skip:focus-visible { top: 12px; }

.shell {
  width: min(1320px, 100% - 32px);
  margin-inline: auto;
}

/* ---------------------------------------------------------------- top bar */

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid #000000;
  background: var(--ink);
  color: #ffffff;
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 54px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
}
.brand img {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  filter: grayscale(100%) contrast(120%);
}
.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand-text strong {
  font-size: 13.5px;
  letter-spacing: .08em;
  font-weight: 800;
  color: #ffffff;
}
.brand-text small {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
}
.brand-text small::before {
  content: "/";
  margin-right: 8px;
  color: #52525b;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.manage-link svg { width: 14px; height: 14px; flex: none; }

.top .btn.ghost {
  background: transparent;
  border-color: #3f3f46;
  color: #ffffff;
}
.top .btn.ghost:hover {
  background: #27272a;
  border-color: #71717a;
}
.top .btn.quiet {
  background: #27272a;
  border-color: #3f3f46;
  color: #ffffff;
}
.top .btn.quiet:hover {
  background: #3f3f46;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid #3f3f46;
  border-radius: var(--radius-md);
  background: #18181b;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}
.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--money-green-bright);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
  flex: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
}
.top .icon-btn {
  background: #18181b;
  border-color: #3f3f46;
  color: #ffffff;
}
.top .icon-btn:hover {
  background: #27272a;
  border-color: #71717a;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn[disabled] { opacity: .45; cursor: progress; }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.is-spinning svg { animation: spin .9s linear infinite; }

/* ------------------------------------------------------------- login gate */

.gate-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 120px);
  padding: 24px 0;
}

.gate-card {
  width: min(390px, 100%);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 28px 26px;
  box-shadow: 6px 6px 0 0 var(--ink);
}

.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--ink);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.gate-badge svg { width: 12px; height: 12px; color: #ffffff; }

.gate-card h1 {
  margin-top: 12px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
}
.gate-lede {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.gate-form {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}
.gate-field {
  display: grid;
  gap: 5px;
}
.gate-field > span {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink);
}
.gate-field input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
}
.gate-field input::placeholder { color: #a1a1aa; }
.gate-field input:focus {
  outline: none;
  box-shadow: var(--ring);
}
.gate-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--ink);
  background: var(--surface-3);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.gate-error:empty { display: none; }

.gate-actions { margin-top: 4px; }
.gate-actions .btn { width: 100%; height: 38px; font-size: 13px; }

.gate-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--faint);
}

/* ------------------------------------------------------------------- hero */

.hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 14px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-bar h1 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
}
.hero-bar .lede {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 12px;
}
.stat-pill small {
  color: var(--muted);
  font-size: 11.5px;
}
.stat-pill strong {
  font-weight: 700;
  color: var(--ink);
}

/* --------------------------------------------------------------- overview */

.overview {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #ffffff;
  overflow: hidden;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.metrics.metrics-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric {
  padding: 14px 16px;
}
.metric + .metric { border-left: 1px solid var(--ink-line); }

.metric .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-muted);
}

.metric .value {
  margin-top: 5px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--money-green-bright);
}
.metric:nth-child(3) .value,
.metric.owner2 .value,
#remainingValue,
#owner2Value,
#statRemaining,
#statOwner2 {
  color: var(--money-red-bright);
}

.metric .hint {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.35;
}

.realized-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink-line);
  background: #141417;
}
.realized-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
}
.realized-item + .realized-item {
  border-left: 1px solid var(--ink-line);
}
.realized-left {
  min-width: 0;
}
.realized-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.realized-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #e4e4e7;
}
.realized-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.realized-item.o1 .realized-badge {
  background: rgba(74, 222, 128, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: var(--money-green-bright);
}
.realized-item.o2 .realized-badge {
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: var(--money-red-bright);
}
.realized-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.realized-val {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.realized-item.o1 .realized-val { color: var(--money-green-bright); }
.realized-item.o2 .realized-val { color: var(--money-red-bright); }

.data-table tfoot tr.foot-realized td {
  background: #18181b;
  border-top: 1px solid #3f3f46;
  font-size: 12px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.progress-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--ink-line);
  background: var(--ink-2);
}
.progress-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-head .label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-muted);
}
.progress-head strong {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.bar {
  flex: 1 1 200px;
  max-width: 340px;
  height: 6px;
  border-radius: 999px;
  background: #27272a;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--money-green-bright);
  transition: width .3s ease;
}
.progress-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #d4d4d8;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------- Panel Tagihan Hari Ini (Kotak Merah) */

.today-focus {
  margin-top: 14px;
  border: 2px solid var(--money-red);
  border-radius: var(--radius-lg);
  background: #fff5f5;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(185, 28, 28, 0.08);
}
.today-focus.is-clear {
  border: 1px solid var(--money-green-border);
  background: var(--money-green-soft);
  box-shadow: none;
}
.today-focus-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--money-red);
  color: #ffffff;
}
.today-focus.is-clear .today-focus-head {
  background: transparent;
  color: var(--money-green-dark);
  padding: 9px 14px;
}
.today-focus-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.today-focus-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  flex: none;
}
.today-focus.is-clear .today-focus-dot {
  background: var(--money-green);
}
.today-focus-meta {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fee2e2;
}
.today-focus.is-clear .today-focus-meta {
  color: var(--money-green-dark);
  font-weight: 600;
}
.today-focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 10px;
  padding: 12px 14px;
}
.due-red-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  border: 2px solid var(--money-red);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: 3px 3px 0 0 rgba(185, 28, 28, 0.2);
}
.due-red-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.due-red-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
}
.due-red-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.due-red-badge {
  flex: none;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--money-red);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}
.due-red-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--money-red-border);
}
.due-red-money strong {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--money-red);
  font-variant-numeric: tabular-nums;
}
.due-red-money small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.due-red-card .btn.btn-red {
  background: var(--money-red);
  border-color: var(--money-red);
  color: #ffffff;
}
.due-red-card .btn.btn-red:hover {
  background: var(--money-red-dark);
}

/* ----------------------------------------------------- workspace & tabs */

.workspace-wrap {
  padding-top: 16px;
}

.workspace-card {
  margin-top: 14px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.workspace-nav {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-mid);
}

.view-tabs {
  display: flex;
  gap: 2px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow-x: auto;
  max-width: 100%;
}
.view-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.view-tabs button:hover { color: var(--ink); }
.view-tabs button[aria-selected="true"],
.view-tabs button.is-active {
  border-bottom-color: var(--ink);
  color: var(--ink);
  font-weight: 800;
}
.view-tabs .badge {
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--line-mid);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.view-tabs button.is-active .badge {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface-2);
}

.workspace-bar .search {
  flex: 1 1 260px;
  max-width: 380px;
}

.workspace-bar .filters {
  padding: 0;
  border: 0;
  background: transparent;
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.count-info {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* -------------------------------------------------------- section panels */

.section-card {
  margin-top: 14px;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-mid);
  background: var(--surface-2);
}
.section-head h2 {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.section-head .sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.section-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ------------------------------------------------ H-1 Billing Schedule */

.schedule-summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border-bottom: 1px solid var(--line-mid);
  background: var(--surface);
}
.sched-kpi {
  padding: 12px 16px;
}
.sched-kpi + .sched-kpi {
  border-left: 1px solid var(--line);
}
.sched-kpi.is-highlight {
  background: var(--ink);
  color: #ffffff;
}
.sched-kpi.is-danger {
  background: var(--money-red-soft);
}
.sched-kpi.is-danger small { color: var(--money-red-dark); }
.sched-kpi.is-danger strong { color: var(--money-red); }
.sched-kpi.is-danger span { color: var(--money-red-dark); }
.sched-kpi small {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.sched-kpi.is-highlight small { color: var(--ink-muted); }
.sched-kpi strong {
  display: block;
  margin-top: 3px;
  font-size: 15.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--money-green);
}
.sched-kpi.is-highlight strong { color: var(--money-green-bright); }
.sched-kpi span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--faint);
}
.sched-kpi.is-highlight span { color: #d4d4d8; }

.schedule-grid {
  display: grid;
}

.sched-card {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.sched-card:last-child { border-bottom: 0; }
.sched-card.is-today {
  background: var(--surface-2);
  border-left: 3px solid var(--ink);
}
.sched-card.is-prev-month {
  border-left: 3px solid var(--ink);
}
.sched-card.is-due-red {
  margin: 8px 12px;
  border: 2px solid var(--money-red);
  border-left-width: 5px;
  border-radius: var(--radius-md);
  background: #fff5f5;
}
.sched-card.is-due-red .sched-day-badge {
  background: var(--money-red);
}
.sched-card.is-due-red .sched-day-badge small {
  color: #fee2e2;
}

.sched-card-head {
  display: grid;
  grid-template-columns: minmax(210px, 1.15fr) minmax(160px, .9fr) minmax(260px, 1.4fr) auto;
  align-items: center;
  gap: 10px 16px;
  padding: 11px 16px;
}

.sched-date-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sched-day-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 40px;
  padding: 0 6px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.sched-day-badge small {
  font-size: 8.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.sched-date-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.sched-date-copy span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.sched-target {
  font-size: 12px;
  color: var(--muted);
}
.sched-target b {
  color: var(--ink);
  font-weight: 700;
}

.sched-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.sched-numbers .sn-item small {
  display: block;
  font-size: 10.5px;
  color: var(--faint);
}
.sched-numbers .sn-item strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--money-green);
}
.sched-numbers .sn-item.o1 strong { color: var(--money-green); }
.sched-numbers .sn-item.o2 strong { color: var(--money-red); }

.sched-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 11px 68px;
}
.sched-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: left;
  cursor: pointer;
  transition: transform .1s ease, border-color .12s ease, background .12s ease;
}
.sched-group-chip:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 2px 2px 0 0 var(--ink);
}
.sched-group-chip.is-paid {
  border-color: var(--money-green-border);
  background: var(--money-green-soft);
}
.sched-group-chip.is-unpaid {
  border-style: dashed;
  border-color: var(--money-red-border);
  background: var(--money-red-soft);
}
.sched-group-chip .sg-name { font-weight: 700; color: var(--ink); }
.sched-group-chip .sg-amt { color: var(--money-green); font-weight: 750; }
.sched-group-chip.is-unpaid .sg-amt { color: var(--money-red); font-weight: 750; }
.sched-group-chip .sg-owner {
  font-size: 10.5px;
  color: var(--faint);
}
.sched-group-chip .sg-owner::before { content: "· "; }

/* -------------------------------------- PJ / Owner Recap Cards */

.pj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  padding: 14px 16px;
}
.pj-card {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: grid;
  gap: 8px;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, transform .1s ease;
}
.pj-card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 0 var(--ink);
}
.pj-card.is-selected {
  border: 1.5px solid var(--ink);
  background: var(--surface-2);
  box-shadow: 4px 4px 0 0 var(--ink);
}
.pj-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.pj-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}
.pj-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #ffffff;
}
.pj-stats {
  display: grid;
  gap: 3px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.pj-stats div {
  display: flex;
  justify-content: space-between;
}
.pj-stats strong { color: var(--money-green); font-weight: 800; }
.pj-stats strong.o1 { color: var(--money-green); }
.pj-stats strong.o2 { color: var(--money-red); }

/* ---------------------------------------- Owner 1 & Owner 2 Split Table */

.compact-search {
  flex: 0 1 210px;
  max-width: 220px;
}
.compact-search input {
  height: 28px;
  font-size: 12px;
}

.inline-select {
  height: 28px;
  padding: 0 24px 0 9px;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-md);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%230a0a0a' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 7px center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.inline-select:hover { border-color: var(--ink); }

.table-scroll {
  width: 100%;
  overflow-x: auto;
}
.table-sticky-wrap {
  max-height: 620px;
  overflow-y: auto;
}
.table-sticky-wrap .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}
.table-sticky-wrap .data-table tfoot {
  position: sticky;
  bottom: 0;
  z-index: 4;
}

.special-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--ink);
  background: var(--surface-3);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.data-table th,
.data-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table th {
  background: var(--surface-3);
  border-bottom: 1.5px solid var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink);
  white-space: nowrap;
}
.data-table tbody tr:hover {
  background: var(--surface-2);
}
.data-table tbody tr.is-due-red {
  background: #fff5f5;
}
.data-table tbody tr.is-due-red:hover {
  background: #fee2e2;
}
.data-table tbody tr.is-due-red td {
  border-top: 2px solid var(--money-red);
  border-bottom: 2px solid var(--money-red);
}
.data-table tbody tr.is-due-red td:first-child {
  border-left: 4px solid var(--money-red);
}
.data-table tbody tr.is-due-red td:last-child {
  border-right: 2px solid var(--money-red);
}
.data-table tbody tr.is-paid-row {
  opacity: 0.72;
  background: var(--surface-2);
}
.data-table tbody tr.is-due-red .btn.primary {
  background: var(--money-red);
  border-color: var(--money-red);
}
.data-table tbody tr.is-due-red .btn.primary:hover {
  background: var(--money-red-dark);
}
.data-table tfoot th,
.data-table tfoot td {
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
  font-size: 12.5px;
  border-top: 2px solid var(--ink);
  border-bottom: none;
}
.data-table .num-col { text-align: right; white-space: nowrap; color: var(--money-green); font-weight: 750; }
.data-table .num-col strong { color: var(--money-green); font-weight: 800; }
.data-table .center-col { text-align: center; white-space: nowrap; }
.data-table .o1-col { color: var(--money-green); font-weight: 800; }
.data-table .o2-col { color: var(--money-red); font-weight: 750; }
.data-table tfoot .num-col,
.data-table tfoot .o1-col { color: var(--money-green-bright); }
.data-table tfoot .o2-col { color: var(--money-red-bright); }

.tag-h1 {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--line-mid);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.tag-h1.is-prev {
  background: var(--money-red);
  border-color: var(--money-red);
  color: #ffffff;
}

.bill-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.day-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 750;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.day-tag.is-overdue {
  background: var(--money-red);
  color: #ffffff;
}
.day-tag.is-today {
  background: var(--money-red);
  color: #ffffff;
  border: 1px solid var(--money-red);
}
.day-tag.is-tomorrow {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--ink);
}
.day-tag.is-upcoming {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
}

.chip-live {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line-mid);
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------- finder */

.finder {
  margin-top: 14px;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.finder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-mid);
  background: var(--surface-2);
}
.finder-head h2 {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.finder-head .count {
  font-size: 12px;
  color: var(--muted);
}

.search {
  position: relative;
  flex: 1 1 240px;
  max-width: 340px;
  min-width: 0;
}
.search > svg {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 32px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
}
.search input::placeholder { color: #a1a1aa; }
.search input:focus {
  outline: none;
  box-shadow: var(--ring);
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input::-webkit-search-decoration { -webkit-appearance: none; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.filters button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.filters button:hover { color: var(--ink); border-color: var(--ink); }
.filters button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
  font-weight: 700;
}
.filters .n {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: .8;
}

.list { padding: 0; }

.row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1.4fr) minmax(190px, 1fr) minmax(120px, auto) 136px auto;
  grid-template-areas: "num ident split amount status action";
  align-items: center;
  gap: 6px 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row:hover, .row:focus-within { background: var(--surface-2); }

.row .num {
  grid-area: num;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.row .ident { grid-area: ident; min-width: 0; }
.row .name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.row .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.row .meta .sep { color: var(--line-mid); }

.row .split-box {
  grid-area: split;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.split-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  white-space: nowrap;
}
.split-chip.o1 {
  background: var(--money-green-soft);
  border: 1px solid var(--money-green-border);
  color: var(--money-green-dark);
  font-weight: 800;
}
.split-chip.o2 {
  background: var(--money-red-soft);
  border: 1px solid var(--money-red-border);
  color: var(--money-red);
  font-weight: 750;
}

.row .amount {
  grid-area: amount;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.row .money { font-size: 13.5px; font-weight: 800; color: var(--money-green); }
.row .note { display: block; font-size: 11px; color: var(--money-green-dark); font-weight: 600; }

.row .status { grid-area: status; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.row .action { grid-area: action; justify-self: end; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pill.paid {
  background: var(--money-green-soft);
  border-color: var(--money-green);
  color: var(--money-green-dark);
}
.pill.unpaid {
  background: var(--money-red-soft);
  border: 1px dashed var(--money-red);
  color: var(--money-red);
}
.pill.pending {
  background: var(--surface-3);
  border-color: var(--line-mid);
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}
.btn:disabled { cursor: not-allowed; opacity: .4; }

.btn.primary {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn.quiet {
  background: var(--surface-3);
  border-color: var(--line-mid);
  color: var(--ink);
}
.btn.quiet:hover:not(:disabled) { border-color: var(--ink); }

.btn.ghost {
  background: var(--surface);
  border-color: var(--line-mid);
  color: var(--ink);
}
.btn.ghost:hover:not(:disabled) { background: var(--surface-3); border-color: var(--ink); }

.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }

/* ---------------------------------------------------------------- messages */

.empty {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
}
.empty svg { width: 24px; height: 24px; color: var(--faint); margin-bottom: 4px; }
.empty strong { color: var(--ink); font-size: 13.5px; }
.empty p { font-size: 12px; max-width: 38ch; }

.error-box {
  margin: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface-3);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.error-box p { flex: 1 1 220px; }

/* skeleton */

.sk {
  display: block;
  border-radius: 3px;
  background: var(--surface-3);
}
.sk-row .num { background: transparent; }
.sk-dot { width: 18px; height: 18px; }
.sk-line { height: 10px; }
.sk-line + .sk-line { margin-top: 6px; }
.w-40 { width: 40%; }
.w-60 { width: 60%; }
.w-80 { width: 80%; }
.sk-pill { width: 80px; height: 20px; }
.sk-btn { width: 72px; height: 26px; }

/* ------------------------------------------------------------------ rules */

.rules {
  margin: 14px 0 0;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.rules summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after {
  content: "";
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
}
.rules[open] summary::after { transform: rotate(-135deg); }
.rules ul {
  display: grid;
  gap: 6px;
  padding: 0 16px 12px;
  font-size: 12px;
  color: var(--muted);
}
.rules li { position: relative; padding-left: 14px; }
.rules li strong { color: var(--ink); }
.rules li::before {
  content: "•";
  position: absolute;
  left: 2px;
  color: var(--ink);
}

/* ----------------------------------------------------------------- footer */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  flex-wrap: wrap;
  padding: 20px 0 32px;
  font-size: 11.5px;
  color: var(--faint);
}
.foot .mark {
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--ink);
}
.foot-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px 14px;
  flex-wrap: wrap;
}
.foot-link {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.foot-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- dialogs */

dialog {
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 8px 8px 0 0 rgba(10, 10, 10, 0.9);
  width: min(480px, calc(100vw - 24px));
  max-width: none;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
dialog:not([open]) { display: none; }

.sheet-form { display: flex; flex-direction: column; max-height: min(90vh, 740px); }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-mid);
  background: var(--ink);
  color: #ffffff;
}
.sheet-head .titles { flex: 1; min-width: 0; }
.sheet-head h2 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}
.sheet-head .eyebrow { font-size: 10px; color: var(--ink-muted); }
.sheet-head .icon-btn {
  background: #27272a;
  border-color: #3f3f46;
  color: #ffffff;
}
.sheet-close { flex: none; }

.sheet-body {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  overflow-y: auto;
}

.sheet-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line-mid);
  background: var(--surface-2);
}
.sheet-actions .grow { flex: 1; }

.target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.target .t-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
}
.target .t-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.target .t-amount {
  font-size: 16px;
  font-weight: 800;
  color: var(--money-green);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.target .t-amount small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
}

.field { display: grid; gap: 5px; }
.field > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.field input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
}
.field input:focus {
  outline: none;
  box-shadow: var(--ring);
}

.help { font-size: 11.5px; color: var(--faint); line-height: 1.45; }

.drop {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 16px;
  border: 1.5px dashed var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
}
.drop:hover, .drop.is-over, .drop:focus-within {
  background: var(--surface-3);
}
.drop svg { width: 20px; height: 20px; color: var(--ink); }
.drop strong { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.drop small { font-size: 11px; color: var(--muted); }
.drop .pick { text-decoration: underline; }

.drop .file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.preview[hidden] { display: none; }
.preview .thumb {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--ink);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}
.preview .thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview .p-meta { flex: 1; min-width: 0; }
.preview .p-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview .p-size { font-size: 11px; color: var(--muted); }
.preview .remove {
  flex: none;
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}

.form-error {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.form-error:empty { display: none; }

/* ------------------------------------------------------------------ done */

.done .sheet-body { gap: 10px; }
.done .lead { font-size: 12.5px; color: var(--muted); }

.ref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
}
.ref code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

/* ------------------------------------------- proof reading + proof viewer */

.check-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  text-align: left;
}
.check-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #ffffff;
}
.check-mark svg { width: 18px; height: 18px; }
.check-copy { display: grid; gap: 2px; min-width: 0; }
.check-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}
.check-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.pill.check-ok,
.pill.check.cocok { color: var(--money-green-dark); background: var(--money-green-soft); border-color: var(--money-green); }
.pill.check-bad,
.pill.check.tidak_cocok,
.pill.check.bukan_bukti { color: var(--money-red); background: var(--money-red-soft); border-color: var(--money-red); }
.pill.check-warn,
.pill.check.perlu_dicek,
.pill.check.tidak_terbaca { color: var(--money-red-dark); background: var(--money-red-soft); border: 1px dashed var(--money-red); }
.pill.check-neutral { color: var(--muted); background: var(--surface-2); border-color: var(--line); }

.sheet.proof { width: min(580px, calc(100vw - 24px)); }
.proof-view {
  display: grid;
  place-items: center;
  width: 100%;
  max-height: min(54vh, 520px);
  padding: 8px;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-md);
  background: var(--ink);
  overflow: auto;
}
.proof-view img {
  display: block;
  max-width: 100%;
  max-height: min(50vh, 480px);
  border-radius: 3px;
}
.proof-view img[hidden] { display: none; }

.pill.check-badge {
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}
.pill.check-badge::before { display: none; }
.pill.check-badge svg {
  flex: none;
  width: 12px;
  height: 12px;
}

.proof-source {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}
.proof-source:empty { display: none; }
.proof-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

@media (max-width: 960px) {
  .metrics.metrics-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metrics.metrics-5 .metric + .metric { border-left: 0; }
  .metrics.metrics-5 .metric:nth-child(even) { border-left: 1px solid var(--ink-line); }
  .metrics.metrics-5 .metric:nth-child(n + 3) { border-top: 1px solid var(--ink-line); }

  .sched-card-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .sched-groups {
    padding-left: 16px;
  }

  .row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "ident status"
      "split split"
      "amount action";
    gap: 6px 12px;
    padding: 10px 14px;
  }
  .row .num { display: none; }
  .row .amount { text-align: left; }
  .row .status { justify-self: end; }
}

@media (max-width: 680px) {
  .shell {
    width: calc(100% - 20px);
  }
  .top-inner {
    height: 50px;
    gap: 8px;
  }
  .brand-text small,
  .manage-link-text {
    display: none;
  }
  .manage-link {
    padding: 0 9px;
  }
  .chip {
    padding: 3px 8px;
    font-size: 11px;
  }
  .chip-live {
    display: none;
  }
  .bill-cell {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  /* Ringkasan 5 Metrik di HP: Grid 2 Kolom Rapat (Total Kotor 1 baris penuh di atas) */
  .metrics,
  .metrics.metrics-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metrics.metrics-5 .metric:first-child {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 11px 14px;
    border-bottom: 1px solid var(--ink-line);
  }
  .metrics.metrics-5 .metric:first-child .value {
    margin-top: 0;
    font-size: 17px;
  }
  .metrics.metrics-5 .metric:first-child .hint {
    display: none;
  }
  .metrics.metrics-5 .metric {
    padding: 10px 12px;
    border-left: 0;
    border-top: 0;
  }
  .metrics.metrics-5 .metric:nth-child(3),
  .metrics.metrics-5 .metric:nth-child(5) {
    border-left: 1px solid var(--ink-line);
  }
  .metrics.metrics-5 .metric:nth-child(n + 4) {
    border-top: 1px solid var(--ink-line);
  }
  .metric .label {
    font-size: 10px;
  }
  .metric .value {
    margin-top: 3px;
    font-size: 14.5px;
  }
  .metric .hint {
    font-size: 10.5px;
    margin-top: 2px;
  }

  .realized-strip {
    grid-template-columns: 1fr;
  }
  .realized-item {
    padding: 10px 12px;
    gap: 8px;
  }
  .realized-item + .realized-item {
    border-left: 0;
    border-top: 1px solid var(--ink-line);
  }
  .realized-label { font-size: 10px; }
  .realized-val { font-size: 15.5px; }
  .realized-sub { font-size: 10.5px; }

  .progress-block {
    padding: 9px 12px;
    gap: 6px 12px;
  }
  .progress-block .bar {
    flex: 1 1 100%;
    max-width: none;
    order: 3;
  }
  .progress-foot {
    font-size: 11px;
    gap: 6px 10px;
  }

  /* Tab Navigasi & Baris Kontrol di HP */
  .view-tabs {
    padding: 0 6px;
    scrollbar-width: none;
  }
  .view-tabs::-webkit-scrollbar { display: none; }
  .view-tabs button {
    height: 40px;
    padding: 0 10px;
    font-size: 12px;
  }

  .workspace-bar {
    padding: 10px;
    gap: 8px;
  }
  .workspace-bar .search {
    flex: 1 1 100%;
    max-width: none;
  }
  .workspace-bar .search input {
    height: 36px;
    font-size: 13px;
  }
  .workspace-bar .filters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
  .workspace-bar .filters button {
    justify-content: center;
    height: 32px;
    padding: 0 6px;
    font-size: 11.5px;
  }
  .workspace-actions {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
    padding-top: 2px;
  }

  /* Tabel Data berubah menjadi Kartu Vertikal Rapi di HP (Tanpa Geser Samping) */
  .table-sticky-wrap {
    max-height: none;
    overflow: visible;
  }
  .data-table,
  .data-table tbody,
  .data-table tfoot {
    display: block;
    width: 100%;
  }
  .data-table thead {
    display: none;
  }
  .data-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    padding: 12px;
    border-bottom: 1.5px solid var(--line-mid);
    background: var(--surface);
  }
  .data-table tbody tr.is-due-red {
    margin: 8px 10px;
    border: 2px solid var(--money-red);
    border-radius: var(--radius-md);
    background: #fff5f5;
  }
  .data-table tbody tr.is-due-red td,
  .data-table tbody tr.is-due-red td:first-child,
  .data-table tbody tr.is-due-red td:last-child {
    border: 0;
  }
  .data-table tbody tr.is-due-red td[data-label="Nama Grup"] {
    border-bottom: 1px dashed var(--money-red-border);
  }
  .today-focus-grid {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 8px;
  }
  .data-table tbody td {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    border: 0;
    text-align: left !important;
    white-space: normal !important;
  }
  .data-table tbody td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--faint);
  }
  .data-table tbody td[data-label="No"] {
    display: none;
  }
  .data-table tbody td[colspan] {
    grid-column: 1 / -1;
    text-align: center !important;
  }
  .data-table tbody td[colspan]::before {
    display: none;
  }
  .data-table tbody td[data-label="Nama Grup"] {
    grid-column: 1 / -1;
    font-size: 14px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line);
  }
  .data-table tbody td[data-label="Nama Grup"]::before {
    display: none;
  }
  .data-table tbody td.td-action {
    grid-column: 1 / -1;
    margin-top: 4px;
  }
  .data-table tbody td.td-action::before {
    display: none;
  }
  .data-table tbody td.td-action .btn {
    width: 100%;
    height: 36px;
    font-size: 13px;
  }

  /* Footer Total di HP */
  .data-table tfoot tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 14px 12px;
    background: var(--ink);
  }
  .data-table tfoot tr.foot-realized {
    background: #18181b;
    border-top: 1.5px solid #3f3f46;
  }
  .data-table tfoot td {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    border: 0;
    text-align: left !important;
  }
  .data-table tfoot td:first-child {
    grid-column: 1 / -1;
    font-size: 11.5px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--ink-line);
  }
  .data-table tfoot td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ink-muted);
  }
  .data-table tfoot td:first-child::before {
    display: none;
  }

  /* Jadwal H-1 & Kartu PJ di HP */
  .sched-kpi + .sched-kpi { border-left: 0; border-top: 1px solid var(--line); }
  .sched-card-head {
    padding: 12px;
    gap: 10px;
  }
  .sched-numbers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--line);
  }
  .sched-groups {
    padding: 0 12px 12px;
  }
  .sched-group-chip {
    width: 100%;
    justify-content: space-between;
    padding: 7px 10px;
  }
  .pj-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  /* Dialog Bottom Sheet di HP */
  dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 12px 12px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  }
  .sheet-actions {
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .sheet-actions .btn {
    flex: 1 1 auto;
    height: 38px;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }
