/* ============================================================
   Ledger AI workspace — Agentory (Design System 3.0)
   Emerald/teal financial identity, layered surfaces. Inherits root
   tokens and scopes --accent* to emerald inside #ledger-workspace.
   ============================================================ */

.agent-ico.ledger {
  background: var(--ledger-soft, rgba(43, 232, 165, 0.12));
  color: var(--ledger, #2BE8A5);
  border: 1px solid rgba(43, 232, 165, 0.3);
}

/* Ledger has no contact rail — override the shared .shell 2-col grid. */
#ledger-workspace {
  display: none;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  min-height: calc(100vh - 60px);

  /* Emerald/teal identity (scoped token shift) — every cyan accent the
     shared primitives reference (focus rings, secondary hovers, CTA,
     chips) resolves to emerald inside Ledger. No JS change. Semantic
     warning/danger colours stay amber/red on their own scale. */
  --accent: #2BE8A5;
  --accent-2: #16B8A6;
  --accent-strong: #1FB88C;
  --accent-ink: #04231A;
  --accent-soft: rgba(43, 232, 165, 0.12);
  --accent-line: rgba(43, 232, 165, 0.30);
}

#ledger-workspace .ws-breadcrumb strong { color: var(--ledger, #2BE8A5); }
#ledger-workspace .ws-product-switch .active { background: var(--ledger-soft, rgba(43, 232, 165, 0.12)); color: var(--ledger, #2BE8A5); }

.ledger-workspace-body {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px clamp(22px, 4vw, 48px) 56px;
  width: 100%;
}

/* Onboarding/hero stay a focused reading column even on the wide canvas */
.ledger-hero-copy,
.ledger-steps,
.ledger-auth-hint,
.ledger-login-card { max-width: 760px; }

/* Use the horizontal space: deep reports sit side-by-side on wide screens
   so the dashboard isn't one tall scroll. Collapses to one column < ~900px. */
.ledger-report-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 22px;
  align-items: start;
}
.ledger-report-columns > .ledger-monthly-report { margin-top: 24px; }

/* hero */
.ledger-hero-copy { margin-bottom: 30px; }
.ledger-hero-ico {
  width: 48px; height: 48px; font-size: 20px; border-radius: 14px;
  margin-bottom: 16px;
}
.ledger-hero-copy h2 { margin: 0 0 10px; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.ledger-hero-copy p { margin: 0; color: var(--muted); line-height: 1.6; max-width: 56ch; font-size: 15px; }

/* onboarding wizard */
.ledger-steps { display: grid; gap: 16px; counter-reset: lstep; }

.ledger-step {
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 16px);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  padding: 22px;
  opacity: 0.6;
  transition: opacity 0.2s var(--ease, ease), border-color 0.2s var(--ease, ease), box-shadow 0.2s var(--ease, ease);
}
.ledger-step.is-active { opacity: 1; }
.ledger-step.is-done { opacity: 1; border-color: rgba(52, 211, 153, 0.32); }
.ledger-step.is-locked {
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
}
.ledger-step.is-locked input,
.ledger-step.is-locked button,
.ledger-step.is-locked a {
  pointer-events: none;
}
.ledger-step.is-active {
  border-color: rgba(43, 232, 165, 0.5);
  box-shadow: 0 0 0 1px rgba(43, 232, 165, 0.12), 0 12px 30px -16px rgba(43, 232, 165, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ledger-step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ledger-step-num {
  width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--mono, monospace); font-size: 13px; font-weight: 700;
  background: var(--ledger-soft, rgba(43, 232, 165, 0.12));
  color: var(--ledger, #2BE8A5);
  border: 1px solid rgba(43, 232, 165, 0.28);
  flex: 0 0 auto;
}
.ledger-step.is-done .ledger-step-num {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.3);
}
.ledger-step.is-done .ledger-step-num::after { content: "✓"; }
.ledger-step.is-done .ledger-step-num { font-size: 0; }
.ledger-step.is-done .ledger-step-num::after { font-size: 15px; }
.ledger-step h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }

.ledger-field { display: grid; gap: 6px; margin-bottom: 14px; }
.ledger-field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.ledger-field input {
  width: 100%; max-width: 380px; padding: 11px 13px;
  border-radius: var(--r-sm, 8px);
  border: 1px solid var(--border); background: var(--panel-soft); color: var(--text); font-size: 14px;
  transition: border-color 0.16s var(--ease, ease), box-shadow 0.16s var(--ease, ease);
}
.ledger-field input:focus { outline: none; border-color: rgba(43, 232, 165, 0.5); box-shadow: 0 0 0 3px rgba(43, 232, 165, 0.12); }

.ledger-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Ledger primary CTA — clean emerald→teal (the muddy emerald→amber is gone) */
.ledger-workspace-body .cta-primary,
.ledger-actions .cta-primary {
  background: linear-gradient(180deg, var(--ledger, #2BE8A5), #16B8A6);
  color: #04231A;
  border-color: rgba(43, 232, 165, 0.5);
  box-shadow: 0 6px 18px -12px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.ledger-workspace-body .cta-primary:hover { filter: brightness(1.05); border-color: var(--ledger, #2BE8A5); }

.ledger-actions .cta-secondary.is-disabled,
.ledger-actions .cta-primary.is-disabled,
.ledger-actions .cta-primary:disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.ledger-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ledger-chip {
  padding: 9px 13px; border-radius: var(--r-pill, 999px);
  border: 1px solid var(--border); background: var(--panel-soft);
  color: var(--text); font-size: 12.5px; cursor: pointer; font-family: var(--mono, monospace);
  transition: border-color 0.15s var(--ease, ease), color 0.15s var(--ease, ease), background 0.15s var(--ease, ease);
}
.ledger-chip:hover { border-color: rgba(43, 232, 165, 0.45); color: var(--ledger, #2BE8A5); background: var(--ledger-soft, rgba(43, 232, 165, 0.1)); }

.ledger-wa-bot-hint {
  margin: 0 0 10px;
  font-size: 13px;
  font-family: var(--mono, monospace);
}
.ledger-wa-bot-hint strong { color: var(--ledger, #2BE8A5); font-weight: 650; }

.ledger-status { margin-top: 14px; font-size: 13px; color: var(--muted); }
.ledger-status.error { color: #f87171; }
.ledger-status.ok { color: var(--success); }

/* dashboard */
.ledger-dash-skeleton {
  grid-column: 1 / -1;
  padding: 18px 4px;
  font-size: 14px;
}

.ledger-dash-head { margin-bottom: 4px; }
.ledger-dash-head h3 { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.ledger-dash-head p { margin: 0; }

.ledger-dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-top: 18px;
}
.ledger-dash-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 16px);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  box-shadow: var(--sh-1, 0 1px 2px rgba(0,0,0,.45)), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  padding: 18px;
  transition: border-color 0.16s var(--ease, ease), transform 0.16s var(--ease, ease), box-shadow 0.16s var(--ease, ease);
}
/* emerald accent rail — instant "financial card" read */
.ledger-dash-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ledger, #2BE8A5), transparent 72%);
  opacity: 0.7;
}
.ledger-dash-card:hover { transform: translateY(-2px); border-color: var(--border-strong, #353b48); box-shadow: var(--sh-2), inset 0 1px 0 rgba(255, 255, 255, 0.03); }
.ledger-dash-card .label {
  font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 8px; font-family: var(--mono, monospace);
}
.ledger-dash-card .value { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; font-family: var(--mono, monospace); line-height: 1.1; }
.ledger-dash-card.warning { border-color: rgba(43, 232, 165, 0.35); }
.ledger-dash-card.warning .value { color: var(--ledger, #2BE8A5); }
.ledger-dash-card.is-clickable {
  cursor: pointer;
  user-select: none;
}
.ledger-dash-hint {
  margin-top: 8px;
  font-size: 10px;
  color: var(--ledger, #2BE8A5);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--mono, monospace);
}
.ledger-dash-card.is-clickable:hover,
.ledger-dash-card.is-clickable.is-active {
  border-color: rgba(43, 232, 165, 0.55);
  box-shadow: 0 8px 24px -12px rgba(43, 232, 165, 0.45);
}
.ledger-dash-card.is-clickable.is-active {
  background: linear-gradient(180deg, rgba(43, 232, 165, 0.08), var(--bg-elev));
}
.ledger-dash-card.is-clickable:focus-visible {
  outline: 2px solid var(--ledger, #2BE8A5);
  outline-offset: 2px;
}

.ledger-transaction-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--r-lg, 16px);
  border: 1px solid rgba(43, 232, 165, 0.28);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
}

.ledger-aging-panel {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(43, 232, 165, 0.28);
  border-radius: var(--r-lg, 16px);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
}

.ledger-aging-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ledger-aging-stale {
  font-size: 13px;
  color: var(--ledger, #2BE8A5);
  margin: 0 0 12px;
}

.ledger-aging-buckets {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.ledger-aging-bucket {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.ledger-aging-bucket-label {
  color: var(--muted);
}

.ledger-aging-bucket-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.ledger-aging-bucket-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ledger, #2BE8A5), rgba(43, 232, 165, 0.55));
  min-width: 0;
  transition: width 0.25s ease;
}

.ledger-aging-bucket.over_90 .ledger-aging-bucket-fill {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.ledger-aging-bucket-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ledger-aging-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ledger-aging-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  border-left: 3px solid var(--ledger, #2BE8A5);
}

.ledger-aging-item.over_90 {
  border-left-color: #f59e0b;
}

.ledger-aging-item-main {
  min-width: 0;
}

.ledger-aging-item-name {
  font-weight: 600;
}

.ledger-aging-item-meta {
  font-size: 12px;
  color: var(--muted);
}

.ledger-aging-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.ledger-aging-item-amount {
  font-weight: 600;
  white-space: nowrap;
}

.ledger-aging-mark-paid {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(43, 232, 165, 0.45);
  background: rgba(43, 232, 165, 0.08);
  color: var(--ledger, #2be8a5);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.ledger-aging-mark-paid:hover {
  background: rgba(43, 232, 165, 0.16);
  border-color: rgba(43, 232, 165, 0.65);
}

.ledger-aging-mark-partial {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
.ledger-aging-mark-partial:hover {
  border-color: var(--ledger, #2BE8A5);
  color: var(--ledger, #2BE8A5);
}

.ledger-aging-mark-paid:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ledger-aging-empty,
.ledger-aging-error {
  margin: 8px 0 0;
  text-align: center;
}

.ledger-aging-error {
  color: #f87171;
}

.ledger-invoice-running-panel {
  margin-top: 8px;
  padding: 24px 26px;
}

.ledger-invoice-running-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.7fr) minmax(180px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.ledger-invoice-running-toolbar .ledger-field {
  margin-bottom: 0;
}

.ledger-invoice-running-toolbar .ledger-field span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.ledger-invoice-running-toolbar input,
.ledger-invoice-running-toolbar select {
  width: 100%;
  max-width: none;
}

.ledger-invoice-running-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 14px;
}

.ledger-invoice-running-summary div {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
}

.ledger-invoice-running-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.ledger-invoice-running-summary strong {
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.ledger-invoice-running-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
}

.ledger-invoice-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) minmax(280px, 1.4fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--ledger, #2BE8A5);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
}

.ledger-invoice-row.overdue {
  border-left-color: #f59e0b;
}

.ledger-invoice-row.partial {
  border-left-color: #4de3ff;
}

.ledger-invoice-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ledger-invoice-main strong,
.ledger-invoice-main span,
.ledger-invoice-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-invoice-main strong {
  font-weight: 700;
}

.ledger-invoice-main span,
.ledger-invoice-main small {
  color: var(--muted);
  font-size: 12px;
}

.ledger-invoice-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 8px;
}

.ledger-invoice-amounts span {
  display: grid;
  gap: 2px;
}

.ledger-invoice-amounts em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.ledger-invoice-amounts b {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ledger-invoice-status {
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  border: 1px solid rgba(43, 232, 165, 0.32);
  color: var(--ledger, #2BE8A5);
  background: rgba(43, 232, 165, 0.08);
}

.ledger-invoice-status.partial {
  border-color: rgba(77, 227, 255, 0.35);
  color: #4de3ff;
  background: rgba(77, 227, 255, 0.08);
}

.ledger-invoice-status.overdue {
  border-color: rgba(245, 158, 11, 0.38);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
}

.ledger-invoice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ledger-invoice-detail-panel,
.ledger-invoice-pending-panel {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
}

.ledger-invoice-detail-panel h4 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 650;
}

.ledger-invoice-detail-grid {
  display: grid;
  grid-template-columns: minmax(130px, 0.4fr) minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}

.ledger-invoice-detail-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.ledger-invoice-detail-grid dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.ledger-invoice-pending-panel pre {
  margin: 0 0 12px;
  white-space: pre-wrap;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .ledger-invoice-running-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .ledger-invoice-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .ledger-invoice-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .ledger-invoice-running-panel {
    padding: 18px;
  }
  .ledger-invoice-running-toolbar,
  .ledger-invoice-running-summary,
  .ledger-invoice-amounts {
    grid-template-columns: 1fr;
  }
}
.ledger-transaction-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ledger-transaction-head h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 650;
}
.ledger-transaction-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}
.ledger-txn-item {
  padding: 12px 14px;
  border-radius: var(--r-md, 12px);
  border: 1px solid var(--border);
  background: var(--panel-soft);
}
.ledger-txn-item.income { border-left: 3px solid #4ade80; }
.ledger-txn-item.expense { border-left: 3px solid #f87171; }
.ledger-txn-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 4px;
}
.ledger-txn-amount {
  font-family: var(--mono, monospace);
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ledger-txn-item.income .ledger-txn-amount { color: var(--ledger, #2BE8A5); }
.ledger-txn-item.expense .ledger-txn-amount { color: #fca5a5; }
.ledger-txn-date {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono, monospace);
}
.ledger-txn-desc {
  font-size: 14px;
  margin-bottom: 2px;
}
.ledger-txn-meta {
  font-size: 12px;
  color: var(--muted);
}
.ledger-txn-empty,
.ledger-txn-loading {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.ledger-report-bar {
  margin-top: 22px;
  padding: 18px;
  border-radius: var(--r-lg, 16px);
  border: 1px solid rgba(43, 232, 165, 0.28);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
}
.ledger-report-copy h4 { margin: 0 0 6px; font-size: 16px; font-weight: 650; }
.ledger-report-copy p { margin: 0; font-size: 13px; max-width: 42ch; }
.ledger-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ledger-report-period-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.ledger-report-select {
  padding: 10px 12px;
  border-radius: var(--r-sm, 8px);
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 13px;
  min-width: 180px;
}

.ledger-monthly-report {
  margin-top: 28px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.ledger-monthly-report-body {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}
.ledger-monthly-report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}
.ledger-monthly-report-meta strong {
  color: var(--text);
  font-size: 15px;
}
.ledger-monthly-report-meta span {
  font-family: var(--mono, monospace);
  color: var(--ledger, #2BE8A5);
}
.ledger-monthly-section {
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 16px);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  padding: 16px 18px;
}
.ledger-monthly-section h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ledger, #2BE8A5);
}
.ledger-monthly-rows {
  margin: 0;
  display: grid;
  gap: 8px;
}
.ledger-monthly-rows dt {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--mono, monospace);
}
.ledger-monthly-rows dd {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.45;
  font-family: var(--mono, monospace);
}
.ledger-monthly-aging {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}
.ledger-monthly-aging .ledger-aging-bucket {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 8px;
  align-items: center;
}

.ledger-summary-text {
  margin-top: 22px; padding: 18px;
  border-radius: var(--r-lg, 16px);
  border: 1px solid var(--border);
  background: var(--panel-soft);
  white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--text);
}

.ledger-auth-hint {
  padding: 16px 18px; border-radius: var(--r, 12px);
  border: 1px dashed var(--border-strong, #353b48);
  color: var(--muted); font-size: 13px; margin-bottom: 18px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.ledger-auth-hint button { margin-top: 0; }

/* Dedicated login card inside the Ledger workspace (shared Agentory session) */
.ledger-login-card {
  margin: 0 auto 26px;
  padding: 26px clamp(20px, 4vw, 34px);
  border-radius: var(--r-lg, 16px);
  border: 1px solid rgba(43, 232, 165, 0.28);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(43, 232, 165, 0.08), transparent 60%),
    var(--panel-soft);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
.ledger-login-card h3 {
  margin: 0 0 6px; font-size: 21px; font-weight: 700; letter-spacing: -0.02em;
}
.ledger-login-card > p.muted { margin: 0 0 18px; font-size: 14px; line-height: 1.55; }
.ledger-login-error {
  margin: 0 0 14px; padding: 10px 12px; font-size: 13px; line-height: 1.45;
  border-radius: var(--r-sm, 8px);
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1); color: #fca5a5;
}
.ledger-login-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
  border-radius: var(--r, 12px); border: 1px solid var(--border-strong, #353b48);
  background: #fff; color: #1f2328; transition: filter 0.15s ease, transform 0.05s ease;
}
.ledger-login-google:hover { filter: brightness(0.96); }
.ledger-login-google:active { transform: translateY(1px); }
.ledger-login-google svg { flex: 0 0 auto; }
.ledger-login-sep {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--faint, #6b7280);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
}
.ledger-login-sep::before,
.ledger-login-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.ledger-login-fields { display: grid; gap: 10px; }
.ledger-login-fields input {
  width: 100%; padding: 12px 14px; font-size: 14px;
  border-radius: var(--r, 12px); border: 1px solid var(--border);
  background: var(--bg-elev, #0d1117); color: var(--text);
}
.ledger-login-fields input:focus {
  outline: none; border-color: rgba(43, 232, 165, 0.6);
  box-shadow: 0 0 0 3px rgba(43, 232, 165, 0.16);
}
.ledger-login-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ledger-login-actions .cta-primary,
.ledger-login-actions .cta-secondary { flex: 1 1 140px; }
.ledger-login-alt {
  margin-top: 14px; padding: 0; background: none; border: 0; cursor: pointer;
  font-size: 12.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px;
}
.ledger-login-alt:hover { color: var(--text); }

/* "Chat Bot" quick-access in the workspace header */
.ledger-chatbot-btn {
  border-color: rgba(43, 232, 165, 0.45);
  color: var(--ledger, #2BE8A5);
}
.ledger-chatbot-btn:hover {
  background: rgba(43, 232, 165, 0.12);
  border-color: rgba(43, 232, 165, 0.7);
}

.ledger-channel-panel {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--r, 12px);
  border: 1px solid var(--border);
  background: var(--panel-soft);
}
.ledger-channel-panel h4 { margin: 0 0 8px; font-size: 15px; font-weight: 650; }
.ledger-channel-telegram { border-color: rgba(255, 111, 181, 0.35); }
.ledger-channel-wa { margin-top: 12px; border-color: rgba(52, 211, 153, 0.25); }
.ledger-channel-status.ok {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--success);
  font-weight: 600;
}
.ledger-telegram-code-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--r-sm, 8px);
  border: 1px dashed rgba(255, 111, 181, 0.4);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}
.ledger-telegram-code {
  font-family: var(--mono, monospace);
  font-size: 18px;
  letter-spacing: 0.12em;
  color: #FF6FB5;
}
.ledger-telegram-widget {
  margin: 10px 0 4px;
  min-height: 40px;
}
.ledger-telegram-widget-help {
  margin: 4px 0 0;
  font-size: 13px;
}
.ledger-telegram-fallback {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.ledger-telegram-fallback > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #94a3b8);
  list-style: revert;
}
.ledger-telegram-fallback[open] > summary {
  margin-bottom: 10px;
}
.ledger-empty-banner {
  margin: 4px 0 16px;
  padding: 16px 18px;
  border-radius: var(--r, 12px);
  border: 1px solid rgba(255, 111, 181, 0.35);
  background: var(--panel-soft);
}
.ledger-empty-banner h4 { margin: 0 0 6px; font-size: 15px; font-weight: 650; }
.ledger-empty-banner .ledger-chip-row { margin-top: 12px; }
.ledger-empty-connect {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--r-sm, 8px);
  border: 1px dashed rgba(255, 111, 181, 0.4);
}
.ledger-empty-connect > p { margin: 0 0 8px; }

/* business profile form + overview */
.ledger-profile-form {
  margin-top: 18px;
  display: grid;
  gap: 4px;
  max-width: 440px;
}
.ledger-field textarea {
  width: 100%;
  max-width: 380px;
  padding: 11px 13px;
  border-radius: var(--r-sm, 8px);
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.16s var(--ease, ease), box-shadow 0.16s var(--ease, ease);
}
.ledger-field textarea:focus {
  outline: none;
  border-color: rgba(43, 232, 165, 0.5);
  box-shadow: 0 0 0 3px rgba(43, 232, 165, 0.12);
}
.ledger-collapsible-section {
  margin-top: 24px;
}
.ledger-collapsible-details {
  border: 1px solid var(--border);
  border-radius: var(--r-md, 12px);
  background: var(--panel, rgba(255, 255, 255, 0.02));
  overflow: hidden;
}
.ledger-collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.ledger-collapsible-summary::-webkit-details-marker {
  display: none;
}
.ledger-collapsible-head {
  flex: 1;
  min-width: 0;
}
.ledger-collapsible-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ledger-collapsible-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}
.ledger-collapsible-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  white-space: nowrap;
}
.ledger-collapsible-chevron {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  position: relative;
  transition: transform 0.2s ease, background 0.15s ease;
}
.ledger-collapsible-chevron::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted, #94a3b8);
  border-bottom: 2px solid var(--text-muted, #94a3b8);
  transform: rotate(45deg) translate(-2px, -2px);
}
.ledger-collapsible-details[open] .ledger-collapsible-chevron {
  transform: rotate(180deg);
}
.ledger-collapsible-summary:hover .ledger-collapsible-chevron {
  background: rgba(43, 232, 165, 0.08);
  border-color: rgba(43, 232, 165, 0.25);
}
.ledger-collapsible-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.ledger-collapsible-body .ledger-report-actions {
  margin-top: 12px;
}
.ledger-bank-statement-panel {
  margin-top: 12px;
}
.ledger-inventory-panel {
  margin-top: 12px;
}
.ledger-inventory-stale {
  margin: 10px 0 0;
  font-size: 13px;
}
.ledger-inventory-summary {
  margin-top: 14px;
}
.ledger-inventory-form {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}
.ledger-inventory-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 14px;
}
.ledger-inventory-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}
.ledger-inventory-form-grid input,
.ledger-inventory-form-grid textarea {
  font-weight: 400;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  resize: vertical;
}
.ledger-inventory-form-wide {
  grid-column: 1 / -1;
}
.ledger-inventory-form-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}
.ledger-inventory-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.ledger-inventory-desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  max-width: 28rem;
  color: rgba(255, 255, 255, 0.65);
}
.ledger-inventory-desc-empty {
  font-style: italic;
  opacity: 0.55;
}
.ledger-inventory-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ledger-inventory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ledger-inventory-table th,
.ledger-inventory-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.ledger-inventory-table th {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}
.ledger-inventory-table tr.is-low-stock {
  background: rgba(224, 154, 46, 0.08);
}
.ledger-inventory-table tr:last-child td {
  border-bottom: none;
}
.ledger-inventory-name strong {
  display: inline;
}
.ledger-inventory-low-flag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(224, 154, 46, 0.2);
  color: var(--warning, #b45309);
}
.ledger-inventory-meta {
  margin-top: 4px;
  font-size: 12px;
}
.ledger-inventory-qty,
.ledger-inventory-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ledger-inventory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 140px;
}
.ledger-inventory-edit,
.ledger-inventory-adjust,
.ledger-inventory-delete {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
}
.ledger-inventory-edit:hover,
.ledger-inventory-adjust:hover {
  border-color: var(--accent, #e09a2e);
}
.ledger-inventory-delete {
  color: var(--danger, #dc2626);
  border-color: rgba(220, 38, 38, 0.35);
}
.ledger-inventory-delete:hover {
  border-color: var(--danger, #dc2626);
  background: rgba(220, 38, 38, 0.08);
}
.ledger-inventory-empty,
.ledger-inventory-error {
  margin-top: 12px;
  font-size: 13px;
}
.ledger-inventory-error {
  color: var(--danger, #c0392b);
}
.ledger-inventory-hint {
  margin-top: 12px;
  font-size: 12px;
}
.ledger-collapsible-badge.ledger-inventory-badge-warn {
  color: var(--warning, #b45309);
  background: rgba(224, 154, 46, 0.15);
}
.ledger-bank-statement-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.ledger-bank-statement-filename {
  font-size: 13px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ledger-bank-statement-progress {
  margin: 10px 0 0;
  font-size: 13px;
}
.ledger-bank-statement-progress.error {
  color: var(--danger, #c0392b);
}
.ledger-bank-statement-summary {
  margin-top: 14px;
}
.ledger-bank-statement-warnings {
  margin-top: 10px;
}
.ledger-bank-statement-warning {
  margin: 4px 0;
  font-size: 13px;
  color: var(--muted, #6b7280);
}
.ledger-bank-statement-preview {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ledger-bank-statement-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ledger-bank-statement-table th,
.ledger-bank-statement-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.ledger-bank-statement-table th {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}
.ledger-bank-statement-table tr.is-excluded {
  opacity: 0.45;
}
.ledger-bank-statement-table tr.is-duplicate td.ledger-bank-statement-desc {
  color: var(--warning, #b45309);
}
.ledger-bank-statement-amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ledger-bank-statement-desc {
  max-width: 280px;
  word-break: break-word;
}
.ledger-bank-statement-more {
  padding: 8px 10px;
  margin: 0;
  font-size: 12px;
}
.ledger-bank-statement-hint {
  margin-top: 12px;
  font-size: 12px;
}

.ledger-health-explain-panel {
  margin-top: 12px;
}
.ledger-health-contrib-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ledger-health-contrib-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ledger-health-contrib-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  font-size: 13px;
}
.ledger-health-contrib-label {
  font-weight: 600;
}
.ledger-health-contrib-points {
  font-size: 12px;
}
.ledger-health-contrib-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.ledger-health-contrib-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e09a2e, #f0b84d);
}

.ledger-bank-statement-panel + .ledger-insight-panel {
  margin-top: 12px;
}
.ledger-insight-panel {
  margin-top: 24px;
}
.ledger-insight-stale {
  margin: 10px 0 0;
  font-size: 13px;
}
.ledger-insight-summary {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.ledger-insight-meta {
  margin: 12px 0 0;
  font-size: 12px;
}

.ledger-capital-panel {
  margin-top: 0;
}
.ledger-insight-panel.ledger-collapsible-section + .ledger-capital-panel.ledger-collapsible-section {
  margin-top: 12px;
}
.ledger-capital-stale {
  margin: 10px 0 0;
  font-size: 13px;
}
.ledger-legal-form {
  margin-top: 16px;
}
.ledger-capital-score-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 14px;
}
.ledger-capital-score-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--r-md, 12px);
  border: 1px solid var(--border);
  background: var(--panel-soft);
}
.ledger-capital-score-num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.ledger-capital-score-label {
  font-size: 14px;
  font-weight: 600;
}
.ledger-capital-label-ready .ledger-capital-score-num {
  color: #22c55e;
}
.ledger-capital-label-almost_ready .ledger-capital-score-num {
  color: #eab308;
}
.ledger-capital-label-needs_work .ledger-capital-score-num,
.ledger-capital-label-insufficient_data .ledger-capital-score-num {
  color: #94a3b8;
}
.ledger-capital-period {
  margin: 0;
  font-size: 13px;
}
.ledger-capital-summary {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md, 12px);
  border: 1px solid var(--border);
  background: var(--panel-soft);
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.55;
}
.ledger-capital-checklist-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ledger-capital-checklist-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ledger-capital-check-ready {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.ledger-capital-check-partial {
  background: rgba(234, 179, 8, 0.15);
  color: #ca8a04;
}
.ledger-capital-check-missing {
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
}
.ledger-capital-meta {
  margin: 12px 0 0;
  font-size: 12px;
}
.ledger-capital-disclaimer {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.ledger-overview-summary {
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: var(--r-md, 12px);
  border: 1px solid var(--border);
  background: var(--panel-soft);
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
}

/* Neraca & Arus Kas — colored summary badges */
.ledger-collapsible-badge.ledger-badge-ok {
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.12);
}
.ledger-collapsible-badge.ledger-badge-warn {
  color: #dc2626;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
}

/* Neraca & Arus Kas — financial tables */
.ledger-fin-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 14px;
}
.ledger-fin-table td,
.ledger-fin-table th {
  padding: 8px 4px;
  text-align: left;
  vertical-align: top;
}
.ledger-fin-table td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ledger-fin-table tr.grp th {
  padding-top: 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.ledger-fin-table tr.grp:first-child th {
  padding-top: 4px;
  border-top: none;
}
.ledger-fin-table tr.total td {
  font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border);
}
.ledger-fin-notes {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  font-style: italic;
}

/* Saldo Awal — inline form */
.ledger-opening-balance-form {
  margin-top: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.ledger-opening-balance-form h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
}
.ledger-opening-balance-hint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
}
.ledger-inline-status {
  font-size: 13px;
  font-weight: 600;
}
.ledger-inline-status.ok {
  color: var(--success);
}
.ledger-inline-status.error {
  color: #f87171;
}

/* reset data (danger) */
.ledger-workspace-body .cta-danger {
  background: linear-gradient(180deg, #f87171, #dc2626);
  color: #fff;
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: 0 6px 20px -10px rgba(220, 38, 38, 0.6);
}
.ledger-workspace-body .cta-danger:hover { filter: brightness(1.06); border-color: #f87171; }
.ledger-workspace-body .cta-danger:disabled { opacity: 0.45; pointer-events: none; cursor: not-allowed; }

.ledger-reset-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--r-lg, 16px);
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
}
.ledger-reset-panel h4 { margin: 0 0 6px; font-size: 16px; font-weight: 650; color: #f87171; }
.ledger-reset-modes { display: grid; gap: 10px; margin-top: 12px; }
.ledger-reset-modes label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.ledger-reset-modes input[type="radio"] { margin-top: 3px; accent-color: #f87171; }

@media (max-width: 640px) {
  .ledger-workspace-body { padding: 22px 16px 44px; }
  .ledger-hero-copy h2 { font-size: 25px; }
}

/* ============================================================
   Dashboard structural pass — a clean KPI strip with a hero metric.
   No markup/JS change: cards are still built by ledger.js; we only
   reshape the grid and emphasise net profit (the CFO headline).
   ============================================================ */
.ledger-dash-head h3 { font-size: 24px; }

/* Stable 4-up KPI grid (4 across on desktop, reflows to 2 then 1) so the
   Kesehatan Bisnis hero can span 2 columns without auto-fit collapsing it
   into a single narrow cell — which clipped "Berisiko (32/100)". */
.ledger-dashboard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ledger-dash-card .value { white-space: nowrap; }

/* Kesehatan Bisnis = the headline read: a 2-column hero with a larger,
   wrap-safe score so the status text is never truncated. */
.ledger-dash-card[data-code="business_health"] { grid-column: span 2; }
.ledger-dash-card[data-code="business_health"] .value {
  font-size: clamp(32px, 3.4vw, 46px);
  white-space: normal;
  line-height: 1.05;
}

@media (max-width: 1100px) {
  .ledger-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ledger-dashboard-grid { grid-template-columns: 1fr; }
  .ledger-dash-card[data-code="business_health"] { grid-column: auto; }
}

/* Laba Bersih = the headline KPI, SIGN-AWARE so a loss never reads as
   "good/green". Backend marks a negative result with .warning (severity);
   positive profit = emerald-lit + green value, loss = danger-tinted + red
   value. This overrides the generic .warning .value emerald rule. */
.ledger-dash-card[data-code="net_profit"]::before { opacity: 1; height: 3px; }

.ledger-dash-card[data-code="net_profit"]:not(.warning) {
  border-color: rgba(43, 232, 165, 0.42);
  background:
    radial-gradient(360px 150px at 0% -20%, rgba(43, 232, 165, 0.12), transparent 62%),
    linear-gradient(180deg, var(--panel), var(--bg-elev));
}
.ledger-dash-card[data-code="net_profit"]:not(.warning) .value { color: var(--ledger, #2BE8A5); }

.ledger-dash-card[data-code="net_profit"].warning {
  border-color: rgba(248, 113, 113, 0.42);
  background:
    radial-gradient(360px 150px at 0% -20%, rgba(248, 113, 113, 0.1), transparent 62%),
    linear-gradient(180deg, var(--panel), var(--bg-elev));
}
.ledger-dash-card[data-code="net_profit"].warning::before { background: linear-gradient(90deg, #f87171, transparent 72%); }
.ledger-dash-card[data-code="net_profit"].warning .value { color: #fca5a5; }

/* Breathing room between the KPI strip and the operational detail below */
.ledger-report-bar { margin-top: 28px; }

/* ---- Charts panel (Ringkasan tab, center) ---- */
.ledger-charts-panel {
  margin-top: 20px;
}
.ledger-charts-panel--ringkasan {
  margin: 28px 0 24px;
  padding: 0;
  border-top: none;
}
.ledger-charts-panel--ringkasan .ledger-collapsible-details {
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 16px);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
}
.ledger-charts-panel--ringkasan .ledger-collapsible-summary {
  padding: 18px 20px 14px;
}
.ledger-charts-panel--ringkasan .ledger-collapsible-body {
  padding: 0 20px 20px;
}
.ledger-charts-error {
  margin: 12px 0 0;
  font-size: 13px;
  color: #fca5a5;
}
.ledger-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.ledger-chart-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 16px);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  padding: 16px 18px;
  min-width: 0;
}
.ledger-chart-card--wide {
  grid-column: 1 / -1;
}
.ledger-chart-card--hero {
  padding: 18px 20px 20px;
}
.ledger-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.ledger-chart-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ledger, #2BE8A5);
}
.ledger-chart-sub {
  margin: 5px 0 0;
  max-width: 520px;
  font-size: 12px;
  line-height: 1.45;
}
.ledger-chart-meta {
  font-size: 12px;
  font-family: var(--mono, monospace);
}
.ledger-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 11px;
  color: var(--muted);
}
.ledger-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ledger-chart-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  flex: none;
}
.ledger-chart-canvas {
  width: 100%;
  min-height: 120px;
}
.ledger-chart-canvas--combo {
  min-height: 230px;
}
.ledger-chart-canvas svg {
  width: 100%;
  height: auto;
  display: block;
}
.ledger-chart-canvas--donut {
  max-width: 220px;
  margin: 0 auto;
}
.ledger-chart-canvas--gauge {
  max-width: 260px;
  margin: 0 auto;
}
.ledger-chart-legend-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 12px;
}
.ledger-chart-legend-list li {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
}
.ledger-chart-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: block;
}
.ledger-chart-legend-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ledger-chart-legend-val {
  color: var(--muted);
  font-family: var(--mono, monospace);
  font-size: 11px;
}
.ledger-chart-caption {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
}
.ledger-chart-insight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.ledger-chart-insight-item {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}
.ledger-chart-insight-item span {
  font-size: 10px;
  font-family: var(--mono, monospace);
  color: var(--ledger, #2BE8A5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ledger-chart-insight-item--watch span {
  color: #f59e0b;
}
.ledger-chart-insight-item p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.ledger-chart-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.ledger-chart-credit-list {
  display: grid;
  gap: 10px;
}
.ledger-chart-credit-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding: 13px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  cursor: pointer;
}
.ledger-chart-credit-row:hover {
  border-color: rgba(43, 232, 165, 0.35);
  background: rgba(43, 232, 165, 0.06);
}
.ledger-chart-credit-row:focus-visible {
  outline: 2px solid var(--ledger, #2BE8A5);
  outline-offset: 2px;
}
.ledger-chart-credit-row strong,
.ledger-chart-credit-row b {
  display: block;
  font-size: 14px;
}
.ledger-chart-credit-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.ledger-chart-credit-row--warning b {
  color: #fbbf24;
}
.ledger-chart-credit-row--positive b {
  color: var(--ledger, #2BE8A5);
}
.ledger-chart-placeholder {
  margin: 24px 0;
  text-align: center;
  font-size: 13px;
}

/* ---- Business health verdict card ---- */
.ledger-chart-card--health .ledger-chart-caption {
  text-align: left;
  margin: 5px 0 0;
  font-size: 12px;
}
.ledger-chart-health-body {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.ledger-chart-health-body .ledger-chart-canvas--gauge {
  flex: 0 0 220px;
  margin: 0;
}
.ledger-chart-vitals {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 280px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ledger-chart-vital {
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 30px -22px rgba(77, 227, 255, 0.6);
}
.ledger-chart-vital span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.ledger-chart-vital b {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  font-family: var(--mono, monospace);
  color: var(--text);
  letter-spacing: 0.01em;
}
.ledger-chart-vital--pos b {
  color: var(--ledger, #2be8a5);
}
.ledger-chart-vital--neg b {
  color: #ff9e8a;
}
.ledger-chart-vital small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
}

/* ---- Holographic chart treatment ---- */
.ledger-charts-panel .ledger-chart-canvas {
  overflow: visible;
}
.ledger-charts-panel .ledger-chart-canvas svg {
  overflow: visible;
}
.ledger-charts-panel .ledger-chart-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 130% at 85% -25%, rgba(77, 227, 255, 0.08), transparent 60%),
    linear-gradient(180deg, var(--panel), var(--bg-elev));
}
/* faint holographic grid, fading from the top */
.ledger-charts-panel .ledger-chart-card--hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(77, 227, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 232, 165, 0.05) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px;
  -webkit-mask-image: radial-gradient(130% 85% at 50% 0%, #000 28%, transparent 82%);
  mask-image: radial-gradient(130% 85% at 50% 0%, #000 28%, transparent 82%);
}
/* slow scan-line sheen */
.ledger-charts-panel .ledger-chart-card--hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -160px;
  height: 160px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(77, 227, 255, 0.07), transparent);
  animation: ledgerChartScan 7s linear infinite;
}
@keyframes ledgerChartScan {
  to {
    transform: translateY(560px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ledger-charts-panel .ledger-chart-card--hero::after {
    display: none;
  }
}

@media (max-width: 860px) {
  .ledger-charts-grid {
    grid-template-columns: 1fr;
  }
  .ledger-chart-card--wide {
    grid-column: auto;
  }
}

/* ---- AI Co-Founder panel ---- */
.ledger-cofounder-panel {
  margin-top: 8px;
}
.ledger-cofounder-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
  min-height: 420px;
}
.ledger-cofounder-sidebar {
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 16px);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-width: 0;
}
.ledger-cofounder-sidebar-head .cta-primary {
  width: 100%;
}
.ledger-cofounder-context-badge {
  font-size: 12px;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: var(--r, 12px);
  background: var(--panel-soft);
  border: 1px solid var(--border);
}
.ledger-cofounder-thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
}
.ledger-cofounder-thread-row {
  position: relative;
}
.ledger-cofounder-thread-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 10px 36px 10px 12px;
  cursor: pointer;
  font: inherit;
}
.ledger-cofounder-thread-delete {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.ledger-cofounder-thread-row:hover .ledger-cofounder-thread-delete,
.ledger-cofounder-thread-delete:focus-visible {
  opacity: 1;
}
.ledger-cofounder-thread-delete:hover {
  background: rgba(255, 90, 90, 0.16);
  color: #ff6b6b;
}
.ledger-cofounder-thread-item:hover {
  background: var(--panel-soft);
  border-color: var(--border);
}
.ledger-cofounder-thread-item.is-active {
  background: var(--panel-soft);
  border-color: var(--ledger, #2BE8A5);
}
.ledger-cofounder-thread-item b {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}
.ledger-cofounder-thread-item span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ledger-cofounder-main {
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 16px);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-width: 0;
}
.ledger-cofounder-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 52vh;
  padding-right: 4px;
}
.ledger-cofounder-bubble {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.ledger-cofounder-bubble--user {
  align-self: flex-end;
  background: rgba(43, 232, 165, 0.14);
  border: 1px solid rgba(43, 232, 165, 0.28);
}
.ledger-cofounder-bubble--assistant {
  align-self: flex-start;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}
.ledger-cofounder-bubble--assistant::before {
  content: "🤝 ";
}
.ledger-cofounder-proactive {
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-soft);
  border: 1px dashed var(--border);
}
.ledger-cofounder-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.ledger-cofounder-compose textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  max-height: 160px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.ledger-cofounder-error {
  margin: 0;
  font-size: 13px;
  color: #fca5a5;
}

@media (max-width: 900px) {
  .ledger-cofounder-layout {
    /* minmax(0, 1fr) — NOT bare 1fr — so the track can shrink below its
       content's max-content size. Bare 1fr (== minmax(auto,1fr)) let the
       nowrap thread subtitles expand the track past the viewport, pushing
       the button, badge, and chat bubbles off the right edge on mobile. */
    grid-template-columns: minmax(0, 1fr);
  }
  .ledger-cofounder-sidebar {
    max-height: 200px;
  }
}

/* ---- Ledger Assistant (customer bot owner panel) ---- */
.ledger-rail-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #04140f;
  background: #34e1ad;
}
.ledger-assistant-panel {
  margin-top: 4px;
  padding: 8px 2px 24px;
}
.ledger-assistant-status {
  margin: 0 0 12px;
  font-size: 13px;
  min-height: 1.2em;
}
.ledger-assistant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.ledger-assistant-card {
  padding: 18px 18px 16px;
  border-radius: 14px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--panel-soft, rgba(255,255,255,0.03));
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.ledger-assistant-card--wide {
  grid-column: 1 / -1;
}
.ledger-assistant-card h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.ledger-assistant-card .small {
  font-size: 12px;
  margin: 0;
}
.ledger-assistant-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #8aa399);
}
.ledger-assistant-card input[type="text"],
.ledger-assistant-card textarea,
.ledger-assistant-card select {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  background: rgba(0,0,0,0.25);
  color: inherit;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.ledger-assistant-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.ledger-assistant-preview {
  font-size: 12px;
  white-space: pre-wrap;
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(52, 225, 173, 0.06);
  border: 1px dashed rgba(52, 225, 173, 0.25);
}
.ledger-assistant-link-input {
  font-size: 12px !important;
  opacity: 0.9;
}
.ledger-assistant-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ledger-assistant-orders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ledger-assistant-subhead {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.ledger-assistant-payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.5rem 0 0.75rem;
}
.ledger-assistant-payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}
@media (max-width: 800px) {
  .ledger-assistant-payment-grid {
    grid-template-columns: 1fr;
  }
}
.ledger-assistant-order-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}
.ledger-assistant-order-badge--claim {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
}
.ledger-assistant-order-badge--await {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.ledger-assistant-order-badge--pending {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}
.ledger-assistant-order-badge--approved {
  background: rgba(52, 225, 173, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(52, 225, 173, 0.35);
}
.ledger-assistant-order-badge--packing {
  background: rgba(167, 139, 250, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.4);
}
.ledger-assistant-order-badge--shipped {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.ledger-assistant-order-badge--done {
  background: rgba(52, 225, 173, 0.12);
  color: #a7f3d0;
  border: 1px solid rgba(52, 225, 173, 0.28);
}
.ledger-assistant-order--claim {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12);
}
.ledger-assistant-order--packing {
  border-color: rgba(167, 139, 250, 0.4);
}
.ledger-assistant-order--shipped {
  border-color: rgba(56, 189, 248, 0.4);
}
.ledger-assistant-order {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ledger-assistant-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
}
.ledger-assistant-order-meta b {
  font-weight: 600;
}
.ledger-assistant-order-lines {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 13px;
  color: var(--muted, #8aa399);
}
.ledger-assistant-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ledger-assistant-order-actions .cta-danger {
  background: rgba(252, 165, 165, 0.15);
  color: #fecaca;
  border: 1px solid rgba(252, 165, 165, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.ledger-assistant-contacts,
.ledger-assistant-products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}
.ledger-assistant-contact,
.ledger-assistant-product {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.15);
  font-size: 13px;
}
.ledger-assistant-product img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}
.ledger-assistant-product-meta {
  flex: 1;
  min-width: 0;
}
.ledger-assistant-product-meta b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ledger-assistant-thumb-empty {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted, #8aa399);
}
@media (max-width: 800px) {
  .ledger-assistant-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ledger-assistant-card--wide {
    grid-column: auto;
  }
}

/* ---- Penjualan Kasir (cashier sales upload) ---- */
.ledger-kasir-panel { margin-top: 8px; padding: 24px 26px; }
.ledger-kasir-upload { margin-top: 16px; }
.ledger-kasir-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 30px 20px;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
  cursor: pointer;
  transition: border-color 0.16s var(--ease, ease), background 0.16s var(--ease, ease);
}
.ledger-kasir-dropzone:hover,
.ledger-kasir-dropzone.is-dragover {
  border-color: rgba(43, 232, 165, 0.5);
  background: rgba(43, 232, 165, 0.05);
}
.ledger-kasir-dropzone svg { width: 30px; height: 30px; color: var(--ledger, #2BE8A5); }
.ledger-kasir-dropzone strong { font-size: 15px; font-weight: 650; }
.ledger-kasir-dropzone span { font-size: 12px; }
.ledger-kasir-filename {
  margin: 12px 0 0;
  font-size: 13px;
  font-family: var(--mono, monospace);
  color: var(--ledger, #2BE8A5);
}
.ledger-kasir-preview { margin-top: 18px; }
.ledger-kasir-hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  font-size: 13px;
}
.ledger-kasir-hint.is-ready {
  border-color: rgba(43, 232, 165, 0.3);
  background: rgba(43, 232, 165, 0.08);
  color: var(--ledger, #2BE8A5);
}
.ledger-kasir-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}
.ledger-kasir-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}
.ledger-kasir-table th,
.ledger-kasir-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ledger-kasir-table th {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  background: var(--panel-soft);
}
.ledger-kasir-table tbody tr:last-child td { border-bottom: none; }
.ledger-kasir-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger-kasir-table .center { text-align: center; }
.ledger-kasir-table tr.is-excluded td { opacity: 0.42; }
.ledger-kasir-table tr.needs-mapping { background: rgba(245, 158, 11, 0.06); }
.ledger-kasir-product { font-weight: 600; }
.ledger-kasir-map-select {
  width: 100%;
  min-width: 150px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 12px;
}
.ledger-kasir-map-select.needs-mapping { border-color: rgba(245, 158, 11, 0.55); }
.ledger-kasir-include { width: 17px; height: 17px; accent-color: var(--ledger, #2BE8A5); cursor: pointer; }
.ledger-kasir-confirm { margin-top: 16px; }
.ledger-kasir-draft-summary {
  white-space: pre-wrap;
  font-family: var(--mono, monospace);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--ledger, #2BE8A5);
  border-radius: 10px;
  background: var(--panel-soft);
  margin: 0 0 14px;
  overflow-x: auto;
}
#ledgerKasirDone { margin-top: 14px; font-size: 14px; }

/* ---- Kasir POS (direct input) ---- */
.ledger-kasir-mode-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 14px 0 18px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}
.ledger-kasir-mode-tab {
  min-height: 44px;
  padding: 10px 18px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s var(--ease, ease), color 0.16s var(--ease, ease);
}
.ledger-kasir-mode-tab:hover { color: var(--text); }
.ledger-kasir-mode-tab.is-active {
  background: rgba(52, 225, 173, 0.14);
  color: var(--ledger, #34e1ad);
  box-shadow: inset 0 0 0 1px rgba(52, 225, 173, 0.28);
}
.ledger-kasir-mode-tab:focus-visible {
  outline: 2px solid var(--ledger, #34e1ad);
  outline-offset: 2px;
}

.ledger-pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
}
.ledger-pos-search-wrap { display: block; margin-bottom: 12px; }
.ledger-pos-search {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
}
.ledger-pos-search:focus {
  outline: none;
  border-color: rgba(52, 225, 173, 0.55);
  box-shadow: 0 0 0 3px rgba(52, 225, 173, 0.12);
}
.ledger-pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding-right: 4px;
}
.ledger-pos-product-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 108px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s var(--ease, ease), transform 0.12s var(--ease, ease);
}
.ledger-pos-product-card:hover:not(:disabled) {
  border-color: rgba(52, 225, 173, 0.45);
  transform: translateY(-1px);
}
.ledger-pos-product-card:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.ledger-pos-product-card:focus-visible {
  outline: 2px solid var(--ledger, #34e1ad);
  outline-offset: 2px;
}
.ledger-pos-product-name {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text);
}
.ledger-pos-product-price {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ledger, #34e1ad);
}
.ledger-pos-product-stock {
  font-size: 11px;
  color: var(--muted);
}
.ledger-pos-product-stock.is-low { color: #fbbf24; }
.ledger-pos-product-stock.is-out { color: #ff9e8a; }

.ledger-pos-cart {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}
.ledger-pos-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.ledger-pos-cart-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ledger-pos-cart-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.ledger-pos-cart-close {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ledger-pos-cart-close:focus-visible {
  outline: 2px solid var(--ledger, #34e1ad);
  outline-offset: 2px;
}
.ledger-pos-cart-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  /* Below sheet (1220) and mobile bar (1230); above page chrome. */
  z-index: 1210;
  background: rgba(0, 0, 0, 0.52);
  /* Do NOT set touch-action:none — on Android it blocks click synthesis
     on the sheet/bar when the body also locks scrolling. */
}
.ledger-pos-mobile-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  /* Always above the cart sheet so Keranjang / Bayar stay tappable. */
  z-index: 1230;
  align-items: center;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-soft) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28);
  touch-action: manipulation;
}
.ledger-pos-mobile-cart-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 72px;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.ledger-pos-mobile-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ledger, #34e1ad);
  color: #0b1412;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ledger-pos-mobile-badge.is-empty {
  background: var(--border);
  color: var(--muted);
}
.ledger-pos-mobile-total-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ledger-pos-mobile-total-wrap .muted {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ledger-pos-mobile-total {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #4de3ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ledger-pos-mobile-checkout {
  flex-shrink: 0;
  min-height: 48px;
  min-width: 96px;
  padding-inline: 16px;
  touch-action: manipulation;
}
.ledger-pos-history-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  flex-direction: column;
  gap: 10px;
}
.ledger-pos-history-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}
.ledger-pos-history-card.is-voided {
  opacity: 0.5;
}
.ledger-pos-history-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.ledger-pos-history-card-head strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.ledger-pos-history-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.ledger-pos-history-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ledger-pos-history-card-actions .ledger-pos-action-btn {
  flex: 1;
  min-width: calc(50% - 4px);
  min-height: 44px;
  font-size: 12px;
}
.ledger-pos-clear {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  min-height: 44px;
  padding: 4px 8px;
  transition: color 140ms ease;
}
.ledger-pos-clear:hover,
.ledger-pos-clear:focus-visible {
  outline: none;
  color: #ff9e8a;
}
.ledger-pos-cart-lines {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}
.ledger-pos-cart-line {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.ledger-pos-cart-line-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ledger-pos-cart-line-info {
  min-width: 0;
}
.ledger-pos-cart-line-discount {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ledger-pos-discount-tag {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger-pos-discount-type,
.ledger-pos-discount-input {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.ledger-pos-discount-type {
  flex: 0 0 auto;
  width: 62px;
  padding: 6px 24px 6px 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4' fill='none' stroke='%238b98a5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px;
}
.ledger-pos-discount-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font-variant-numeric: tabular-nums;
}
.ledger-pos-discount-input::-webkit-outer-spin-button,
.ledger-pos-discount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ledger-pos-discount-input {
  -moz-appearance: textfield;
}
.ledger-pos-discount-type:focus-visible,
.ledger-pos-discount-input:focus-visible {
  outline: none;
  border-color: rgba(52, 225, 173, 0.6);
  box-shadow: 0 0 0 3px rgba(52, 225, 173, 0.14);
}
.ledger-pos-customer-block {
  margin-top: 10px;
  margin-bottom: 12px;
}
.ledger-pos-customer-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.ledger-pos-customer-toggle:hover,
.ledger-pos-customer-toggle:focus-visible {
  outline: none;
  border-color: rgba(52, 225, 173, 0.4);
}
.ledger-pos-customer-toggle-label {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.ledger-pos-customer-toggle-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--ledger, #34e1ad);
}
.ledger-pos-customer-toggle-chevron {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  transition: transform 160ms ease;
}
.ledger-pos-customer-toggle[aria-expanded="true"] .ledger-pos-customer-toggle-chevron {
  transform: rotate(180deg);
}
.ledger-pos-customer-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.ledger-pos-customer-row {
  display: flex;
  gap: 6px;
}
.ledger-pos-customer-search {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 13px;
}
.ledger-pos-customer-add-btn {
  flex-shrink: 0;
  width: 40px;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--ledger, #34e1ad);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.ledger-pos-customer-suggestions {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  max-height: 160px;
  overflow-y: auto;
}
.ledger-pos-customer-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}
.ledger-pos-customer-suggestion:last-child { border-bottom: none; }
.ledger-pos-customer-suggestion:hover,
.ledger-pos-customer-suggestion:focus-visible {
  background: rgba(52, 225, 173, 0.08);
}
.ledger-pos-customer-suggestion-meta {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.ledger-pos-customer-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(52, 225, 173, 0.35);
  background: rgba(52, 225, 173, 0.08);
  font-size: 13px;
  font-weight: 600;
}
.ledger-pos-customer-clear {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  min-height: 36px;
  padding: 4px 8px;
}
.ledger-pos-customer-quickadd {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ledger-pos-customer-quick-input {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 13px;
}
.ledger-pos-customer-search,
.ledger-pos-customer-add-btn,
.ledger-pos-customer-quick-input {
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}
.ledger-pos-customer-search:focus-visible,
.ledger-pos-customer-quick-input:focus-visible {
  outline: none;
  border-color: rgba(52, 225, 173, 0.55);
  box-shadow: 0 0 0 3px rgba(52, 225, 173, 0.12);
}
.ledger-pos-customer-add-btn:hover,
.ledger-pos-customer-add-btn:focus-visible {
  outline: none;
  border-color: rgba(52, 225, 173, 0.5);
  background: rgba(52, 225, 173, 0.1);
  box-shadow: 0 0 0 3px rgba(52, 225, 173, 0.12);
}
.ledger-pos-customer-add-btn:active { transform: scale(0.94); }
.ledger-pos-customer-clear {
  transition: color 140ms ease;
}
.ledger-pos-customer-clear:hover,
.ledger-pos-customer-clear:focus-visible {
  outline: none;
  color: var(--text);
}
.ledger-pos-customer-quick-actions {
  display: flex;
  gap: 8px;
}
.ledger-pos-customer-quick-actions .cta-primary,
.ledger-pos-customer-quick-actions .cta-secondary {
  flex: 1;
  min-height: 40px;
}
.ledger-pos-pricing-block {
  margin-bottom: 12px;
}
.ledger-pos-pricing-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.ledger-pos-discount-row {
  display: flex;
  gap: 6px;
}
.ledger-pos-tax-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.ledger-pos-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.ledger-pos-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--ledger, #34e1ad);
}
.ledger-pos-toggle {
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.ledger-pos-toggle:hover {
  border-color: rgba(52, 225, 173, 0.4);
}
.ledger-pos-toggle:focus-within {
  border-color: rgba(52, 225, 173, 0.5);
  box-shadow: 0 0 0 3px rgba(52, 225, 173, 0.12);
}
.ledger-pos-toggle:has(input:checked) {
  border-color: rgba(52, 225, 173, 0.5);
  background: rgba(52, 225, 173, 0.1);
  color: var(--ledger, #34e1ad);
}
.ledger-pos-breakdown {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}
.ledger-pos-breakdown-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  padding: 3px 0;
  font-variant-numeric: tabular-nums;
}
.ledger-pos-breakdown-line.is-discount span:last-child {
  color: #ff9e8a;
}
.ledger-pos-cart-line:last-child { border-bottom: none; }
.ledger-pos-cart-line-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.ledger-pos-cart-line-meta {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ledger-pos-qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ledger-pos-qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.ledger-pos-qty-btn {
  transition: border-color 140ms ease, background 140ms ease, transform 80ms ease;
}
.ledger-pos-qty-btn:hover:not(:disabled) {
  border-color: rgba(52, 225, 173, 0.5);
  color: var(--ledger, #34e1ad);
}
.ledger-pos-qty-btn:active:not(:disabled) { transform: scale(0.92); }
.ledger-pos-qty-btn:focus-visible {
  outline: none;
  border-color: rgba(52, 225, 173, 0.6);
  box-shadow: 0 0 0 3px rgba(52, 225, 173, 0.14);
}
.ledger-pos-qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ledger-pos-qty-value {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ledger-pos-cart-empty { margin: 0 0 12px; font-size: 13px; }
.ledger-pos-payment {
  margin: 0 0 12px;
  padding: 0;
  border: none;
}
.ledger-pos-payment legend {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.ledger-pos-pay-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ledger-pos-pay-pill {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ledger-pos-pay-pill {
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 80ms ease;
}
.ledger-pos-pay-pill:hover:not(.is-active) {
  border-color: rgba(52, 225, 173, 0.4);
  color: var(--text);
}
.ledger-pos-pay-pill:active { transform: scale(0.96); }
.ledger-pos-pay-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 225, 173, 0.14);
}
.ledger-pos-pay-pill.is-active {
  border-color: rgba(52, 225, 173, 0.5);
  background: rgba(52, 225, 173, 0.12);
  color: var(--ledger, #34e1ad);
}
.ledger-pos-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-top: 4px;
}
.ledger-pos-total-row span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.ledger-pos-total {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #4de3ff;
}
.ledger-pos-checkout { width: 100%; min-height: 48px; }
.ledger-pos-success {
  margin: 16px 0;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(52, 225, 173, 0.35);
  background: rgba(52, 225, 173, 0.08);
}
.ledger-pos-success-title {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--ledger, #34e1ad);
}
.ledger-pos-success-detail {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text);
}
.ledger-pos-history {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.ledger-pos-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.ledger-pos-history-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.ledger-pos-history-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ledger-pos-history-preset {
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ledger-pos-history-preset.is-active {
  color: var(--text);
  border-color: rgba(52, 225, 173, 0.45);
  background: rgba(52, 225, 173, 0.1);
}
.ledger-pos-history-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}
.ledger-pos-history-date-wrap input[type="date"] {
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 12px;
}
.ledger-pos-history-table { min-width: 640px; }
.ledger-pos-history-table tr.is-voided td { opacity: 0.45; text-decoration: line-through; }
.ledger-pos-action-btn {
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}
.ledger-pos-action-btn.danger { color: #ff9e8a; border-color: rgba(255, 158, 138, 0.35); }

/* ---- Kasir settings modal (tax/discount configuration) ---- */
.ledger-pos-settings-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ledger-pos-settings-btn:hover {
  background: rgba(52, 225, 173, 0.12);
  border-color: rgba(52, 225, 173, 0.4);
}
.ledger-pos-settings-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 225, 173, 0.35);
}
.ledger-pos-settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 15, 0.62);
  z-index: 60;
}
.ledger-pos-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 61;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
/* The `hidden` attribute is toggled from JS to show/hide these, but an author
   `display` rule (flex) overrides `hidden`, so without these guards the element
   never hides: the discount/summary rows stay stuck, the selected-customer
   chrome can't be dismissed, and the quick-add form lingers. A `.class[hidden]`
   selector outranks the bare `.class`, restoring the attribute's effect. */
.ledger-pos-settings-backdrop[hidden],
.ledger-pos-settings-modal[hidden],
.ledger-pos-breakdown-line[hidden],
.ledger-pos-customer-selected[hidden],
.ledger-pos-customer-quickadd[hidden],
.ledger-pos-customer-body[hidden] {
  display: none;
}
.ledger-pos-settings-panel {
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #0f1720;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  padding: 20px;
}
.ledger-pos-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ledger-pos-settings-head h4 {
  margin: 0;
  font-size: 16px;
}
.ledger-pos-settings-close {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.ledger-pos-settings-close:hover { color: #ff9e8a; }
.ledger-pos-settings-group {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
}
.ledger-pos-settings-group legend {
  padding: 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}
.ledger-pos-settings-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  font-size: 13px;
}
.ledger-pos-settings-field input[type="number"] {
  width: 84px;
  text-align: right;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
}
.ledger-pos-settings-field input[type="number"]:focus-visible {
  outline: none;
  border-color: rgba(52, 225, 173, 0.5);
  box-shadow: 0 0 0 3px rgba(52, 225, 173, 0.25);
}
.ledger-pos-settings-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-size: 13px;
  cursor: pointer;
}
.ledger-pos-settings-status {
  margin: 4px 0 0;
  font-size: 12px;
}
.ledger-pos-settings-status.is-error { color: #ff9e8a; }
.ledger-pos-settings-status.is-success { color: #34e1ad; }
.ledger-pos-settings-body {
  display: flex;
  flex-direction: column;
}
.ledger-pos-settings-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .ledger-pos-layout { grid-template-columns: 1fr; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .ledger-pos-cart-sheet {
    position: static;
    max-height: none;
    transform: none;
    border-radius: 14px;
    box-shadow: none;
  }
}
@media (max-width: 720px) {
  .ledger-kasir-panel { padding: 18px 16px; }
  .ledger-kasir-mode-tabs { display: flex; width: 100%; }
  .ledger-kasir-mode-tab { flex: 1; text-align: center; padding-inline: 10px; }
  .ledger-pos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    gap: 8px;
  }
  .ledger-pos-product-card { min-height: 100px; padding: 14px 12px; }
  .ledger-pos-pay-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ledger-pos-pay-pill { width: 100%; min-height: 44px; justify-content: center; text-align: center; }
  .ledger-pos-qty-btn { width: 44px; height: 44px; }
}
@media (max-width: 640px) {
  #ledgerKasirSection.ledger-kasir-panel { padding: 14px 12px 0; }
  #ledgerKasirSection .ledger-dash-head p { font-size: 13px; line-height: 1.45; }
  .ledger-pos-panel { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .ledger-pos-layout { gap: 0; }
  .ledger-pos-products-col { min-width: 0; }
  .ledger-pos-search { font-size: 16px; min-height: 48px; padding: 12px 14px; }
  .ledger-pos-product-name { font-size: 14px; }
  .ledger-pos-product-price { font-size: 15px; }

  .ledger-pos-cart-backdrop.is-visible { display: block; }
  .ledger-pos-mobile-bar.is-visible { display: flex; }

  /*
   * Kasir glass (veridian .ledger-monthly-report backdrop-filter) creates a
   * containing block for position:fixed descendants — trapping the sheet/bar
   * inside the panel so they ghost over products and swallow taps. Always
   * strip filters/transforms on the Kasir section for mobile POS chrome.
   */
  #ledgerKasirSection.ledger-kasir-panel,
  #ledger-workspace #ledgerKasirSection {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none;
    transform: none;
    contain: none;
  }

  /*
   * Bottom-sheet cart: viewport-fixed, opaque, sits ABOVE the sticky
   * checkout bar (not covering it). Internal checkout is hidden — pay
   * via #ledgerPosMobileBar which must stay on top (z-index 1230).
   */
  .ledger-pos-cart-sheet {
    position: fixed;
    left: 0;
    right: 0;
    /* Leave room for the mobile checkout bar (~64px + safe area). */
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 1220;
    top: auto;
    width: 100%;
    max-width: 100vw;
    max-height: min(70vh, 560px);
    margin: 0;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    /* solid ink — never inherit semi-transparent --panel-soft */
    background: #0a1612;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
    transform: translate3d(0, 110%, 0);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 12px;
    /* Closed sheet must not intercept taps on the product grid. */
    pointer-events: none;
    touch-action: pan-y;
  }
  .ledger-pos-cart-sheet.is-open {
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
  }
  /* Defensive: every control inside an open sheet must receive taps. */
  .ledger-pos-cart-sheet.is-open button,
  .ledger-pos-cart-sheet.is-open input,
  .ledger-pos-cart-sheet.is-open select,
  .ledger-pos-cart-sheet.is-open label,
  .ledger-pos-cart-sheet.is-open a {
    pointer-events: auto;
    touch-action: manipulation;
  }
  .ledger-pos-cart-sheet .ledger-pos-cart-close { display: inline-flex; align-items: center; justify-content: center; }
  /* Keep in-sheet checkout visible on mobile — bar can still be used too.
     Hiding it previously left pay unreachable when the bar was covered. */
  .ledger-pos-cart-sheet .ledger-pos-checkout {
    display: flex;
    width: 100%;
    min-height: 48px;
    margin-top: 12px;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    pointer-events: auto;
  }
  .ledger-pos-cart-lines { max-height: min(32vh, 240px); }
  .ledger-pos-mobile-bar {
    /* match solid sheet so history never bleeds through the checkout bar */
    background: #0a1612;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 1230;
  }
  .ledger-pos-cart-backdrop.is-visible {
    z-index: 1210;
    pointer-events: auto;
  }

  .ledger-pos-history-table-wrap { display: none; }
  .ledger-pos-history-cards { display: flex; }
  .ledger-pos-history-head .cta-secondary { min-height: 44px; }
  .ledger-invoice-running-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/*
 * Portaled chrome (moved to document.body by ledger.js). Escape every
 * workspace stacking context with a high fixed z-index so hit-testing
 * matches what the user sees on Android WebView / Chrome.
 */
body > .ledger-pos-cart-backdrop.is-portaled,
body > .ledger-pos-cart-backdrop.is-visible {
  position: fixed !important;
  inset: 0 !important;
  z-index: 20000 !important;
  pointer-events: auto !important;
  background: rgba(0, 0, 0, 0.62) !important;
}
body > .ledger-pos-cart-sheet.is-portaled {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  top: auto !important;
  z-index: 20010 !important;
  width: 100% !important;
  max-width: 100vw !important;
  max-height: min(70vh, 560px) !important;
  background: #0a1612 !important;
  pointer-events: none; /* closed default; .is-open flips this */
  touch-action: pan-y;
}
body > .ledger-pos-cart-sheet.is-portaled.is-open {
  pointer-events: auto !important;
  transform: translate3d(0, 0, 0) !important;
}
body > .ledger-pos-cart-sheet.is-portaled.is-open button,
body > .ledger-pos-cart-sheet.is-portaled.is-open input,
body > .ledger-pos-cart-sheet.is-portaled.is-open select,
body > .ledger-pos-cart-sheet.is-portaled.is-open label,
body > .ledger-pos-cart-sheet.is-portaled.is-open a,
body > .ledger-pos-cart-sheet.is-portaled.is-open fieldset {
  pointer-events: auto !important;
  touch-action: manipulation;
}
body > .ledger-pos-mobile-bar.is-portaled {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 20020 !important;
  pointer-events: auto !important;
  touch-action: manipulation;
  background: #0a1612 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body > .ledger-pos-mobile-bar.is-portaled.is-visible {
  display: flex !important;
}

/*
 * Lock background scroll while the keranjang sheet is open.
 * Do NOT set touch-action:none on body — the effective touch-action is the
 * intersection of the element and all ancestors, so body:none kills pan/click
 * synthesis inside the sheet and mobile bar on Android Chrome/WebView.
 */
body.ledger-pos-sheet-open {
  overflow: hidden;
  overscroll-behavior: none;
}
body.ledger-pos-sheet-open #ledgerKasirSection .ledger-pos-products-col,
body.ledger-pos-sheet-open #ledgerKasirSection .ledger-pos-history {
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .ledger-pos-product-card:hover:not(:disabled) { transform: none; }
  .ledger-pos-cart-sheet { transition: none; }
}
