* {
  box-sizing: border-box;
}

:root {
  --primary: #4968f5;
  --primary-soft: #eef2ff;
  --text: #182235;
  --text-strong: #0f1829;
  --muted: #718096;
  --line: #e4e8ef;
  --bg: #f7f9fc;
  --card: #fff;
  --panel-alt: #f8fafc;
  --border: #e4e8ef;
  --success: #21b573;
  --danger: #e05252;
  /* Dua tingkat bayangan: kartu utama lebih menonjol dari kartu pendukung */
  --shadow: 0 5px 18px rgba(30, 45, 80, 0.06);
  --shadow-flat: 0 1px 2px rgba(30, 45, 80, 0.04);
}

/* Modul akuntansi */
.accounting-content { display: grid; gap: 22px; }
.accounting-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.accounting-stat-card { padding: 22px; }
.accounting-stat-card span,
.accounting-stat-card small { display: block; color: var(--muted); font-size: 13px; }
.accounting-stat-card strong { display: block; margin: 8px 0 6px; color: var(--text-strong); font-size: 27px; font-variant-numeric: tabular-nums; }
.accounting-tabs { display: inline-flex; align-self: start; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-alt); box-shadow: var(--shadow-flat); }
.accounting-tabs button { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 0 13px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease; }
.accounting-tabs button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.accounting-tabs button:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); color: var(--primary); }
.accounting-tabs button.active { border-color: color-mix(in srgb, var(--primary) 38%, var(--line)); background: var(--primary); color: #fff; box-shadow: 0 5px 12px rgba(73, 104, 245, .26); }
@media (max-width: 700px) { .accounting-tabs { max-width: 100%; overflow-x: auto; } .accounting-tabs button { flex: 0 0 auto; } }
.accounting-panel { min-width: 0; }
.accounting-report-card { max-width: 1100px; padding: 26px; }
.profit-report { display: grid; gap: 18px; }
.profit-overview { display: grid; grid-template-columns: 1.55fr 1fr 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-alt); }
.profit-overview > div { min-height: 112px; padding: 18px 20px; display: grid; align-content: center; gap: 5px; border-left: 1px solid var(--line); }
.profit-overview > div:first-child { border-left: 0; }
.profit-overview span, .profit-result-card span { color: var(--muted); font-size: 12px; }
.profit-overview strong, .profit-result-card strong, .profit-section-total strong { color: var(--text-strong); font-size: 20px; font-variant-numeric: tabular-nums; }
.profit-overview small, .profit-result-card small { color: var(--muted); font-size: 12px; }
.profit-overview-main, .profit-result-card .profit-result-net { background: linear-gradient(135deg, rgba(73, 105, 247, .16), rgba(73, 105, 247, .04)); }
.profit-overview-main strong { color: var(--primary); font-size: 29px; }
.profit-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.profit-section, .profit-result-card { min-height: 188px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-alt); overflow: hidden; }
.profit-section-header { padding: 15px 17px 13px; display: grid; gap: 4px; border-bottom: 1px solid var(--line); }
.profit-section-header span { color: var(--text-strong); font-size: 14px; font-weight: 700; }
.profit-section-header small { color: var(--muted); font-size: 12px; }
.profit-section-body { min-height: 68px; padding: 8px 17px; }
.profit-row.detail { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0; color: var(--muted); font-size: 13px; }
.profit-row.detail strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.profit-empty { padding: 12px 0; color: var(--muted); font-size: 12px; font-style: italic; }
.profit-section-total { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 17px; border-top: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 650; }
.profit-section-total strong { font-size: 15px; }
.profit-result-card { display: grid; grid-template-columns: 1fr 1fr; }
.profit-result-card > div { padding: 19px; display: grid; align-content: center; gap: 6px; }
.profit-result-card > div + div { border-left: 1px solid var(--line); }
.profit-result-net strong { color: var(--primary); font-size: 23px; }
@media (max-width: 760px) { .profit-overview, .profit-section-grid { grid-template-columns: 1fr; } .profit-overview > div, .profit-result-card > div + div { border-left: 0; border-top: 1px solid var(--line); } .profit-overview > div:first-child { border-top: 0; } }
.accounting-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.accounting-table th { padding: 12px 14px; background: #f5f7fb; color: var(--muted); font-size: 12px; text-align: left; white-space: nowrap; }
.accounting-table td { padding: 12px 14px; border-top: 1px solid var(--line); color: var(--text); font-size: 13px; }
.accounting-table td:nth-last-child(-n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.journal-entry-start td { border-top-width: 2px; }
.accounting-account-grid { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(0, 1.55fr); gap: 20px; }
.account-form { display: grid; gap: 14px; }
.account-form label { display: grid; gap: 7px; color: var(--text); font-size: 13px; font-weight: 650; }
.account-form input, .account-form select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: var(--card); color: var(--text); font: inherit; }
.simple-journal-card { max-width: 940px; padding: 24px; }
.simple-journal-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; }
.simple-journal-form label { display: grid; gap: 7px; color: var(--text); font-size: 13px; font-weight: 650; }
.simple-journal-form input, .simple-journal-form select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: var(--card); color: var(--text); font: inherit; }
.simple-journal-description { grid-column: span 2; }
.simple-journal-account { grid-column: span 2; }
.account-smart-select .smart-select-value.has-account,
.account-picker-option { display: grid; grid-template-columns: 154px 12px minmax(0, 1fr) auto; align-items: center; justify-content: start; gap: 6px; }
.account-picker-code { text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 400; }
.account-picker-separator { text-align: center; color: var(--muted); }
.account-picker-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.account-smart-select .smart-select-value:not(.has-account) { display: block; }
.account-smart-select button.account-picker-option { width: 100%; border: 0; background: transparent; text-align: left; font: inherit; }
.account-smart-select .smart-select-trigger,
.account-smart-select .smart-select-option,
.account-smart-select .smart-select-option.selected,
.simple-direction-select .smart-select-trigger,
.simple-direction-select .smart-select-option,
.simple-direction-select .smart-select-option.selected { font-weight: 400; }
.simple-direction-select .smart-select-value { display: block; text-align: left; }
.simple-direction-select button.smart-select-option { width: 100%; border: 0; background: transparent; text-align: left; color: inherit; font: inherit; }
.simple-direction-select button.smart-select-option.selected { background: #2e4381; color: #fff; }
.account-smart-select .smart-select-trigger,
.account-smart-select .smart-select-value,
.account-smart-select .account-picker-option,
.account-smart-select .account-picker-code,
.account-smart-select .account-picker-name,
.simple-direction-select .smart-select-trigger,
.simple-direction-select .smart-select-value,
.simple-direction-select .smart-select-option { font-weight: 400 !important; }
.account-smart-select .smart-select-trigger,
.account-smart-select .smart-select-value,
.account-smart-select .account-picker-option,
.account-smart-select .account-picker-code,
.account-smart-select .account-picker-name,
.simple-direction-select .smart-select-trigger,
.simple-direction-select .smart-select-value,
.simple-direction-select .smart-select-option { font-weight: 400 !important; }
.simple-journal-preview { grid-column: span 3; min-height: 42px; display: flex; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-alt); color: var(--muted); font-size: 13px; }
.simple-journal-preview strong { color: var(--text-strong); }
@media (max-width: 760px) { .simple-journal-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } .simple-journal-description, .simple-journal-account, .simple-journal-preview { grid-column: span 2; } }
.opening-balance-card { max-width: 1040px; padding: 24px; }
.opening-balance-form { display: grid; gap: 14px; }
.opening-balance-meta { display: grid; grid-template-columns: minmax(180px, .55fr) minmax(280px, 1fr); gap: 14px; }
.opening-balance-meta label { display: grid; gap: 7px; color: var(--text); font-size: 13px; font-weight: 650; }
.opening-balance-meta input, .opening-balance-line select, .opening-balance-line input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: var(--card); color: var(--text); font: inherit; }
.opening-balance-help { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-alt); color: var(--muted); font-size: 13px; }
.opening-capital-quick { display: grid; grid-template-columns: minmax(220px, 1.3fr) minmax(180px, .75fr) minmax(250px, 1fr) auto; align-items: end; gap: 12px; padding: 16px; border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--primary) 7%, var(--panel-alt)); }
.opening-capital-quick h3 { margin: 0 0 5px; color: var(--text-strong); font-size: 15px; }
.opening-capital-quick p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.opening-capital-quick label { display: grid; gap: 7px; color: var(--text); font-size: 13px; font-weight: 650; }
.opening-capital-quick input { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--text); font: inherit; }
.opening-capital-preview { align-self: center; padding: 9px 11px; border-radius: 8px; background: var(--card); color: var(--muted); font-size: 12px; line-height: 1.45; }
.opening-capital-preview strong { color: var(--text-strong); }
.opening-balance-advanced { display: grid; gap: 14px; }
.opening-balance-advanced summary { color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 650; }
.opening-balance-advanced[open] summary { color: var(--primary); }
.opening-balance-guide { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-alt); }
.opening-balance-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.opening-balance-group { display: grid; gap: 4px; min-height: 72px; padding: 11px 12px; text-align: left; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; background: var(--card); cursor: pointer; font: inherit; }
.opening-balance-group strong { color: var(--text); font-size: 13px; }
.opening-balance-group small { font-size: 11px; line-height: 1.35; }
.opening-balance-group:hover, .opening-balance-group.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 11%, var(--card)); }
.opening-balance-group.active strong { color: var(--primary); }
.opening-balance-guide-bottom { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.opening-balance-guide-bottom > div { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
.opening-balance-guide-bottom strong { color: var(--text); font-size: 13px; }
.opening-balance-search { width: min(320px, 100%); }
.opening-balance-search input { width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--text); font: inherit; }
.opening-balance-quick { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 12px; }
.opening-balance-quick button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--text); cursor: pointer; font: inherit; font-size: 12px; }
.opening-balance-quick button:hover { border-color: var(--primary); color: var(--primary); }
.opening-balance-lines { display: grid; gap: 8px; }
.opening-balance-line { display: grid; grid-template-columns: minmax(260px, 1.6fr) 100px minmax(140px, .7fr) 40px; gap: 10px; align-items: center; }
.opening-balance-direction { color: var(--muted); font-size: 13px; font-weight: 700; text-align: center; }
.opening-balance-line .btn-icon { width: 40px; height: 40px; padding: 0; }
.opening-balance-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.opening-balance-total { margin-left: auto; color: var(--text-strong); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.opening-balance-total.is-balanced { color: var(--success); }
@media (max-width: 760px) { .opening-balance-meta, .opening-balance-groups { grid-template-columns: 1fr; } .opening-balance-guide-bottom { align-items: stretch; flex-direction: column; } .opening-balance-search { width: 100%; } .opening-balance-line { grid-template-columns: 1fr 90px; } .opening-balance-line input { grid-column: 1; } .opening-balance-line .btn-icon { grid-column: 2; grid-row: 2; } .opening-balance-actions { align-items: stretch; } .opening-balance-total { margin-left: 0; width: 100%; } }
.account-status { display: inline-flex; padding: 4px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.account-status.active { background: #e5f8ee; color: #168453; }
.account-status.inactive { background: #f1f3f7; color: #6b7280; }

/* Halaman Buat Tagihan */
.card.invoice-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  margin-bottom: 24px;
  background: linear-gradient(120deg, #4968f5, #6782ff);
  color: #fff;
}

.invoice-summary-label,
.invoice-store-total span {
  display: block;
  font-size: 13px;
}

.invoice-summary-card strong {
  display: block;
  margin-top: 5px;
  font-size: 28px;
}

.invoice-summary-card p {
  margin: 0;
  color: rgba(255, 255, 255, .84);
}

.invoice-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 14px;
}

.invoice-intro h2 {
  margin: 0 0 5px;
  font-size: 18px;
}

.invoice-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.invoice-store-list {
  display: grid;
  gap: 12px;
}

.invoice-store-card {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.invoice-store-card:hover,
.invoice-store-card:focus-visible {
  border-color: #bdc9ff;
  box-shadow: 0 8px 22px rgba(54, 79, 180, .11);
  outline: none;
  transform: translateY(-2px);
}

.invoice-store-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.invoice-store-info {
  min-width: 0;
  flex: 1;
}

.invoice-store-info h3 {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-size: 15px;
}

.invoice-store-info p,
.invoice-store-total {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.invoice-store-total {
  text-align: right;
}

.invoice-store-total strong {
  display: block;
  margin-top: 4px;
  color: var(--text-strong);
  font-size: 17px;
}

.invoice-detail-overlay {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 24, 41, .48);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.invoice-detail-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.invoice-detail-modal {
  width: min(1120px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 26px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(8, 17, 35, .26);
  transform: translateY(12px);
  transition: transform .18s ease;
}

body.invoice-modal-open {
  overflow: hidden;
}

.invoice-detail-overlay.show .invoice-detail-modal {
  transform: translateY(0);
}

.invoice-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.invoice-detail-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.invoice-detail-header h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 23px;
}

.invoice-detail-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.invoice-detail-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: #f0f3f8;
  color: var(--text);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.invoice-detail-total {
  margin: 22px 0;
  padding: 15px 18px;
  border: 1px solid #dfe5ff;
  border-radius: 11px;
  background: #f4f6ff;
}

.invoice-detail-total span,
.invoice-detail-total small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.invoice-detail-total strong {
  display: block;
  margin: 4px 0;
  color: var(--primary);
  font-size: 25px;
}

.invoice-receivable-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
  padding: 15px 18px;
  border: 1px solid #dfe5ff;
  border-radius: 12px;
  background: #f8f9ff;
}
.invoice-receivable-eyebrow,
.invoice-receivable-box small { display: block; color: var(--muted); font-size: 12px; }
.invoice-receivable-box strong { display: block; margin: 3px 0; color: var(--text-strong); font-size: 18px; }
.invoice-receivable-note { margin: 0; color: var(--muted); font-size: 13px; }
.invoice-receivable-done { color: var(--success); font-size: 13px; font-weight: 700; }
.invoice-receivable-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.invoice-receivable-box.selection-mode { display: block; }
.invoice-selection-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.invoice-selection-header p { max-width: 380px; }
.invoice-selection-list { display: grid; gap: 8px; }
.invoice-selection-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.invoice-selection-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.invoice-selection-item input { width: 18px; height: 18px; accent-color: var(--primary); }
.invoice-selection-item span { min-width: 0; }
.invoice-selection-item strong, .invoice-selection-item small { display: block; }
.invoice-selection-item small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.invoice-selection-item b { color: var(--text-strong); white-space: nowrap; }
.invoice-selection-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.invoice-cancel-form { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.invoice-cancel-form input { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; font-size: 13px; }
.invoice-cancel-form input[type="text"] { width: 220px; }
.btn.danger { border-color: #d83d53; background: #d83d53; color: #fff; }
.btn.danger:hover { border-color: #be2940; background: #be2940; }
.invoice-payment-form { display: grid; grid-template-columns: 130px minmax(160px, 1fr) minmax(180px, 1fr) minmax(150px, 1fr) auto; gap: 8px; width: min(100%, 800px); }
.invoice-payment-form input,
.invoice-payment-form select { min-width: 0; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; font-size: 13px; }
.invoice-payment-form .payment-method-select { min-width: 0; }
.invoice-payment-form .payment-method-select .smart-select-trigger { height: 40px; border-color: var(--line); border-radius: 8px; background: var(--card); color: var(--text); font-size: 13px; }
.invoice-payment-form .payment-method-select .smart-select-menu { min-width: 180px; }
.invoice-payment-form button.smart-select-option { width: 100%; border: 0; background: transparent; text-align: left; font: inherit; }

@media (max-width: 900px) {
  .invoice-receivable-box { align-items: stretch; flex-direction: column; }
  .invoice-receivable-actions, .invoice-cancel-form { align-items: stretch; justify-content: stretch; }
  .invoice-payment-form { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .invoice-selection-header { flex-direction: column; gap: 6px; }
}

@media (max-width: 560px) {
  .invoice-payment-form { grid-template-columns: 1fr; }
}

.invoice-detail-tables {
  display: grid;
  gap: 20px;
}

.invoice-detail-section {
  min-width: 0;
}

.invoice-detail-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 9px;
}

.invoice-detail-section-title h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
}

.invoice-detail-section-title span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.invoice-detail-table-wrap {
  max-height: 360px;
}

.invoice-detail-table th {
  white-space: nowrap;
}

.invoice-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
}

.table-filter {
  width: 210px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid #d9dfe8;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.table-filter:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px #edf0ff;
}

@media (max-width: 640px) {
  .invoice-summary-card,
  .invoice-store-card {
    align-items: flex-start;
  }

  .invoice-summary-card {
    flex-direction: column;
  }

  .invoice-store-card {
    flex-wrap: wrap;
  }

  .invoice-store-total {
    width: 100%;
    padding-left: 50px;
    text-align: left;
  }

  .invoice-detail-overlay {
    padding: 12px;
  }

  .invoice-detail-modal {
    max-height: calc(100vh - 24px);
    padding: 20px;
  }

  .invoice-detail-actions {
    flex-direction: column-reverse;
  }

  .invoice-detail-actions .btn {
    width: 100%;
  }

  .table-filter {
    width: 100%;
  }

  .invoice-detail-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .invoice-detail-section-title span {
    text-align: left;
  }
}

body {
  margin: 0;
  font-family:
    "Inter",
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 300px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 28px 14px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  padding-bottom: 88px;
}

.theme-toggle {
  position: relative;
  width: 100%;
  margin-top: 22px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f7fb;
  color: #526078;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  box-shadow: var(--shadow-flat);
}

.theme-toggle:hover { background: #edf1f8; }
.theme-toggle-icon { font-size: 19px; line-height: 1; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 30px;
}

.brand-icon {
  width: 44px;
  height: 54px;
  overflow: visible;
  display: grid;
  place-items: center;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 7px 8px rgba(15, 23, 42, .24));
}

.brand-title {
  font-weight: 750;
  font-size: 16px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.menu-label {
  font-size: 12px;
  color: #8b97ab;
  font-weight: 600;
  margin: 18px 14px 8px;
}

.nav-item {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 10px;
  color: #526078;
  text-decoration: none;
  font-size: 14px;
  margin: 4px 0;
}

.nav-item .ikon {
  width: 21px;
  height: 21px;
  flex: none;
  opacity: 0.9;
}

.nav-item.active .ikon,
.nav-item.active-soft .ikon {
  opacity: 1;
}

.nav-item.active {
  background: #edf1ff;
  color: var(--primary);
  font-weight: 700;
  outline: 1px solid #cbd4ff;
}

.nav-item.active-soft {
  color: var(--primary);
  background: #f5f7ff;
}

.nav-item.disabled {
  color: #a3aebf;
  cursor: default;
  pointer-events: none;
}

.nav-item:not(.disabled):hover {
  background: #f5f7fb;
}

.main-content {
  margin-left: 300px;
  width: calc(100% - 300px);
}

.topbar {
  height: 92px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  font-size: 23px;
  margin: 0 0 5px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.data-status {
  font-size: 13px;
  color: #5d6a7f;
  background: #f5f7fb;
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 9px;
}

.data-status i {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 7px;
}

.data-status.offline {
  color: #a8354a;
  background: #fdf2f4;
  border-color: #f6d5db;
}

.data-status.offline i {
  background: var(--danger);
}

.content {
  padding: 28px 32px 50px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.form-card {
  padding: 28px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.card-header h2 {
  font-size: 18px;
  margin: 0 0 6px;
}

.card-header p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 19px 18px;
}

.field {
  min-width: 0;
}

.field-full {
  grid-column: 1/-1;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 8px;
  color: #3b475d;
}

.required {
  color: #e05252;
}

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid #d9dfe8;
  border-radius: 9px;
  background: #fff;
  color: #263248;
  padding: 0 13px;
  outline: none;
  transition: 0.15s;
}

input:focus,
select:focus {
  border-color: #8093ff;
  box-shadow: 0 0 0 3px #edf0ff;
}

input[readonly] {
  background: #f6f8fb;
  color: #536079;
}

select:disabled,
input:disabled {
  background: #f4f6f9;
  color: #9aa4b5;
  cursor: not-allowed;
}

small {
  display: block;
  color: #8a95a8;
  font-size: 11px;
  margin-top: 6px;
}

.input-with-suffix,
.input-with-prefix {
  position: relative;
}

.input-with-suffix input {
  padding-right: 45px;
}

.input-with-suffix span {
  position: absolute;
  right: 13px;
  top: 13px;
  font-size: 12px;
  color: #8b96a8;
}

.input-with-prefix span {
  position: absolute;
  left: 13px;
  top: 13px;
  color: #7d899c;
  font-size: 13px;
}

.input-with-prefix input {
  padding-left: 34px;
}

.calculation-box {
  margin-top: 25px;
  background: #f7f9ff;
  border: 1px solid #e1e6ff;
  border-radius: 13px;
  padding: 18px 20px;
}

.calculation-title {
  font-size: 12px;
  color: #66738b;
  font-weight: 650;
  margin-bottom: 8px;
}

.formula {
  font-size: 13px;
  color: #59667d;
  min-height: 20px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-top: 12px;
  padding-top: 13px;
  border-top: 1px solid #e1e6ff;
}

.total-label {
  display: block;
  font-size: 12px;
  color: #69758b;
  margin-bottom: 3px;
}

.total-row strong {
  font-size: 28px;
  letter-spacing: -0.5px;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.price-type {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: #e9edff;
  padding: 7px 10px;
  border-radius: 8px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.table-header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.table-header-actions select { height: 36px; max-width: 180px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; color: var(--text); background: #fff; }
#deletePackagingStore, #deletePackagingStoreBtn { display: none; }

/* Unggah file import: tetap memakai input asli agar stabil, dengan tampilan selaras UI. */
#packagingFile,
#stockFile {
  width: 100%;
  min-height: 48px;
  padding: 6px 8px 6px 6px;
  border: 1px dashed #b9c5ee;
  border-radius: 10px;
  background: #f8f9ff;
  color: #62708a;
  cursor: pointer;
  transition: .18s ease;
}

#packagingFile:hover,
#packagingFile:focus,
#stockFile:hover,
#stockFile:focus {
  border-color: var(--primary);
  background: #f1f4ff;
  box-shadow: 0 0 0 3px #edf0ff;
  outline: 0;
}

#packagingFile::file-selector-button,
#stockFile::file-selector-button {
  height: 34px;
  margin-right: 12px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: background .18s ease;
}

#packagingFile:hover::file-selector-button,
#stockFile:hover::file-selector-button { background: #3e5aed; }

.btn {
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 650;
  font-size: 13px;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  filter: brightness(0.96);
}

.btn.secondary {
  background: #f1f3f7;
  color: #566277;
  border: 1px solid #e0e4eb;
}

.btn.small {
  height: 36px;
  padding: 0 12px;
}

.info-card {
  padding: 23px;
  position: sticky;
  top: 20px;
}

.info-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #eef2ff;
  color: var(--primary);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.info-icon svg {
  width: 19px;
  height: 19px;
}

.info-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.info-card ol {
  padding-left: 20px;
  margin: 0;
  color: #647188;
  font-size: 13px;
  line-height: 1.8;
}

.info-card strong {
  color: #34415a;
}

.mini-note {
  margin-top: 22px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mini-note span {
  display: block;
  color: #8a95a8;
  font-size: 11px;
  margin-bottom: 5px;
}

.mini-note strong {
  display: block;
  font-size: 16px;
}

.mini-note small {
  line-height: 1.5;
}

.table-card {
  margin-top: 20px;
  padding: 24px;
}

.table-header {
  margin-bottom: 16px;
  align-items: center;
}

.table-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

th {
  background: #f8f9fb;
  color: #69758b;
  font-weight: 700;
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
}

td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf0f4;
  color: #3e4a5e;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fafbfe;
}

/* Kolom angka (L, P, Satuan, Total) rata kanan supaya digit
   sejajar dan mudah dibandingkan antar baris. */
th:nth-child(5),
th:nth-child(6),
th:nth-child(7),
th:nth-child(8),
td:nth-child(5),
td:nth-child(6),
td:nth-child(7),
td:nth-child(8) {
  text-align: right;
}

tbody td:nth-child(8) {
  font-weight: 700;
  color: var(--text-strong);
}

th:nth-child(9),
tbody td:nth-child(9) {
  text-align: center;
}

.empty-row td {
  text-align: center;
  color: #99a2b1;
  padding: 34px 25px;
  line-height: 1.7;
}

.empty-row td strong {
  display: block;
  color: #6b7789;
  font-weight: 650;
  margin-bottom: 2px;
}

@media (max-width: 1050px) {
  .sidebar {
    width: 230px;
  }

  .main-content {
    margin-left: 230px;
    width: calc(100% - 230px);
  }

  .page-grid {
    grid-template-columns: 1fr;
  }

  .info-card {
    position: static;
  }
}

@media (max-width: 720px) {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .topbar {
    padding: 18px;
  }

  .content {
    padding: 18px;
  }

  .form-card,
  .table-card {
    padding: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-full {
    grid-column: auto;
  }

  .topbar-actions {
    display: none;
  }
}

/* =========================
   MODAL SUKSES
   ========================= */
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 27, 45, 0.38);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease;
}

.success-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.success-modal {
  width: min(430px, 100%);
  position: relative;
  background: #fff;
  border: 1px solid rgba(228, 232, 239, 0.95);
  border-radius: 22px;
  padding: 34px 34px 30px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(25, 39, 70, 0.22);
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.22s ease;
}

.success-overlay.show .success-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.success-close {
  position: absolute;
  top: 14px;
  right: 15px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f5f7fa;
  color: #758198;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: 0.15s;
}

.success-close:hover {
  background: #edf0f5;
  color: #354156;
}

.success-check {
  width: 78px;
  height: 78px;
  margin: 2px auto 20px;
  border-radius: 50%;
  background: #eaf9f1;
  display: grid;
  place-items: center;
}

.success-check svg {
  width: 58px;
  height: 58px;
  overflow: visible;
}

.check-circle {
  fill: none;
  stroke: #20b26b;
  stroke-width: 2;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
}

.check-mark {
  fill: none;
  stroke: #20b26b;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 32;
  stroke-dashoffset: 32;
}

.success-overlay.show .check-circle {
  animation: drawCircle 0.55s ease 0.12s forwards;
}

.success-overlay.show .check-mark {
  animation: drawCheck 0.38s ease 0.55s forwards;
}

@keyframes drawCircle {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes drawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

.success-modal h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.2px;
  color: #182235;
}

.success-message {
  margin: 8px 0 20px;
  color: #748096;
  font-size: 13px;
}

.success-total {
  border: 1px solid #e5e9ef;
  background: #f8fafc;
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 20px;
}

.success-total span {
  display: block;
  font-size: 11px;
  color: #8994a7;
  margin-bottom: 3px;
}

.success-total strong {
  font-size: 20px;
  color: #182235;
}

.success-ok {
  width: 100%;
  height: 44px;
}

@media (max-width: 520px) {
  .success-modal {
    padding: 30px 22px 24px;
    border-radius: 18px;
  }
}

/* =========================
   MODAL GAGAL
   ========================= */
.error-overlay { position: fixed; inset: 0; z-index: 10020; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(18, 27, 45, .5); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .22s ease, visibility .22s ease; }
.error-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }
.error-modal { width: min(430px, 100%); position: relative; padding: 34px 34px 30px; border: 1px solid rgba(228, 232, 239, .95); border-radius: 22px; background: #fff; text-align: center; box-shadow: 0 24px 70px rgba(25, 39, 70, .25); transform: translateY(18px) scale(.96); opacity: 0; transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .22s ease; }
.error-overlay.show .error-modal { transform: translateY(0) scale(1); opacity: 1; }
.error-close { position: absolute; top: 14px; right: 15px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f5f7fa; color: #758198; font-size: 22px; line-height: 1; cursor: pointer; }
.error-icon { width: 78px; height: 78px; margin: 2px auto 20px; display: grid; place-items: center; border-radius: 50%; background: #fff0f2; }
.error-icon svg { width: 58px; height: 58px; overflow: visible; }
.error-circle { fill: none; stroke: #e5485d; stroke-width: 2; stroke-dasharray: 151; stroke-dashoffset: 151; }
.error-mark { fill: none; stroke: #e5485d; stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 28; stroke-dashoffset: 28; }
.error-overlay.show .error-circle { animation: drawCircle .55s ease .12s forwards; }
.error-overlay.show .error-mark { animation: drawError .32s ease .55s forwards; }
@keyframes drawError { to { stroke-dashoffset: 0; } }
.error-modal h2 { margin: 0; color: #182235; font-size: 22px; letter-spacing: -.2px; }
.error-message { margin: 8px 0 12px; color: #748096; font-size: 13px; line-height: 1.55; }
.error-detail { margin: 0 0 20px; padding: 12px 14px; border: 1px solid #f4d4da; border-radius: 12px; background: #fff7f8; color: #a23c4c; font-size: 12px; line-height: 1.5; text-align: left; }
.error-ok { width: 100%; height: 44px; }
body.dark-theme .error-overlay { background: rgba(4, 10, 22, .74); }
body.dark-theme .error-modal { background: #182131; border-color: #455875; box-shadow: 0 28px 80px rgba(0, 0, 0, .5); }
body.dark-theme .error-close { background: #2a374c; color: #cdd8ea; }
body.dark-theme .error-modal h2 { color: #f5f8ff; }
body.dark-theme .error-message { color: #b8c5d9; }
body.dark-theme .error-icon { background: rgba(229, 72, 93, .15); }
body.dark-theme .error-detail { border-color: rgba(229, 72, 93, .35); background: rgba(229, 72, 93, .1); color: #ffb8c3; }

/* =========================
   SMART SELECT / SEARCHABLE DROPDOWN
   ========================= */
.smart-select {
  position: relative;
  width: 100%;
}

.native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.smart-select-trigger {
  width: 100%;
  height: 44px;
  border: 1px solid #d9dfe8;
  border-radius: 9px;
  background: #fff;
  color: #263248;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  transition: 0.15s;
}

.smart-select-trigger:hover {
  border-color: #c6ceda;
}

.smart-select.open .smart-select-trigger {
  border-color: #8093ff;
  box-shadow: 0 0 0 3px #edf0ff;
}

.smart-select-trigger:disabled {
  background: #f4f6f9;
  color: #9aa4b5;
  cursor: not-allowed;
  box-shadow: none;
}

.smart-select-chevron {
  font-size: 18px;
  color: #8490a3;
  line-height: 1;
  transform: translateY(-2px);
  transition: transform 0.18s;
}

.smart-select.open .smart-select-chevron {
  transform: rotate(180deg) translateY(2px);
}

.smart-select-menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #dfe4eb;
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(26, 39, 69, 0.14);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px) scale(0.99);
  transition: 0.16s ease;
  transform-origin: top;
}

.smart-select.open .smart-select-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.smart-select-search-wrap {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e6ed;
  background: #f8fafc;
  border-radius: 8px;
  padding: 0 10px;
  margin-bottom: 7px;
}

.smart-select-search-icon {
  font-size: 18px;
  color: #8792a4;
  line-height: 1;
}

.smart-select-search {
  height: 100% !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  font-size: 13px !important;
  outline: 0 !important;
}

.smart-select-options {
  max-height: 250px;
  overflow-y: auto;
  padding: 2px;
}

.smart-select-option {
  min-height: 39px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  color: #3e4b60;
  cursor: pointer;
}

.smart-select-option:hover {
  background: #f2f5ff;
  color: #3f5fe8;
}

.smart-select-option.selected {
  background: #eef2ff;
  color: #3f5fe8;
  font-weight: 650;
}

.smart-select-option.empty {
  color: #98a2b1;
  cursor: default;
  justify-content: center;
}

.smart-select-option.empty:hover {
  background: transparent;
  color: #98a2b1;
}

.smart-select-option .option-check {
  margin-left: auto;
  font-size: 15px;
}

.smart-select-options::-webkit-scrollbar {
  width: 7px;
}

.smart-select-options::-webkit-scrollbar-thumb {
  background: #cbd2dd;
  border-radius: 10px;
}

.btn-delete-transaction {
  width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #ef4444;
  cursor: pointer;
  font-size: 15px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.btn-delete-transaction:hover {
  background: #fef2f2;
  border-color: #fecaca;
  transform: translateY(-1px);
}

.btn-delete-transaction:active {
  transform: scale(0.95);
}

/* =========================================================
   ANIMASI HAPUS TRANSAKSI
   ========================================================= */

.transaction-delete-animation {
  animation: transactionDelete 0.35s ease forwards;
  pointer-events: none;
}

@keyframes transactionDelete {
  0% {
    opacity: 1;
    transform: translateX(0);
  }

  50% {
    opacity: 0.45;
    transform: translateX(12px);
  }

  100% {
    opacity: 0;
    transform: translateX(35px);
  }
}

/* =========================================================
   POPUP HAPUS TRANSAKSI
   ========================================================= */

.delete-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(18, 27, 45, 0.38);

  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.22s ease,
    visibility 0.22s ease;
}

.delete-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.delete-modal {
  width: min(430px, 100%);

  position: relative;

  background: #fff;

  border: 1px solid rgba(228, 232, 239, 0.95);

  border-radius: 22px;

  padding: 32px;

  text-align: center;

  box-shadow: 0 24px 70px rgba(25, 39, 70, 0.22);

  transform: translateY(18px) scale(0.94);

  opacity: 0;

  transition:
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.22s ease;
}

.delete-overlay.show .delete-modal {
  transform: translateY(0) scale(1);

  opacity: 1;
}

/* =========================================================
   ICON HAPUS
   ========================================================= */

.delete-icon {
  width: 72px;
  height: 72px;

  margin: 0 auto 18px;

  border-radius: 50%;

  background: #fff1f2;

  display: grid;
  place-items: center;

  animation: deleteIconPop 0.4s ease;
}

.delete-icon span {
  font-size: 30px;

  transform-origin: center;

  animation: deleteIconShake 0.45s ease 0.1s;
}

@keyframes deleteIconPop {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }

  70% {
    transform: scale(1.08);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes deleteIconShake {

  0%,
  100% {
    transform: rotate(0);
  }

  25% {
    transform: rotate(-10deg);
  }

  50% {
    transform: rotate(10deg);
  }

  75% {
    transform: rotate(-5deg);
  }
}

/* =========================================================
   JUDUL
   ========================================================= */

.delete-modal h2 {
  margin: 0;

  font-size: 21px;

  color: #182235;

  letter-spacing: -0.2px;
}

.delete-message {
  margin: 8px 0 18px;

  color: #748096;

  font-size: 13px;

  line-height: 1.5;
}

/* =========================================================
   DETAIL TRANSAKSI
   ========================================================= */

.delete-detail {
  display: flex;

  flex-direction: column;

  gap: 4px;

  background: #f8fafc;

  border: 1px solid #e5e9ef;

  border-radius: 12px;

  padding: 13px 15px;

  margin-bottom: 20px;
}

.delete-detail strong {
  font-size: 14px;

  color: #263248;
}

.delete-detail span {
  font-size: 12px;

  color: #8a95a8;
}

.delete-detail b {
  margin-top: 3px;

  font-size: 18px;

  color: #ef4444;
}

/* =========================================================
   TOMBOL POPUP
   ========================================================= */

.delete-actions {
  display: flex;

  gap: 10px;
}

.delete-actions button {
  flex: 1;

  height: 44px;

  border-radius: 9px;

  font-size: 13px;

  font-weight: 650;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    background 0.15s ease;
}

.delete-btn-cancel {
  border: 1px solid #e0e4eb;

  background: #f1f3f7;

  color: #566277;
}

.delete-btn-cancel:hover {
  background: #e7eaf0;
}

.delete-btn-confirm {
  border: 1px solid #ef4444;

  background: #ef4444;

  color: #fff;
}

.delete-btn-confirm:hover {
  filter: brightness(0.94);

  transform: translateY(-1px);
}

.delete-btn-confirm:active,
.delete-btn-cancel:active {
  transform: scale(0.97);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 520px) {
  .delete-modal {
    padding: 28px 20px 22px;

    border-radius: 18px;
  }

  .delete-actions {
    flex-direction: column-reverse;
  }

  .delete-actions button {
    width: 100%;
  }
}

/* =========================================================
   ANIMASI BARIS TRANSAKSI SAAT DIHAPUS
   ========================================================= */

.transaction-delete-animation {
  animation: transactionDelete 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;

  pointer-events: none;
}

@keyframes transactionDelete {
  0% {
    opacity: 1;
    transform: translateX(0);
    max-height: 100px;
  }

  50% {
    opacity: 0.5;
    transform: translateX(12px);
  }

  100% {
    opacity: 0;
    transform: translateX(45px);
  }
}

/* =========================================================
   PENYEMPURNAAN
   ========================================================= */

/* Angka pada input ikut memakai lebar digit seragam */
input[type="number"],
#satuan,
#lebar {
  font-variant-numeric: tabular-nums;
}

/* Kartu pendukung dibuat lebih datar daripada kartu utama,
   supaya mata langsung tertuju ke form dan tabel. */
.info-card,
.mini-note {
  box-shadow: var(--shadow-flat);
}

.btn.secondary:hover {
  background: #e9ecf2;
  color: #3b475d;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Fokus keyboard harus terlihat jelas — penting saat input
   data cepat memakai Tab tanpa menyentuh mouse. */
.btn:focus-visible,
.nav-item:focus-visible,
.smart-select-trigger:focus-visible,
.btn-delete-transaction:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

input:focus-visible {
  border-color: #8093ff;
  box-shadow: 0 0 0 3px #edf0ff;
}

/* Hormati pengaturan sistem bagi yang sensitif terhadap animasi */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   DASHBOARD
   ========================================================= */

.period-switch {
  display: inline-flex;
  background: #f1f3f8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.period-switch button {
  border: 0;
  background: none;
  color: #5d6a7f;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
}

.period-switch button:hover {
  color: #35415a;
}

.period-switch button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-flat);
}

.period-range {
  display: inline-flex;
  align-items: center;
  height: auto;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f1f3f8;
  box-shadow: var(--shadow-flat);
}

.period-range label {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 5px 0 11px;
  border: 1px solid #d8deea;
  border-radius: 9px;
  background: #fff;
  transform: translateY(4px);
  color: #66758d;
  font-size: 12px;
  font-weight: 600;
}

.period-range label + label {
  padding-left: 11px;
  border-left: 1px solid #d8deea;
}

.period-range input,
.period-range .flatpickr-input {
  width: 112px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-left: 1px solid #e0e5ee;
  border-radius: 0;
  background: transparent;
  color: #35415a;
  font: inherit;
  font-size: 12px;
  outline: 0;
}

.period-range label:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px #e8ecff; }
.period-range input:focus,
.period-range .flatpickr-input:focus { box-shadow: none; }

.period-range button {
  height: 40px;
  margin-left: 1px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #e7ebf3;
  color: #5d6a7f;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.period-range button:hover { background: #dde3ef; color: #35415a; }
.period-range button.active { background: #fff; color: var(--primary); border-color: #d8e0ff; box-shadow: 0 2px 7px rgba(32, 51, 91, .12); }

.invoice-topbar { align-items: flex-start; }
.invoice-source-switch { margin: 0; }
.invoice-topbar .topbar-actions { padding-top: 2px; }

.invoice-source-bar {
  position: sticky;
  z-index: 15;
  top: 92px;
  display: flex;
  justify-content: flex-start;
  padding: 10px 0 14px;
  background: var(--bg);
}

.invoice-payment-status-switch {
  margin-left: 10px;
}

.journal-visibility-switch { margin-left: auto; }

.journal-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.journal-cancel-count { padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); font-size: .83rem; white-space: nowrap; }
.journal-search { width: min(260px, 100%); min-height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel-alt); color: var(--text); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .journal-tools { justify-content: flex-start; width: 100%; }
  .journal-visibility-switch { margin-left: 0; }
  .journal-search { width: 100%; }
}

@media (max-width: 720px) {
  .invoice-source-bar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .invoice-payment-status-switch { margin-left: 0; }
}

.stat-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(150px, 1fr));
  gap: 20px;
  transition: grid-template-columns .34s cubic-bezier(.22, .8, .25, 1);
}

.stat-card {
  padding: 22px 24px 20px;
}

.dashboard-stat-action { cursor: pointer; transition: grid-column .34s cubic-bezier(.22, .8, .25, 1), transform .24s ease, border-color .2s ease, box-shadow .2s ease; }
.dashboard-stat-action:hover { transform: translateY(-2px); border-color: #7590f4; }
.stat-grid.has-expanded { grid-template-columns: minmax(0, 1fr); }
.stat-grid.has-expanded .dashboard-stat-action:not(.expanded) { display: none; }
.dashboard-stat-action.expanded { grid-column: 1 / -1; cursor: default; animation: statCardExpand .38s cubic-bezier(.22, .8, .25, 1) both; }
.dashboard-stat-action.closing { animation: statCardClose .4s cubic-bezier(.4, 0, .2, 1) both; pointer-events: none; }
.stat-detail { overflow: hidden; margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(112, 133, 171, .32); animation: statDetailOpen .38s cubic-bezier(.22, .8, .25, 1) both; }
.closing .stat-detail { animation: statDetailClose .38s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes statCardExpand { from { opacity: .76; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes statCardClose { from { opacity: 1; transform: translateY(0); } to { opacity: .78; transform: translateY(3px); } }
@keyframes statDetailOpen { from { max-height: 0; opacity: 0; transform: translateY(-8px); margin-top: 0; padding-top: 0; } to { max-height: 540px; opacity: 1; transform: translateY(0); } }
@keyframes statDetailClose { from { max-height: 540px; opacity: 1; transform: translateY(0); } to { max-height: 0; opacity: 0; transform: translateY(-6px); margin-top: 0; padding-top: 0; } }
.stat-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 15px; }
.stat-detail-head span, .stat-detail-head small { display: block; color: var(--muted); font-size: 12px; }
.stat-detail-head strong { display: block; margin: 3px 0; color: var(--text-strong); font-size: 17px; }
.stat-detail-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #f3f6fb; color: #66758a; font-size: 23px; line-height: 1; cursor: pointer; }
.stat-detail-close:hover { background: #e8edff; color: var(--primary); }
.stat-detail-table-wrap { max-height: 340px; overflow: auto; }
.stat-detail-table { min-width: 720px; }
.stat-detail-table th { white-space: nowrap; }
.stat-detail-empty { margin: 0; padding: 30px 0; color: var(--muted); text-align: center; }

/* Kartu total memiliki latar biru, jadi detailnya memakai versi tabel transparan
   agar tetap menyatu dengan kartu, bukan seperti panel putih terpisah. */
.stat-card-total .stat-detail { border-color: rgba(255,255,255,.28); }
.stat-card-total .stat-detail-head span,
.stat-card-total .stat-detail-head small { color: rgba(255,255,255,.76); }
.stat-card-total .stat-detail-head strong { color: #fff; }
.stat-card-total .stat-detail-close { background: rgba(19, 37, 106, .23); border-color: rgba(255,255,255,.34); color: #fff; }
.stat-card-total .stat-detail-close:hover { background: rgba(19, 37, 106, .42); color: #fff; }
.stat-card-total .stat-detail-table-wrap { border-color: rgba(255,255,255,.25); }
.stat-card-total .stat-detail-table th { background: rgba(20, 40, 112, .24); color: #fff; }
.stat-card-total .stat-detail-table td { border-color: rgba(255,255,255,.16); color: rgba(255,255,255,.94); }
.stat-card-total .stat-detail-empty { color: rgba(255,255,255,.82); }

.stat-card-total {
  background: linear-gradient(135deg, #4968f5, #6782ff);
  border-color: transparent;
}

.stat-card-total .stat-label,
.stat-card-total .stat-foot { color: rgba(255,255,255,.82); }
.stat-card-total .stat-value { color: #fff; }
.stat-card-total .stat-icon { background: rgba(255,255,255,.16); color: #fff; }

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #f2f5fa;
  color: #55627a;
  display: grid;
  place-items: center;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

/* Aksen pastel per jenis metrik membuat kartu mode terang lebih mudah
   dipindai tanpa mengubah hierarki angka utamanya. */
.stat-grid > .stat-card:nth-child(2) .stat-icon { background: linear-gradient(145deg, #e1f8fb, #edfafa); color: #16889a; }
.stat-grid > .stat-card:nth-child(3) .stat-icon { background: linear-gradient(145deg, #eceeff, #f4f4ff); color: #5968c9; }
.stat-grid > .stat-card:nth-child(4) .stat-icon { background: linear-gradient(145deg, #fff0d8, #fff7ea); color: #b76a16; }
.stat-grid > .stat-card:nth-child(5) .stat-icon { background: linear-gradient(145deg, #dff8ed, #effbf5); color: #19875e; }

/* Pil perbandingan: naik hijau, turun merah.
   Hanya muncul kalau ada periode sebelumnya untuk dibandingkan. */
.stat-delta {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e9f8f0;
  color: #12885a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-delta.turun {
  background: #fdf2f4;
  color: #b3253c;
}

.stat-delta[hidden] {
  display: none;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  margin: 10px 0 6px;
  line-height: 1.1;
}

.stat-foot {
  font-size: 12px;
  color: #8a95a8;
  font-variant-numeric: tabular-nums;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.dashboard-main-column {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.chart-card,
.rank-card {
  padding: 24px;
}

.source-summary-card { padding: 20px 24px; }
.card-header.compact { margin-bottom: 14px; }
.source-summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.source-summary-item {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #e0e7f0;
  border-radius: 10px;
  background: #f8fafc;
}
.source-summary-item span,
.source-summary-item small { display: block; }
.source-summary-item span { color: #68758a; font-size: 11px; font-weight: 650; }
.source-summary-item strong { display: block; margin-top: 3px; color: var(--text-strong); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-summary-item small { margin-top: 3px; color: #8a95a8; font-size: 10px; }

/* Grafik batang digambar langsung dengan div —
   tidak perlu pustaka grafik tambahan. */
.chart-body {
  display: flex;
  gap: 14px;
}

/* Nilai sumbu kiri: memberi skala, supaya tinggi batang
   bisa dibaca sebagai angka, bukan cuma perbandingan. */
.chart-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 220px;
  padding-bottom: 30px;
  font-size: 11px;
  color: #9aa4b5;
  font-variant-numeric: tabular-nums;
  text-align: right;
  flex: none;
}

.chart-plot {
  position: relative;
  flex: 1;
  min-width: 0;
}

.chart-grid {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.chart-grid i {
  display: block;
  border-top: 1px solid #eef1f6;
}

.bar-chart {
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: 220px;
  position: relative;
}

/* Kolom harus setinggi penuh, baru batang di dalamnya punya
   ruang untuk tumbuh. Dengan align-items: flex-end, kolom
   menyusut mengikuti isinya dan batangnya jadi setinggi nol. */
.bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bar-track {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding: 0 22%;
}

/* Batang ramping dengan ujung membulat, berdiri di atas garis
   bantu — bukan di dalam kotak. Latar kotak membuat grafik
   terlihat penuh padahal nilainya kecil. */
.bar-fill {
  width: 100%;
  background: var(--primary);
  border-radius: 6px;
  min-height: 3px;
  transition: height 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}

.bar-col:hover .bar-fill {
  background: #3a55d9;
}

.bar-label {
  text-align: center;
  font-size: 11px;
  color: #8a95a8;
  margin-top: 9px;
}

.chart-empty,
.rank-empty {
  color: #99a2b1;
  font-size: 13px;
  margin: 0;
  padding: 30px 0;
  text-align: center;
}

.rank-item+.rank-item {
  margin-top: 18px;
}

.rank-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 7px;
}

.rank-name {
  font-size: 13px;
  font-weight: 600;
  color: #35415a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rank-track {
  height: 7px;
  background: #f0f3f9;
  border-radius: 4px;
  overflow: hidden;
}

.rank-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
}

.rank-meta {
  font-size: 11px;
  color: #8a95a8;
  margin-top: 6px;
}

@media (max-width: 1050px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1450px) and (min-width: 1051px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-card-total { grid-column: span 2; }
}

@media (max-width: 720px) {

  .stat-card,
  .chart-card,
  .rank-card {
    padding: 18px;
  }

  .bar-chart {
    height: 170px;
    gap: 6px;
  }

  .stat-grid { grid-template-columns: 1fr; }
  .stat-card-total { grid-column: auto; }
}

/* Pemilih periode tetap terlihat di layar kecil,
   sementara badge status di halaman input tetap disembunyikan. */
@media (max-width: 720px) {
  .topbar-actions:has(.period-switch),
  .topbar-actions:has(.period-range) {
    display: flex;
  }

  .period-switch button {
    padding: 6px 10px;
    font-size: 12px;
  }

  .period-range { gap: 4px; }
  .period-range label { padding-left: 3px; gap: 3px; }
  .period-range input, .period-range .flatpickr-input { width: 92px; }
  .period-range button { padding: 0 8px; font-size: 12px; }
  .invoice-topbar { align-items: stretch; }
  .invoice-source-switch { overflow-x: auto; max-width: 100%; }
  .invoice-source-bar { top: 92px; }
}

/* Baris kartu berukuran sama (proses cetak & jenis harga) */
.dashboard-grid.split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* =========================================================
   PERPINDAHAN HALAMAN
   Kedua halaman ada di satu dokumen; yang tidak aktif
   disembunyikan lewat atribut hidden.
   ========================================================= */

.view[hidden] {
  display: none;
}

/* Keluar tetap cepat. Ini jarak antara klik dan isi berganti —
   apa pun yang terjadi di sini terbaca sebagai waktu tunggu,
   bukan sebagai kehalusan. */
.view.keluar .content,
.view.keluar .topbar h1,
.view.keluar .topbar p {
  animation: pudarKeluar 0.14s ease forwards;
}

/* Judul header muncul lebih dulu, menjadi pembuka */
.view.masuk .topbar h1,
.view.masuk .topbar p {
  animation: naikMasuk 0.6s cubic-bezier(0.32, 0.72, 0, 1) backwards;
}

/* Kartu menyusul satu per satu. Jeda antar kartu diisi app.js
   lewat --tunda, mengikuti urutan sebenarnya di halaman. */
.view.masuk .card {
  animation: naikMasuk 0.8s cubic-bezier(0.32, 0.72, 0, 1) var(--tunda, 0s) backwards;
}

/* Cepat di awal, melambat panjang di akhir — inilah sumber rasa
   halusnya, bukan durasinya. Diganti 'ease' biasa, gerakan
   sepanjang ini akan terasa diseret. */
@keyframes naikMasuk {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes pudarKeluar {
  to {
    opacity: 0;
  }
}

/* =========================
   MODE GELAP
   ========================= */
body.dark-theme {
  --bg: #111827;
  --card: #1b2433;
  --text: #e7edf8;
  --text-strong: #f8fbff;
  --muted: #aebbd0;
  --line: #344157;
  --panel-alt: #202b3c;
  --border: #344157;
  --shadow: 0 6px 20px rgba(0, 0, 0, .24);
  --shadow-flat: 0 1px 2px rgba(0, 0, 0, .3);
}

body.dark-theme .sidebar,
body.dark-theme .topbar,
body.dark-theme .invoice-detail-modal,
body.dark-theme .success-modal,
body.dark-theme .delete-modal { background: #182131; }

body.dark-theme .sidebar { border-color: var(--line); }
body.dark-theme .nav-item { color: #b9c5d7; }
body.dark-theme .nav-item.active { background: #27365d; outline-color: #546cb9; }
body.dark-theme .nav-item.active-soft,
body.dark-theme .nav-item:not(.disabled):hover { background: #243047; }
body.dark-theme .nav-item.disabled,
body.dark-theme .menu-label { color: #7f8da3; }
body.dark-theme .theme-toggle,
body.dark-theme .data-status,
body.dark-theme .btn.secondary,
body.dark-theme .period-switch,
body.dark-theme .period-range { background: #243047; color: #c2cce0; border-color: var(--line); }
body.dark-theme .theme-toggle:hover,
body.dark-theme .btn.secondary:hover { background: #2c3a53; }

body.dark-theme input,
body.dark-theme select,
body.dark-theme .table-filter,
body.dark-theme .smart-select-trigger { background: #202b3c; color: #e7edf8; border-color: #3a4961; }
body.dark-theme input[readonly],
body.dark-theme input:disabled,
body.dark-theme select:disabled { background: #202938; color: #94a1b5; }
body.dark-theme .period-range input,
body.dark-theme .period-range .flatpickr-input,
body.dark-theme .period-switch button.active,
body.dark-theme .period-range button.active { background: #1b2433; color: #8fa4ff; }
body.dark-theme input::placeholder,
body.dark-theme .table-filter::placeholder { color: #93a1b8; opacity: 1; }
body.dark-theme input[type="date"] { color-scheme: dark; }
body.dark-theme select option { background: #1b2433; color: #e7edf8; }

/* Dropdown pencarian toko, produk, dan proses. */
body.dark-theme .smart-select.open .smart-select-trigger {
  background: #243249;
  border-color: #7892ff;
  box-shadow: 0 0 0 3px rgba(91, 119, 255, .2);
}
body.dark-theme .smart-select-chevron { color: #9eafca; }
body.dark-theme .smart-select-menu {
  background: #1b2433;
  border-color: #40516b;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .38);
}
body.dark-theme .smart-select-search-wrap {
  background: #202b3c;
  border-color: #3b4a62;
}
body.dark-theme .smart-select-search-icon { color: #9eafca; }
body.dark-theme .smart-select-search { color: #e7edf8; }
body.dark-theme .smart-select-option { color: #d6e0ef; }
body.dark-theme .smart-select-option:hover {
  background: #27365d;
  color: #b9c6ff;
}
body.dark-theme .smart-select-option.selected {
  background: #2e4381;
  color: #fff;
}
body.dark-theme .smart-select-option.empty,
body.dark-theme .smart-select-option.empty:hover { color: #94a1b5; }
body.dark-theme .smart-select-options::-webkit-scrollbar-thumb { background: #53647e; }

body.dark-theme label,
body.dark-theme td { color: #d2dbea; }
body.dark-theme th { background: #202b3c; color: #b9c5d7; }
body.dark-theme td { border-color: #2d3a50; }
body.dark-theme tbody tr:hover td { background: #202b3c; }
body.dark-theme .calculation-box,
body.dark-theme .mini-note,
body.dark-theme .invoice-detail-total { background: #202b3c; border-color: #34445e; }
body.dark-theme .invoice-receivable-box { background: #202b3c; border-color: #34445e; }
body.dark-theme .invoice-selection-item { background: #182131; border-color: #40516b; }
body.dark-theme .invoice-selection-item:has(input:checked) { background: #26375d; border-color: #607bff; }
body.dark-theme .invoice-selection-item strong,
body.dark-theme .invoice-selection-item b { color: #f5f8ff; }
body.dark-theme .invoice-selection-item small { color: #b9c5d7; }
body.dark-theme .invoice-payment-form input,
body.dark-theme .invoice-payment-form select { background: #182131; border-color: #40516b; color: #e5ecf8; }
body.dark-theme .formula,
body.dark-theme .info-card ol,
body.dark-theme .card-header p,
body.dark-theme small { color: #aebbd0; }
body.dark-theme .info-card strong { color: #dbe5f5; }
body.dark-theme .info-icon { background: #27365d; }
body.dark-theme .table-wrap { border-color: var(--line); }
body.dark-theme .invoice-detail-close { background: #273348; color: #e7edf8; }
body.dark-theme .invoice-store-card { background: #1b2433; }
body.dark-theme .invoice-store-card:hover { background: #202b3c; }
body.dark-theme .rank-name,
body.dark-theme .rank-value,
body.dark-theme .stat-value,
body.dark-theme .total-row strong,
body.dark-theme .invoice-detail-header h2,
body.dark-theme .invoice-detail-section-title h3 { color: #f5f8ff; }
body.dark-theme .rank-meta,
body.dark-theme .bar-label,
body.dark-theme .chart-axis,
body.dark-theme .stat-foot,
body.dark-theme .invoice-detail-section-title span { color: #aebbd0; }
body.dark-theme .chart-grid i { border-color: #35445c; }
body.dark-theme .rank-track { background: #2a374c; }
body.dark-theme .period-range { padding: 5px; gap: 6px; box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
body.dark-theme .period-range label { gap: 7px; color: #c4cee0; }
body.dark-theme .period-range label,
body.dark-theme .period-range label + label { border-color: #34445e; background: #1a2537; }
body.dark-theme .period-range input,
body.dark-theme .period-range .flatpickr-input { height: 30px; border-left-color: #34445e; background: transparent; }
body.dark-theme .period-range button { background: #1a2537; color: #aab8ce; border-color: #34445e; }
body.dark-theme .period-range button:hover { background: #2b3a53; color: #e7edf8; }
body.dark-theme .period-range button.active { background: #405ee8; color: #fff; border-color: #6f87ff; box-shadow: 0 3px 10px rgba(0, 0, 0, .24); }
body.dark-theme .stat-card,
body.dark-theme .chart-card,
body.dark-theme .rank-card { border-color: #35445c; }
/* Ikon kartu statistik khusus mode gelap: setiap jenis transaksi memakai
   aksen sendiri, tanpa panel putih yang terlalu kontras. */
body.dark-theme .stat-card:not(.stat-card-total) .stat-icon {
  border: 1px solid rgba(137, 159, 207, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 6px 15px rgba(0, 0, 0, .16);
}
body.dark-theme .stat-grid > .stat-card:nth-child(2) .stat-icon { background: linear-gradient(145deg, #1d3f4e, #203846); color: #72d9e6; }
body.dark-theme .stat-grid > .stat-card:nth-child(3) .stat-icon { background: linear-gradient(145deg, #303061, #272950); color: #aeb7ff; }
body.dark-theme .stat-grid > .stat-card:nth-child(4) .stat-icon { background: linear-gradient(145deg, #4a3622, #3d2d20); color: #ffc16c; }
body.dark-theme .stat-grid > .stat-card:nth-child(5) .stat-icon { background: linear-gradient(145deg, #1f463d, #1d3934); color: #76dfb8; }
body.dark-theme .source-summary-card { border-color: #35445c; }
body.dark-theme .source-summary-item { background: #202b3c; border-color: #35445c; }
body.dark-theme .source-summary-item span,
body.dark-theme .source-summary-item small { color: #aebbd0; }
body.dark-theme .source-summary-item strong { color: #f5f8ff; }
body.dark-theme .stat-card:hover,
body.dark-theme .chart-card:hover,
body.dark-theme .rank-card:hover { border-color: #4968a8; }
body.dark-theme .accounting-table th { background: #202b3c; color: #b6c6df; }
body.dark-theme .accounting-table td { border-color: #2e3d53; color: #e5ecf8; }
body.dark-theme .account-form label { color: #dbe5f5; }
body.dark-theme .account-form input,
body.dark-theme .account-form select { background: #202b3c; border-color: #40516b; color: #e5ecf8; }
body.dark-theme .profit-row { color: #dce6f8; }
body.dark-theme .profit-row.grand-total { border-color: #cbd8f0; color: #f5f8ff; }
body.dark-theme .account-status.active { background: #193c32; color: #8ce6bd; }
body.dark-theme .account-status.inactive { background: #2a3445; color: #b7c5da; }
body.dark-theme .dashboard-stat-action:hover { box-shadow: 0 14px 26px rgba(0, 0, 0, .19); }
body.dark-theme .stat-detail { border-color: #3d4d66; }
body.dark-theme .stat-detail-close { background: #29374c; border-color: #40516b; color: #dce7f7; }
body.dark-theme .stat-detail-close:hover { background: #354766; color: #fff; }
body.dark-theme .stat-detail-table-wrap { border-color: #3a4a62; }
body.dark-theme .stat-detail-table th { background: #253247; color: #dbe7ff; }
body.dark-theme .stat-detail-table td { border-color: #2e3d53; color: #e5ecf8; }

/* Komponen browser dan popup perlu warna eksplisit karena aturan terang
   memakai selector ID/warna tetap, sehingga tidak cukup mewarisi --card. */
body.dark-theme #packagingFile,
body.dark-theme #stockFile {
  background: #202b3c;
  color: #dbe5f5;
  border-color: #536987;
}
body.dark-theme #packagingFile:hover,
body.dark-theme #packagingFile:focus,
body.dark-theme #stockFile:hover,
body.dark-theme #stockFile:focus {
  background: #26344a;
  border-color: #7892ff;
  box-shadow: 0 0 0 3px rgba(91, 119, 255, .18);
}
body.dark-theme #packagingFile::file-selector-button,
body.dark-theme #stockFile::file-selector-button {
  background: #4d6af5;
  color: #fff;
}
body.dark-theme #packagingFile:hover::file-selector-button,
body.dark-theme #stockFile:hover::file-selector-button { background: #607bff; }

body.dark-theme .success-overlay,
body.dark-theme .delete-overlay,
body.dark-theme .invoice-detail-overlay { background: rgba(4, 10, 22, .74); }
body.dark-theme .success-modal,
body.dark-theme .delete-modal,
body.dark-theme .invoice-detail-modal {
  background: #182131;
  border-color: #455875;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .5);
}
body.dark-theme .success-modal h2,
body.dark-theme .delete-modal h2 { color: #f5f8ff; }
body.dark-theme .success-message,
body.dark-theme .delete-message { color: #b8c5d9; }
body.dark-theme .success-close {
  background: #2a374c;
  color: #cdd8ea;
}
body.dark-theme .success-close:hover { background: #35445c; color: #fff; }
body.dark-theme .success-total,
body.dark-theme .delete-detail {
  background: #202b3c;
  border-color: #3d4d66;
}
body.dark-theme .success-total span,
body.dark-theme .delete-detail span { color: #aebbd0; }
body.dark-theme .success-total strong,
body.dark-theme .delete-detail strong { color: #f5f8ff; }
body.dark-theme .success-check { background: #173b35; }
body.dark-theme .delete-icon { background: #412833; }
body.dark-theme .delete-btn-cancel {
  background: #2a374c;
  border-color: #40516b;
  color: #dbe5f5;
}
body.dark-theme .delete-btn-cancel:hover { background: #35445c; }
/* Aksi hapus per baris: tetap mudah dikenali tanpa menjadi kotak putih
   yang mengalihkan perhatian dari isi tabel. */
body.dark-theme .btn-delete-transaction {
  background: #2d2634;
  border-color: #62414e;
  color: #ff9aaa;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
body.dark-theme .btn-delete-transaction:hover {
  background: #512b3a;
  border-color: #e36a7d;
  color: #ffd3d9;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .22);
}
body.dark-theme .btn-delete-transaction:focus-visible {
  outline-color: #ff9aaa;
}

/* Pergantian periode di dashboard memakai gerak dan urutan
   yang sama, supaya seluruh aplikasi punya satu bahasa animasi. */
.segar .card {
  animation: naikMasuk 0.62s cubic-bezier(0.32, 0.72, 0, 1) var(--tunda-segar, 0s) backwards;
}

/* =========================================================
   NAVIGASI MOBILE
   Sidebar menjadi drawer agar seluruh halaman tetap dapat diakses di ponsel.
   ========================================================= */
.mobile-menu-button,
.mobile-sidebar-backdrop {
  display: none;
}

.accounting-period-range {
  margin-left: 10px;
}

@media (max-width: 720px) {
  .mobile-menu-button {
    position: fixed;
    top: 15px;
    right: 16px;
    z-index: 10040;
    width: 42px;
    height: 42px;
    display: grid;
    place-content: center;
    gap: 4px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--card);
    box-shadow: var(--shadow);
    cursor: pointer;
  }

  .mobile-menu-button span {
    width: 19px;
    height: 2px;
    display: block;
    border-radius: 2px;
    background: var(--text);
    transition: transform .2s ease, opacity .2s ease;
  }

  .mobile-menu-open .mobile-menu-button span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .mobile-menu-open .mobile-menu-button span:nth-child(2) { opacity: 0; }
  .mobile-menu-open .mobile-menu-button span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10025;
    display: block;
    background: rgba(10, 18, 34, .48);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
  }

  .sidebar {
    width: min(300px, 86vw);
    display: block;
    z-index: 10030;
    transform: translateX(-105%);
    transition: transform .26s cubic-bezier(.22, .8, .25, 1);
    box-shadow: 18px 0 45px rgba(18, 27, 45, .18);
  }

  .mobile-menu-open { overflow: hidden; }
  .mobile-menu-open .sidebar { transform: translateX(0); }
  .mobile-menu-open .mobile-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .topbar h1,
  .topbar p { padding-right: 52px; }
}

/* Grafik dan indikator memakai gerak yang sesuai arah datanya: batang chart
   tumbuh dari dasar, sementara bar peringkat mengisi dari kiri. */
.segar .bar-fill {
  transform-origin: center bottom;
  animation: tumbuhBatang .78s cubic-bezier(.22, .8, .25, 1) var(--tunda-bar, 0s) backwards;
}
.segar .rank-item {
  animation: munculDaftar .46s cubic-bezier(.22, .8, .25, 1) var(--tunda-rank, 0s) backwards;
}
.segar .rank-fill {
  transform-origin: left center;
  animation: isiBar .68s cubic-bezier(.22, .8, .25, 1) var(--tunda-fill, .1s) backwards;
}
.segar .source-summary-item {
  animation: munculDaftar .48s cubic-bezier(.22, .8, .25, 1) var(--tunda-sumber, 0s) backwards;
}
@keyframes tumbuhBatang {
  from { opacity: .25; transform: scaleY(0); }
  to { opacity: 1; transform: scaleY(1); }
}
@keyframes isiBar {
  from { opacity: .35; transform: scaleX(0); }
  to { opacity: 1; transform: scaleX(1); }
}
@keyframes munculDaftar {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Komponen operasional V3 */
.toast-container { position: fixed; right: 20px; bottom: 20px; z-index: 10100; display: grid; gap: 9px; pointer-events: none; }
.app-toast { max-width: min(380px, calc(100vw - 32px)); padding: 12px 15px; border: 1px solid #bde8d3; border-radius: 11px; background: #effbf5; color: #137348; box-shadow: 0 14px 36px rgba(20, 50, 80, .18); opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; font-size: 13px; font-weight: 650; }
.app-toast.show { opacity: 1; transform: translateY(0); }
.app-toast.error { border-color: #f1c3ca; background: #fff3f5; color: #a53245; }

.btn-edit-transaction { width: 36px; height: 36px; margin-right: 5px; display: inline-grid; place-items: center; border: 1px solid #dbe2f3; border-radius: 10px; background: #f5f7ff; color: var(--primary); cursor: pointer; transition: transform .15s ease, background .18s ease, border-color .18s ease; }
.btn-edit-transaction:hover { transform: translateY(-1px); border-color: #aebcff; background: #e9edff; }
.btn-edit-transaction:disabled { opacity: .55; cursor: wait; }

.transaction-edit-overlay { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 22px; background: rgba(18,27,45,.5); backdrop-filter: blur(7px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility .2s ease; }
.transaction-edit-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }
.transaction-edit-modal { width: min(650px, 100%); max-height: calc(100vh - 36px); overflow: auto; padding: 25px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 25px 75px rgba(15,28,55,.28); transform: translateY(14px) scale(.98); transition: transform .24s cubic-bezier(.22,.8,.25,1); }
.transaction-edit-overlay.show .transaction-edit-modal { transform: translateY(0) scale(1); }
.transaction-edit-modal > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.transaction-edit-modal > header span { color: var(--primary); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.transaction-edit-modal > header h2 { margin: 4px 0 0; color: var(--text-strong); font-size: 20px; }
.transaction-edit-modal > header p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.transaction-edit-modal > header button { width: 35px; height: 35px; border: 0; border-radius: 9px; background: var(--panel-alt); color: var(--muted); cursor: pointer; font-size: 22px; }
.transaction-edit-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.transaction-edit-form label { margin: 0; }
.transaction-edit-form .edit-wide { grid-column: 1 / -1; }
.transaction-edit-total { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-alt); }
.transaction-edit-total span { color: var(--muted); font-size: 12px; }
.transaction-edit-total strong { color: var(--primary); font-size: 19px; }
.transaction-edit-form footer { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.secured-transaction-editor { width: min(720px,100%); }
.transaction-edit-form label > span, .edit-field-label { display: block; margin-bottom: 7px; color: var(--text); font-size: 12px; font-weight: 700; }
.edit-master-field { min-width: 0; }
.edit-field-help, .locked-edit-field small { display: block; margin-top: 6px; color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.transaction-edit-select .smart-select-trigger { height: 44px; border-radius: 9px; background: var(--panel-alt); font-weight: 650; }
.transaction-edit-select .smart-select-menu { z-index: 10070; }
.transaction-edit-select button.smart-select-option { width: 100%; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; }
.transaction-edit-select button.smart-select-option:hover { background: #f2f5ff; color: #3f5fe8; }
.transaction-edit-select button.smart-select-option.selected { background: #eef2ff; color: #3f5fe8; }
.locked-edit-field input[readonly] { border-style: dashed; background: var(--panel-alt); color: var(--muted); cursor: not-allowed; }
.edit-master-warning { padding: 10px 12px; border: 1px solid #efd28d; border-radius: 10px; background: #fff8e7; color: #8b6411; font-size: 11px; line-height: 1.45; }

.history-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -8px 0 13px; }
.history-date-filter, .history-page-tools { display: flex; align-items: center; gap: 7px; }
.history-date-filter label { display: flex; align-items: center; gap: 5px; margin: 0; color: var(--muted); font-size: 11px; }
.history-date-filter input { width: 128px; height: 34px; font-size: 12px; }
.history-page-tools > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.history-page-tools button { min-width: 34px; padding: 0 8px; }
.sortable-column { cursor: pointer; user-select: none; }
.sortable-column::after { content: ' ↕'; color: #a5afc0; font-weight: 400; }
.sortable-column[data-sort-direction='asc']::after { content: ' ↑'; color: var(--primary); }
.sortable-column[data-sort-direction='desc']::after { content: ' ↓'; color: var(--primary); }
.source-row { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.dashboard-filter-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 15px; }
.dashboard-filter-bar > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.source-summary-track { height: 5px; overflow: hidden; border-radius: 99px; background: #e8edf5; }
.source-summary-track i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,var(--primary),#8095ff); transition: width .5s cubic-bezier(.22,.8,.25,1); }
.stat-detail-actions { display: flex; align-items: center; gap: 8px; }
body.dark-theme .source-summary-track { background: #2b394f; }
.import-duplicate td { opacity: .68; background: #fafbfc; }
.import-status { display: inline-flex; padding: 4px 8px; border-radius: 99px; font-size: 10px; font-weight: 750; }
.import-status.valid { background: #e7f8ef; color: #168453; }
.import-status.duplicate { background: #fff3dc; color: #9a6500; }
.btn-preview-remove { width: 30px; height: 30px; border: 1px solid #efcfd4; border-radius: 8px; background: #fff5f6; color: #c33d52; cursor: pointer; font-size: 18px; }
.btn-preview-remove:hover { background: #ffe8eb; border-color: #e49aa5; }
body.dark-theme .import-duplicate td { background: #202938; }
body.dark-theme .import-status.valid { background: #17392f; color: #8be2b7; }
body.dark-theme .import-status.duplicate { background: #45371f; color: #ffd27b; }
body.dark-theme .btn-preview-remove { background: #3c2830; border-color: #68414d; color: #ff9aaa; }

body.dark-theme .app-toast { border-color: #2f6651; background: #17392f; color: #99e8c1; }
body.dark-theme .btn-edit-transaction { border-color: #40516b; background: #26354d; color: #aebcff; }
body.dark-theme .btn-edit-transaction:hover { background: #31466d; border-color: #7187e9; }
body.dark-theme .transaction-edit-select .smart-select-trigger,
body.dark-theme .locked-edit-field input[readonly] { background: #202b3c; border-color: #53647e; color: #d6e0ef; }
body.dark-theme .transaction-edit-select button.smart-select-option:hover { background: #263957; color: #c7d2ff; }
body.dark-theme .transaction-edit-select button.smart-select-option.selected { background: #2e4381; color: #fff; }
body.dark-theme .edit-master-warning { border-color: #745f2e; background: #3b321f; color: #f1cf7d; }

/* =========================================================
   UX SUITE V5
   ========================================================= */
.ux-sidebar-tools { display: grid; gap: 6px; margin: 20px 0 0; }
.ux-sidebar-tools button { position: relative; width: 100%; min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; transition: background .18s ease,color .18s ease,border-color .18s ease,transform .18s ease; }
.ux-sidebar-tools button:hover { border-color: var(--line); background: var(--panel-alt); color: var(--text-strong); transform: translateX(2px); }
.ux-sidebar-tools button > span { width: 23px; flex: 0 0 auto; color: var(--primary); font-size: 21px; text-align: center; }
.ux-sidebar-tools button b { font-size: 12px; font-weight: 680; }
.ux-sidebar-tools kbd { margin-left: auto; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); color: var(--muted); font: 9px inherit; }

.ux-overlay,.ux-drawer-overlay { position: fixed; inset: 0; z-index: 10200; display: flex; padding: 22px; background: rgba(12,20,36,.55); backdrop-filter: blur(8px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease,visibility .2s ease; }
.ux-overlay { align-items: flex-start; justify-content: center; padding-top: min(13vh,110px); }
.ux-drawer-overlay { justify-content: flex-end; padding: 0; }
.ux-overlay.show,.ux-drawer-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }
.ux-command { width: min(680px,100%); max-height: min(72vh,650px); overflow: hidden; border: 1px solid rgba(225,231,242,.9); border-radius: 19px; background: var(--card); box-shadow: 0 34px 90px rgba(10,22,48,.34); transform: translateY(-12px) scale(.98); transition: transform .24s cubic-bezier(.22,.8,.25,1); }
.ux-overlay.show .ux-command { transform: translateY(0) scale(1); }
.ux-command > header { height: 66px; display: flex; align-items: center; gap: 12px; padding: 0 19px; border-bottom: 1px solid var(--line); }
.ux-command > header > span { color: var(--primary); font-size: 28px; }
.ux-command > header input { height: 100%; flex: 1; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--text-strong); font-size: 17px; outline: 0; }
.ux-command kbd { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-alt); color: var(--muted); font-size: 10px; }
.ux-command-hint { display: flex; justify-content: space-between; gap: 12px; padding: 11px 19px; color: var(--muted); font-size: 10px; }
.ux-command-hint strong { color: var(--text); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.ux-command-results { max-height: calc(min(72vh,650px) - 108px); overflow-y: auto; padding: 4px 10px 12px; }
.ux-command-item { width: 100%; min-height: 60px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 8px 11px; border: 0; border-radius: 11px; background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.ux-command-item:hover,.ux-command-item.keyboard-active { background: #eef2ff; }
.ux-command-item > i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--panel-alt); color: var(--primary); font-style: normal; font-size: 16px; }
.ux-command-item > span { min-width: 0; }
.ux-command-item strong,.ux-command-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ux-command-item strong { color: var(--text-strong); font-size: 12px; }
.ux-command-item small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.ux-command-item em { padding: 4px 7px; border-radius: 99px; background: var(--panel-alt); color: var(--muted); font-size: 9px; font-style: normal; }
.ux-command-empty,.ux-empty-state { padding: 28px 18px; color: var(--muted); text-align: center; }
.ux-command-empty span,.ux-empty-state > span { width: 43px; height: 43px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 50%; background: var(--panel-alt); color: var(--primary); font-size: 20px; }
.ux-command-empty strong,.ux-empty-state strong { display: block; color: var(--text-strong); font-size: 13px; }
.ux-command-empty p,.ux-empty-state p { margin: 6px 0 0; font-size: 10px; line-height: 1.5; }
.ux-command-loading { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 30px; color: var(--muted); font-size: 11px; }
.ux-command-loading i { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: uxSpin .7s linear infinite; }

.ux-drawer { width: min(410px,100%); height: 100%; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--card); box-shadow: -24px 0 70px rgba(12,24,50,.24); transform: translateX(32px); transition: transform .26s cubic-bezier(.22,.8,.25,1); }
.ux-drawer-overlay.show .ux-drawer { transform: translateX(0); }
.ux-drawer > header,.ux-history-modal > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 25px; border-bottom: 1px solid var(--line); }
.ux-drawer > header span,.ux-history-modal > header span { color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.ux-drawer > header h2,.ux-history-modal > header h2 { margin: 5px 0 0; color: var(--text-strong); font-size: 21px; }
.ux-drawer > header button,.ux-history-modal > header button { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--panel-alt); color: var(--muted); cursor: pointer; font-size: 21px; }
.ux-drawer-body { flex: 1; overflow-y: auto; padding: 14px; }
.ux-drawer > footer { padding: 16px 20px; border-top: 1px solid var(--line); }
.ux-drawer > footer .btn { width: 100%; justify-content: center; }
.ux-empty-state.success > span { background: #e9f8f1; color: #168453; }
.ux-preference-form { display: grid; gap: 15px; padding: 21px; overflow-y: auto; }
.ux-preference-form label { display: grid; gap: 7px; margin: 0; color: var(--text); font-size: 11px; font-weight: 700; }
.ux-preference-form select { width: 100%; height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-alt); color: var(--text); }

.ux-history-modal { width: min(760px,100%); max-height: min(78vh,720px); overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 30px 80px rgba(12,24,50,.3); transform: translateY(12px) scale(.98); transition: transform .24s ease; }
.ux-overlay.show .ux-history-modal { transform: translateY(0) scale(1); }
.ux-history-body { max-height: calc(min(78vh,720px) - 88px); overflow-y: auto; padding: 20px; }
.ux-history-item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.ux-history-item > i { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #eef2ff; color: var(--primary); font-style: normal; }
.ux-history-item header { display: flex; justify-content: space-between; gap: 12px; }
.ux-history-item header strong { color: var(--text-strong); font-size: 11px; }
.ux-history-item header span,.ux-history-item p { color: var(--muted); font-size: 9.5px; }
.ux-history-item p { margin: 4px 0 0; }
.ux-change-list { display: grid; gap: 5px; margin-top: 9px; }
.ux-change-list > span { display: grid; grid-template-columns: 80px minmax(0,1fr) 16px minmax(0,1fr); gap: 7px; padding: 7px 9px; border-radius: 8px; background: var(--panel-alt); font-size: 9.5px; }
.ux-change-list b { color: var(--text); text-transform: capitalize; }.ux-change-list del { color: #b34757; }.ux-change-list ins { color: #168453; text-decoration: none; }.ux-change-list em { color: var(--muted); font-style: normal; text-align: center; }
.btn-history-transaction { width: 36px; height: 36px; margin-right: 5px; border: 1px solid #dce3ef; border-radius: 10px; background: #f6f8fb; color: #67758c; cursor: pointer; font-size: 17px; }
.btn-history-transaction:hover { border-color: #aebcff; background: #eef2ff; color: var(--primary); }

.ux-tour-overlay { align-items: center; padding-top: 22px; }
.ux-tour { width: min(450px,100%); padding: 30px; border: 1px solid var(--line); border-radius: 23px; background: var(--card); box-shadow: 0 30px 90px rgba(12,24,50,.32); text-align: center; transform: translateY(12px) scale(.97); transition: transform .25s ease; }
.ux-overlay.show .ux-tour { transform: translateY(0) scale(1); }
.ux-tour-icon { width: 66px; height: 66px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 19px; background: linear-gradient(145deg,#edf1ff,#dfe6ff); color: var(--primary); font-size: 29px; }
.ux-tour > span { color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.ux-tour h2 { margin: 8px 0; color: var(--text-strong); font-size: 23px; }.ux-tour p { min-height: 50px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.ux-tour-dots { display: flex; justify-content: center; gap: 6px; margin: 19px 0; }.ux-tour-dots i { width: 6px; height: 6px; border-radius: 99px; background: #d5dbe6; transition: width .2s ease,background .2s ease; }.ux-tour-dots i.active { width: 19px; background: var(--primary); }
.ux-tour footer { display: flex; justify-content: flex-end; gap: 8px; }

.ux-quick-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.ux-quick-actions button { min-height: 70px; display: flex; align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); color: var(--text); cursor: pointer; text-align: left; box-shadow: var(--shadow-flat); transition: transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.ux-quick-actions button:hover { transform: translateY(-2px); border-color: #aebcff; box-shadow: 0 10px 24px rgba(46,67,129,.09); }
.ux-quick-actions i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: #eef2ff; color: var(--primary); font-size: 20px; font-style: normal; }
.ux-quick-actions i svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ux-quick-actions strong,.ux-quick-actions small { display: block; }.ux-quick-actions strong { color: var(--text-strong); font-size: 12px; }.ux-quick-actions small { margin-top: 4px; color: var(--muted); font-size: 9.5px; }
.ux-recent-card { margin-top: 20px; padding: 24px; }.ux-recent-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.ux-recent-item { min-width: 0; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); cursor: pointer; text-align: left; }
.ux-recent-item:hover { border-color: #aebcff; background: #fafbff; }.ux-recent-item > i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--panel-alt); color: var(--primary); font-style: normal; font-weight: 800; }
.ux-recent-item span { min-width: 0; }.ux-recent-item strong,.ux-recent-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.ux-recent-item strong { color: var(--text-strong); font-size: 10.5px; }.ux-recent-item small { margin-top: 4px; color: var(--muted); font-size: 9px; }.ux-recent-item > b { color: var(--text-strong); font-size: 10px; white-space: nowrap; }

.ux-form-progress { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; margin: 0 0 22px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-alt); }
.ux-form-progress > div { display: grid; justify-items: center; gap: 5px; color: var(--muted); font-size: 8.5px; font-weight: 650; }.ux-form-progress i { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #ccd4e1; border-radius: 50%; background: var(--card); color: var(--muted); font-style: normal; transition: .2s ease; }.ux-form-progress > b { height: 2px; margin: 0 7px 15px; border-radius: 2px; background: #dce2ec; }.ux-form-progress div.done i { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 0 0 3px rgba(73,104,245,.12); }.ux-form-progress div.done span { color: var(--primary); }
.ux-live-preview { margin: 15px 0 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg,var(--panel-alt),var(--card)); transition: border-color .2s ease,box-shadow .2s ease; }.ux-live-preview.ready { border-color: #8ed5b4; box-shadow: 0 0 0 3px rgba(22,132,83,.08); }.ux-live-preview > header,.ux-live-preview > footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }.ux-live-preview > header span { color: var(--muted); font-size: 8.5px; font-weight: 800; letter-spacing: .08em; }.ux-live-preview > header b { padding: 4px 7px; border-radius: 99px; background: #fff1dc; color: #9b6500; font-size: 8.5px; }.ux-live-preview.ready > header b { background: #e7f8ef; color: #168453; }.ux-live-preview > div { margin-top: 12px; }.ux-live-preview > div strong,.ux-live-preview > div small { display: block; }.ux-live-preview > div strong { color: var(--text-strong); font-size: 12px; }.ux-live-preview > div small { margin-top: 4px; color: var(--muted); font-size: 9.5px; }.ux-live-preview > p { margin: 10px 0; padding: 8px 10px; border-radius: 8px; background: var(--card); color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }.ux-live-preview > footer { padding-top: 10px; border-top: 1px solid var(--line); }.ux-live-preview > footer span { color: var(--muted); font-size: 10px; }.ux-live-preview > footer strong { color: var(--primary); font-size: 17px; }

.history-page-size { display: flex !important; align-items: center !important; gap: 5px !important; margin: 0 !important; color: var(--muted); font-size: 10px; }.history-page-size select { height: 32px; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font-size: 10px; }

/* Dropdown modern terpadu: preferensi, jumlah baris, dan select lama yang masih terlihat. */
.ux-modern-select { position: relative; width: 100%; min-width: 0; }
.ux-modern-select .smart-select-trigger {
  height: 48px;
  border-color: var(--line);
  border-radius: 11px;
  background: var(--panel-alt);
  color: var(--text-strong);
  padding: 0 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}
.ux-modern-select .smart-select-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ux-modern-select .smart-select-trigger > i { flex: 0 0 auto; color: var(--muted); font-size: 17px; font-style: normal; line-height: 1; transition: transform .18s ease; }
.ux-modern-select.open .smart-select-trigger > i { transform: rotate(180deg); }
.ux-modern-select .smart-select-menu { z-index: 10300; max-height: 250px; overflow-y: auto; }
.ux-modern-select button.smart-select-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
}
.ux-modern-select button.smart-select-option > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ux-modern-select button.smart-select-option > i { display: none; margin-left: auto; color: currentColor; font-style: normal; font-weight: 800; }
.ux-modern-select button.smart-select-option.selected > i { display: block; }
.ux-modern-select button.smart-select-option:disabled { opacity: .48; cursor: not-allowed; }
.ux-preference-form .ux-modern-select { width: 100%; }
.ux-preference-select .smart-select-trigger,
.ux-preference-select button.smart-select-option,
.ux-preference-select button.smart-select-option.selected {
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: normal;
}
.ux-preference-form label:nth-of-type(5) .smart-select-menu,
.ux-preference-form label:nth-of-type(6) .smart-select-menu { top: auto; bottom: calc(100% + 7px); transform-origin: bottom; }
.ux-modern-select-compact { width: 86px; }
.ux-modern-select-compact .smart-select-trigger { height: 32px; padding: 0 8px; border-radius: 8px; background: var(--card); font-size: 10px; }
.ux-modern-select-compact .smart-select-menu { min-width: 112px; right: 0; left: auto; }
.ux-modern-select-compact button.smart-select-option { min-height: 34px; font-size: 10px; }
body.dark-theme .ux-modern-select .smart-select-trigger { border-color: #3a4961; background: #202b3c; color: #e7edf8; }
body.dark-theme .ux-modern-select button.smart-select-option { color: #d6e0ef; }
body.dark-theme .ux-modern-select button.smart-select-option:hover { background: #27365d; color: #b9c6ff; }
body.dark-theme .ux-modern-select button.smart-select-option.selected { background: #2e4381; color: #fff; }
.ux-enhanced-table th:first-child,.ux-enhanced-table td:first-child { position: sticky; left: 0; z-index: 4; background: var(--card); }.ux-enhanced-table th:first-child { z-index: 7; background: #f8f9fb; }.ux-enhanced-table tbody tr:hover td:first-child { background: #fafbfe; }
.table-compact table td { padding-top: 8px; padding-bottom: 8px; }.table-compact table th { padding-top: 9px; padding-bottom: 9px; }.table-compact .btn-edit-transaction,.table-compact .btn-delete-transaction,.table-compact .btn-history-transaction { width: 31px; height: 31px; }
.ux-skeleton-card,.ux-skeleton-line { position: relative; overflow: hidden; border-radius: 11px; background: var(--panel-alt); }.ux-skeleton-card { height: 72px; margin-bottom: 9px; }.ux-skeleton-line { height: 52px; }.ux-skeleton-card::after,.ux-skeleton-line::after { content:''; position:absolute; inset:0; transform:translateX(-100%); background:linear-gradient(90deg,transparent,rgba(255,255,255,.55),transparent); animation:uxShimmer 1.2s infinite; }.ux-inline-error { padding: 15px; color: #b83e51; font-size: 11px; text-align: center; }
.ux-number-pulse { animation: uxNumber .38s ease both; }
@keyframes uxSpin { to { transform: rotate(360deg); } } @keyframes uxShimmer { to { transform: translateX(100%); } } @keyframes uxNumber { 50% { transform: translateY(-2px); color: var(--primary); } }

body.dark-theme .ux-sidebar-tools button:hover,body.dark-theme .ux-command-item:hover,body.dark-theme .ux-command-item.keyboard-active,body.dark-theme .ux-recent-item:hover { background: #263957; border-color: #526b9d; }
body.dark-theme .ux-command,body.dark-theme .ux-drawer,body.dark-theme .ux-history-modal,body.dark-theme .ux-tour { border-color: #455875; background: #182131; }.dark-theme .ux-command-item > i,.dark-theme .ux-history-item > i,.dark-theme .ux-quick-actions i { background: #293963; color: #b9c3ff; }.dark-theme .ux-preference-form select { border-color: #3a4961; background: #202b3c; color: #e7edf8; }.dark-theme .ux-quick-actions button,.dark-theme .ux-recent-item { border-color: #3a4961; background: #182131; }.dark-theme .ux-live-preview,.dark-theme .ux-form-progress { border-color: #3a4961; background: #202b3c; }.dark-theme .ux-live-preview > p { background: #182131; }.dark-theme .ux-live-preview > header b { background: #45371f; color: #ffd27b; }.dark-theme .ux-live-preview.ready > header b { background: #17392f; color: #8be2b7; }.dark-theme .ux-enhanced-table th:first-child { background: #202b3c; }.dark-theme .ux-enhanced-table td:first-child { background: #182131; }.dark-theme .ux-enhanced-table tbody tr:hover td:first-child { background: #202b3c; }.dark-theme .history-page-size select { background: #202b3c; color: #e7edf8; border-color: #3a4961; }

@media (min-width:721px){.sidebar-compact .sidebar { width:84px; padding-left:12px; padding-right:12px; }.sidebar-compact .main-content { width:calc(100% - 84px); margin-left:84px; }.sidebar-compact .brand { justify-content:center; padding-left:0; padding-right:0; }.sidebar-compact .brand > div:last-child,.sidebar-compact .menu-label,.sidebar-compact .nav-item:not(.active):not(.active-soft)::after,.sidebar-compact .sidebar-user > div,.sidebar-compact .theme-toggle span:last-child,.sidebar-compact .ux-sidebar-tools button b,.sidebar-compact .ux-sidebar-tools kbd { display:none; }.sidebar-compact .nav-item { justify-content:center; padding:0; font-size:0; }.sidebar-compact .sidebar-user { grid-template-columns:1fr; padding:8px; }.sidebar-compact .sidebar-user-avatar { margin:auto; }.sidebar-compact .sidebar-user button { margin:auto; }.sidebar-compact .theme-toggle,.sidebar-compact .ux-sidebar-tools button { justify-content:center; padding:0; }.sidebar-compact .ux-sidebar-tools button > i { left:37px; }.sidebar-compact .ux-sidebar-tools button:hover { transform:translateY(-1px); }}
@media (max-width:720px){.ux-quick-actions { grid-template-columns:1fr; }.ux-recent-list { grid-template-columns:1fr; }.ux-sidebar-tools { margin-top:14px; }.ux-change-list > span { grid-template-columns:65px 1fr; }.ux-change-list em { display:none; }.ux-change-list ins { grid-column:2; }.ux-command-hint span { display:none; }}
@media (max-width:620px){.ux-overlay { padding:12px; padding-top:72px; }.ux-tour-overlay { padding-top:12px; }.ux-command { border-radius:15px; }.ux-command > header { height:58px; padding:0 13px; }.ux-command > header input { font-size:14px; }.ux-command-item { grid-template-columns:35px minmax(0,1fr); }.ux-command-item em { display:none; }.ux-drawer { width:100%; }.ux-tour { padding:24px 18px; }.ux-form-progress > div span { display:none; }.ux-form-progress > b { margin-bottom:0; }.ux-recent-item { grid-template-columns:35px minmax(0,1fr); }.ux-recent-item > b { grid-column:2; }.history-page-tools { flex-wrap:wrap; }.ux-enhanced-table { min-width:0 !important; }.ux-enhanced-table thead { display:none; }.ux-enhanced-table tbody,.ux-enhanced-table tr,.ux-enhanced-table td { display:block; width:100%; }.ux-enhanced-table tr:not(.empty-row) { margin:10px; width:calc(100% - 20px); overflow:hidden; border:1px solid var(--line); border-radius:12px; background:var(--card); }.ux-enhanced-table td { position:static !important; display:flex; align-items:flex-start; justify-content:space-between; gap:15px; padding:10px 12px; white-space:normal; text-align:right !important; }.ux-enhanced-table td::before { content:attr(data-label); color:var(--muted); font-size:9px; font-weight:700; text-align:left; }.ux-enhanced-table td:first-child { background:var(--panel-alt) !important; color:var(--text-strong); font-weight:700; }.ux-enhanced-table .empty-row td { display:block; text-align:center !important; }.ux-enhanced-table .empty-row td::before { display:none; }}
@media (prefers-reduced-motion:reduce){.ux-overlay *,.ux-drawer-overlay *{animation-duration:.01ms!important;transition-duration:.01ms!important;}}.ux-reduce-motion *{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important;}

@media (max-width: 620px) {
  .transaction-edit-form { grid-template-columns: 1fr; }
  .transaction-edit-form .edit-wide, .transaction-edit-total, .transaction-edit-form footer { grid-column: 1; }
  .history-controls { align-items: stretch; flex-direction: column; }
  .history-date-filter { display: grid; grid-template-columns: 1fr 1fr auto; }
  .history-date-filter label { display: grid; }
  .history-date-filter input { width: 100%; }
  .history-page-tools { justify-content: flex-end; }
  .dashboard-filter-bar { align-items: stretch; flex-direction: column; }
  .dashboard-filter-bar .period-switch { max-width: 100%; overflow-x: auto; }
  .dashboard-filter-bar .period-switch button { flex: 0 0 auto; }
}

/* =========================================================
   AUTENTIKASI, ROLE, DAN PENGATURAN V4
   ========================================================= */
.auth-locked .app-shell,
.auth-locked .mobile-menu-button,
.auth-locked .mobile-sidebar-backdrop { display: none !important; }
.auth-gate { position: fixed; inset: 0; z-index: 20000; display: grid; grid-template-columns: minmax(360px, .95fr) minmax(440px, 1.05fr); min-height: 100dvh; overflow: auto; background: radial-gradient(circle at 77% 46%,rgba(78,106,225,.11),transparent 27%),linear-gradient(104deg,#344be0 0%,#5971ed 39%,#aebdf1 49%,#e7ecfa 59%,#f6f8fc 70%,#f6f8fc 100%); }
.auth-gate[hidden] { display: none; }
.auth-visual { position: relative; z-index: 1; display: grid; place-items: center; overflow: hidden; padding: 64px; color: #fff; background: transparent; }
.auth-visual::before,.auth-visual::after { content: ''; position: absolute; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.auth-visual::before { width: 520px; height: 520px; left: -230px; bottom: -210px; }
.auth-visual::after { width: 360px; height: 360px; right: -170px; top: -120px; }
.auth-product-art { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-product-art img { position: absolute; top: 50%; left: -5vw; width: min(1320px,72vw); max-width: none; height: auto; opacity: .09; filter: saturate(.72) contrast(.92); -webkit-mask-image: linear-gradient(90deg,#000 0%,#000 66%,rgba(0,0,0,.88) 76%,rgba(0,0,0,.4) 90%,transparent 100%); mask-image: linear-gradient(90deg,#000 0%,#000 66%,rgba(0,0,0,.88) 76%,rgba(0,0,0,.4) 90%,transparent 100%); transform: translateY(-50%) rotate(-4deg) scale(1.03); transform-origin: center; animation: authArtFloat 14s ease-in-out infinite alternate; }
.auth-visual-content { position: relative; z-index: 1; width: min(470px,100%); }
.auth-brand-mark { width: 94px; height: 128px; display: grid; place-items: center; margin-bottom: 28px; overflow: visible; border: 0; background: transparent; box-shadow: none; }
.auth-brand-mark img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 13px rgba(8,18,55,.32)); }
.auth-visual p { margin: 0 0 12px; color: rgba(255,255,255,.78); font-size: 13px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.auth-visual h2 { max-width: 430px; margin: 0; font-size: clamp(32px,4vw,50px); line-height: 1.08; letter-spacing: -.04em; }
.auth-feature-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 42px; }
.auth-feature-list span { padding: 9px 12px; border: 1px solid rgba(255,255,255,.24); border-radius: 99px; background: rgba(255,255,255,.1); font-size: 12px; font-weight: 650; }
.auth-panel { position: relative; z-index: 1; display: grid; place-items: center; padding: 45px; }
.auth-card { position: relative; z-index: 2; width: min(430px,100%); padding: 36px; border: 1px solid #e1e6f0; border-radius: 24px; background: #fff; box-shadow: 0 24px 70px rgba(31,45,75,.1); }
.auth-logo { display: none; align-items: center; gap: 11px; margin-bottom: 34px; }
.auth-logo > span { width: 48px; height: 62px; display: grid; place-items: center; overflow: visible; border: 0; background: transparent; }
.auth-logo > span img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 7px rgba(15,23,42,.22)); }
.auth-logo strong,.auth-logo small { display: block; }
.auth-logo small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.auth-heading { margin-bottom: 27px; }
.auth-heading > span { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.auth-heading h1 { margin: 7px 0 8px; color: var(--text-strong); font-size: 28px; letter-spacing: -.035em; }
.auth-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.auth-card > label { display: grid; gap: 7px; margin-bottom: 15px; color: var(--text); font-size: 12px; font-weight: 700; }
.auth-card > label[hidden] { display: none !important; }
.auth-card input { width: 100%; height: 46px; }
.auth-password-wrap { position: relative; display: block; }
.auth-password-wrap input { padding-right: 48px; }
.auth-password-wrap button { position: absolute; top: 5px; right: 5px; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; opacity: .65; }
.auth-submit,.auth-switch { width: 100%; min-height: 45px; justify-content: center; }
.auth-link { display: block; margin: 12px auto 0; border: 0; background: transparent; color: var(--primary); cursor: pointer; font-size: 12px; font-weight: 700; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: #a2aabb; font-size: 11px; }
.auth-divider::before,.auth-divider::after { content: ''; height: 1px; flex: 1; background: #e7eaf1; }
.auth-help { margin: 14px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; text-align: center; }
.auth-message { min-height: 18px; margin: -3px 0 10px; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.auth-message.error { color: #bd3448; }
.auth-message.success { color: #168453; }

/* Login mengikuti preferensi tema terakhir tanpa kilatan putih saat halaman dimuat. */
html.theme-dark { background: #0d1523; color-scheme: dark; }
html.theme-dark .auth-gate {
  background:
    radial-gradient(circle at 76% 46%, rgba(74, 101, 210, .12), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(53, 79, 153, .08), transparent 24%),
    linear-gradient(104deg, #101a35 0%, #17264b 38%, #182743 48%, #121e32 61%, #0d1523 78%, #0d1523 100%);
}
html.theme-dark .auth-panel { background: transparent; }
html.theme-dark .auth-visual {
  background: transparent;
}
html.theme-dark .auth-visual::before,
html.theme-dark .auth-visual::after { border-color: rgba(219, 226, 255, .16); }
html.theme-dark .auth-brand-mark,
html.theme-dark .auth-feature-list span { border-color: rgba(224, 229, 255, .24); background: rgba(10, 20, 75, .14); }
html.theme-dark .auth-brand-mark { border: 0; background: transparent; box-shadow: none; }
html.theme-dark .auth-brand-mark img,
html.theme-dark .auth-logo > span img,
html.theme-dark .brand-icon img {
  content: url("assets/logo-jaya-perkasa-supply-dark.png");
  filter: drop-shadow(0 9px 11px rgba(0,0,0,.38));
}
html.theme-dark .auth-product-art img { opacity: .065; filter: saturate(.78) brightness(.88) contrast(1.06); mix-blend-mode: screen; }
html.theme-dark .auth-card {
  border-color: #33435d;
  background: rgba(23, 33, 50, .96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255,255,255,.025);
}
html.theme-dark .auth-heading h1 { color: #f6f8ff; }
html.theme-dark .auth-heading p,
html.theme-dark .auth-help,
html.theme-dark .auth-logo small,
html.theme-dark .auth-message { color: #aebbd0; }
html.theme-dark .auth-card > label { color: #dce5f4; }
html.theme-dark .auth-card input {
  border-color: #40516b;
  background: #202c3e;
  color: #f1f5fb;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.015);
}
html.theme-dark .auth-card input::placeholder { color: #7f8da3; opacity: 1; }
html.theme-dark .auth-card input:focus { border-color: #7892ff; box-shadow: 0 0 0 3px rgba(91,119,255,.18); }
html.theme-dark .auth-password-wrap button { color: #b9c5d7; }
html.theme-dark .auth-divider { color: #7f8da3; }
html.theme-dark .auth-divider::before,
html.theme-dark .auth-divider::after { background: #334158; }
html.theme-dark .auth-switch { border-color: #40516b; background: #243149; color: #dce5f4; }
html.theme-dark .auth-switch:hover { border-color: #53698b; background: #2c3b56; }
html.theme-dark .auth-message.error { color: #ff9aaa; }
html.theme-dark .auth-message.success { color: #8be2b7; }
.auth-card,.auth-visual-content { animation: authReveal .36s ease both; }
.auth-visual-content { animation-delay: .05s; }
@keyframes authReveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes authArtFloat { from { transform: translateY(-50%) rotate(-4deg) scale(1.03); } to { transform: translateY(-51.5%) rotate(-2.5deg) scale(1.055); } }
@media (prefers-reduced-motion: reduce) { .auth-card,.auth-visual-content,.auth-product-art img { animation: none; } }

.sidebar-user { display: grid; grid-template-columns: 38px minmax(0,1fr) 32px; align-items: center; gap: 9px; margin: 22px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-alt); }
.sidebar-user-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #e7ebff; color: var(--primary); font-size: 14px; font-weight: 800; }
.sidebar-user strong,.sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { color: var(--text-strong); font-size: 12px; }
.sidebar-user small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.sidebar-user button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.sidebar-user button:hover { background: #fff; color: #be344b; }
.role-chip { display: inline-flex; padding: 7px 11px; border-radius: 99px; background: #e7ebff; color: var(--primary); font-size: 11px; font-weight: 800; }

.settings-content { display: grid; gap: 22px; padding: 34px clamp(34px,4vw,62px) 64px; }
.settings-tabs { display: flex; gap: 6px; padding: 6px; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--card); box-shadow: var(--shadow-flat); }
.settings-tabs button { min-height: 38px; flex: 0 0 auto; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700; }
.settings-tabs button.active { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(73,91,240,.2); }
.settings-panel { min-width: 0; }
.settings-panel[hidden] { display: none; }
.settings-card { min-height: 300px; padding: 26px; }
.settings-card > .card-header { align-items: flex-start; gap: 22px; margin: 0 0 20px; padding: 0; }
.settings-card > .card-header h2 { margin-top: 0; }
.settings-card > .card-header .table-header-actions { flex: 1; flex-wrap: nowrap; }
.settings-card > .card-header .table-header-actions select { min-width: 190px; max-width: 220px; }
.settings-category-select, .settings-filter-select { width: 220px; min-width: 190px; }
.settings-category-select .smart-select-trigger, .settings-filter-select .smart-select-trigger { height: 36px; border-color: var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.settings-category-select .smart-select-menu, .settings-filter-select .smart-select-menu { min-width: 220px; }
.settings-category-select button.smart-select-option, .settings-filter-select button.smart-select-option { width: 100%; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; }
.settings-category-select button.smart-select-option:hover, .settings-filter-select button.smart-select-option:hover { background: #f2f5ff; color: #3f5fe8; }
.settings-category-select button.smart-select-option.selected, .settings-filter-select button.smart-select-option.selected { background: #eef2ff; color: #3f5fe8; }
.settings-card > .card-header .table-header-actions .table-filter { width: min(280px,28vw); }
.settings-card .table-wrap { width: 100%; max-height: none; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.settings-card .table-wrap table { min-width: 820px; }
.settings-panel[data-settings-panel="users"] .settings-card { min-height: 0; }
.user-table-wrap { min-height: 0; }
.settings-summary { margin: 2px 0 16px; color: var(--muted); font-size: 12px; }
.master-actions { min-width: 170px; white-space: nowrap; }
.master-actions .btn + .btn { margin-left: 5px; }
.master-editor-modal { width: min(720px,100%); padding: 28px; }
.master-editor-modal > header { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.master-editor-fields { grid-column: 1/-1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.master-editor-fields .master-field { display: grid; gap: 8px; margin: 0; color: var(--text); font-size: 12px; font-weight: 700; }
.master-field-label { color: var(--text); font-size: 11px; font-weight: 750; letter-spacing: .01em; }
.master-editor-fields .master-field > input { height: 48px; border-radius: 11px; background: var(--panel-alt); transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.master-editor-fields .master-field > input:focus { background: var(--card); }
.master-form-select .smart-select-trigger { height: 48px; border-radius: 11px; background: var(--panel-alt); font-weight: 650; }
.master-form-select .smart-select-menu { z-index: 10060; }
.master-form-select button.smart-select-option { width: 100%; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; }
.master-form-select button.smart-select-option:hover { background: #f2f5ff; color: #3f5fe8; }
.master-form-select button.smart-select-option.selected { background: #eef2ff; color: #3f5fe8; }
.master-toggle, .status-switch { position: relative; display: inline-flex; align-items: center; gap: 11px; margin: 0; cursor: pointer; user-select: none; }
.master-toggle { min-height: 62px; margin-top: 18px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-alt); transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.master-toggle:hover { border-color: #b9c5e2; }
.master-toggle.is-on { border-color: #b9c5ff; background: #f4f6ff; }
.master-toggle input, .status-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.status-switch-track { width: 39px; height: 23px; flex: 0 0 auto; padding: 3px; border-radius: 99px; background: #aeb8c8; box-shadow: inset 0 1px 2px rgba(31,45,75,.15); transition: background .2s ease, box-shadow .2s ease; }
.status-switch-track i { width: 17px; height: 17px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(24,34,53,.25); transition: transform .22s cubic-bezier(.22,.8,.25,1); }
.is-on .status-switch-track { background: #4767f4; box-shadow: 0 0 0 3px rgba(71,103,244,.12); }
.is-on .status-switch-track i { transform: translateX(16px); }
.status-switch input:focus-visible + .status-switch-track, .master-toggle input:focus-visible + .status-switch-track { outline: 3px solid rgba(71,103,244,.24); outline-offset: 2px; }
.status-switch-copy { display: grid; gap: 2px; line-height: 1.15; }
.status-switch-copy strong { color: var(--text-strong); font-size: 11px; }
.status-switch-copy small { color: var(--muted); font-size: 9.5px; font-weight: 500; white-space: nowrap; }
.user-role-select { width: 165px; min-width: 165px; }
.user-role-select .smart-select-trigger { height: 40px; border-radius: 10px; background: var(--panel-alt); font-size: 12px; font-weight: 700; }
.user-role-select .smart-select-menu { z-index: 10030; min-width: 205px; }
.user-role-select.open .smart-select-menu { position: fixed; top: var(--role-menu-top); right: auto; left: var(--role-menu-left); width: 215px; transform-origin: top; }
.user-role-select.open .smart-select-menu.opens-above { transform-origin: bottom; }
.user-role-select button.smart-select-option { width: 100%; height: auto; min-height: 52px; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; }
.user-role-select button.smart-select-option:hover { background: #f2f5ff; }
.user-role-select button.smart-select-option.selected { background: #eef2ff; color: #3f5fe8; }
.user-row-self { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.user-role-select.is-locked .smart-select-trigger { cursor: not-allowed; opacity: .72; }
.status-switch.is-locked { cursor: not-allowed; opacity: .72; }
.status-switch.is-locked .status-switch-track { box-shadow: none; }
.self-lock-note { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.role-option-copy { display: grid; gap: 3px; }
.role-option-copy strong { color: var(--text-strong); font-size: 12px; }
.role-option-copy small { color: var(--muted); font-size: 9.5px; font-weight: 500; }
.role-option.selected .role-option-copy strong { color: #3f5fe8; }
.permission-guide { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.permission-guide span { padding: 8px 11px; border-radius: 9px; background: var(--panel-alt); color: var(--muted); font-size: 11px; }
.permission-guide b { color: var(--text-strong); }
.audit-action { display: inline-flex; padding: 4px 7px; border-radius: 99px; font-size: 10px; font-weight: 750; }
.audit-action.insert { background: #e7f8ef; color: #168453; }
.audit-action.update { background: #edf0ff; color: #4357d7; }
.audit-action.delete { background: #fff0f2; color: #b83e51; }

body:not(.role-admin) .btn-delete-transaction,
body:not(.role-admin) #clearTransactions,
body:not(.role-admin) #deleteAllStock,
body:not(.role-admin) #deleteAllPackaging,
body:not(.role-admin) #deletePackagingStoreBtn,
body:not(.role-admin) .delete-btn-confirm,
body:not(.role-admin) [data-action='show-cancel'] { display: none !important; }

/* Pengaturan aplikasi hanya boleh terlihat oleh Admin. */
.admin-only[hidden],
body:not(.role-admin) .admin-only,
body:not(.role-admin) .nav-item[data-view='pengaturan'],
body:not(.role-admin) #view-pengaturan { display: none !important; }

body.role-viewer .btn-edit-transaction,
body.role-viewer #printForm button[type='submit'],
body.role-viewer #packagingForm button[type='submit'],
body.role-viewer #packagingImportForm button[type='submit'],
body.role-viewer #stockImportForm button[type='submit'],
body.role-viewer #savePackagingImport,
body.role-viewer #saveStockImport,
body.role-viewer #simpleJournalForm button[type='submit'],
body.role-viewer [data-action='create-receivable'],
body.role-viewer #invoicePaymentForm button[type='submit'] { display: none !important; }
body:not(.role-admin) #accountForm button[type='submit'],
body:not(.role-admin) #saveQuickOpeningCapital,
body:not(.role-admin) #openingBalanceForm button[type='submit'],
body:not(.role-admin) #addOpeningBalanceLine { display: none !important; }

/* Viewer adalah akses baca penuh: laporan dan filter tetap tersedia, semua area input disembunyikan. */
body.role-viewer .admin-only,
body.role-viewer .nav-item[data-view='pengaturan'],
body.role-viewer #view-pengaturan,
body.role-viewer #view-proses-cetak > .content > .page-grid,
body.role-viewer #view-packaging > .content > .page-grid,
body.role-viewer #view-packaging-import > .content > .page-grid,
body.role-viewer #view-ambil-stock > .content > .page-grid,
body.role-viewer #view-packaging-import > .content > .table-card:nth-of-type(1),
body.role-viewer #view-ambil-stock > .content > .table-card:nth-of-type(1),
body.role-viewer [data-accounting-tab='cash'],
body.role-viewer [data-accounting-panel='cash'],
body.role-viewer .accounting-account-grid > .form-card,
body.role-viewer [data-action='start-receivable-selection'],
body.role-viewer [data-action='create-receivable'],
body.role-viewer [data-action='show-cancel'],
body.role-viewer .invoice-selection-list,
body.role-viewer .invoice-selection-actions,
body.role-viewer #invoicePaymentForm,
body.role-viewer #invoiceCancelForm,
body.role-viewer #openingBalanceForm,
body.role-viewer #saveQuickOpeningCapital,
body.role-viewer #addOpeningBalanceLine,
body.role-viewer .btn-edit-transaction,
body.role-viewer .btn-delete-transaction,
body.role-viewer #savePackagingImport,
body.role-viewer #saveStockImport { display: none !important; }

body.role-viewer .accounting-account-grid { grid-template-columns: minmax(0, 1fr); }

body.dark-theme .sidebar-user,
body.dark-theme .permission-guide span { background: var(--panel-alt); }
body.dark-theme .master-editor-modal > header { border-color: #3a4961; }
body.dark-theme .master-editor-fields .master-field > input,
body.dark-theme .master-form-select .smart-select-trigger,
body.dark-theme .user-role-select .smart-select-trigger,
body.dark-theme .master-toggle { background: #202b3c; border-color: #3a4961; }
body.dark-theme .master-toggle.is-on { background: #253457; border-color: #516cc9; }
body.dark-theme .master-form-select button.smart-select-option:hover,
body.dark-theme .user-role-select button.smart-select-option:hover { background: #263957; color: #c7d2ff; }
body.dark-theme .master-form-select button.smart-select-option.selected,
body.dark-theme .user-role-select button.smart-select-option.selected { background: #2e4381; color: #fff; }
body.dark-theme .role-option-copy strong { color: #e7edf8; }
body.dark-theme .role-option.selected .role-option-copy strong { color: #fff; }
body.dark-theme .sidebar-user-avatar,.dark-theme .role-chip { background: #293963; color: #b9c3ff; }
body.dark-theme .sidebar-user button:hover { background: #29364a; }
body.dark-theme .audit-action.insert { background: #17392f; color: #8be2b7; }
body.dark-theme .audit-action.update { background: #293963; color: #b9c3ff; }
body.dark-theme .audit-action.delete { background: #442830; color: #ff9aaa; }

@media (max-width: 860px) {
  .auth-gate { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-product-art { display: block; }
  .auth-product-art img {
    top: 42%;
    left: 50%;
    width: min(920px,190vw);
    opacity: .055;
    -webkit-mask-image: linear-gradient(180deg,rgba(0,0,0,.76) 0%,#000 18%,rgba(0,0,0,.78) 68%,transparent 100%);
    mask-image: linear-gradient(180deg,rgba(0,0,0,.76) 0%,#000 18%,rgba(0,0,0,.78) 68%,transparent 100%);
    transform: translate(-50%,-50%) rotate(-4deg) scale(1.03);
    animation: none;
  }
  html.theme-dark .auth-product-art img { opacity: .045; }
  .auth-logo { display: flex; }
  .auth-panel { padding: 24px; }
}
@media (max-width: 620px) {
  .auth-panel { padding: 14px; }
  .auth-card { padding: 25px 20px; border-radius: 18px; }
  .master-editor-fields { grid-template-columns: 1fr; }
  .master-editor-modal { padding: 22px 18px; }
  .master-toggle { margin-top: 0; }
  .settings-content { padding: 22px 16px 48px; }
  .settings-card { padding: 18px; }
  .settings-card > .card-header .table-header-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .settings-card > .card-header .table-header-actions select,
  .settings-card > .card-header .table-header-actions .table-filter { width: 100%; max-width: none; }
  .settings-category-select, .settings-filter-select { width: 100%; min-width: 0; }
  .settings-card .table-wrap { max-height: none; }
}

/* =========================================================
   KONSISTENSI SELURUH DROPDOWN PADA TEMA GELAP
   Diletakkan paling akhir agar komponen khusus tidak kembali
   menimpa warna gelap dengan state terang.
   ========================================================= */
body.dark-theme select { color-scheme: dark; }
body.dark-theme .smart-select .smart-select-trigger {
  border-color: #40516b;
  background: #202b3c;
  color: #e7edf8;
}
body.dark-theme .smart-select.open .smart-select-trigger {
  border-color: #7892ff;
  background: #243249;
  box-shadow: 0 0 0 3px rgba(91,119,255,.2);
}
body.dark-theme .smart-select .smart-select-menu {
  border-color: #40516b !important;
  background: #182334 !important;
  color: #dce5f3;
  box-shadow: 0 18px 42px rgba(0,0,0,.42);
}
body.dark-theme .smart-select .smart-select-search-wrap {
  border-color: #3b4a62;
  background: #202b3c;
}
body.dark-theme .smart-select .smart-select-search,
body.dark-theme .smart-select .smart-select-search::placeholder {
  color: #c8d3e5 !important;
}
body.dark-theme .smart-select button.smart-select-option {
  background: transparent !important;
  color: #d6e0ef !important;
}
body.dark-theme .smart-select button.smart-select-option:hover,
body.dark-theme .smart-select button.smart-select-option:focus-visible {
  background: #263957 !important;
  color: #c7d2ff !important;
}
body.dark-theme .smart-select button.smart-select-option.selected,
body.dark-theme .smart-select button.smart-select-option[aria-selected="true"] {
  background: #2e4381 !important;
  color: #fff !important;
}
body.dark-theme .smart-select button.smart-select-option.empty,
body.dark-theme .smart-select button.smart-select-option.empty:hover {
  background: transparent !important;
  color: #94a1b5 !important;
}
body.dark-theme .smart-select .role-option-copy strong { color: #e7edf8; }
body.dark-theme .smart-select button.smart-select-option.selected .role-option-copy strong { color: #fff; }
body.dark-theme .smart-select .smart-select-options {
  scrollbar-color: #53647e #182334;
}
body.dark-theme .smart-select .smart-select-options::-webkit-scrollbar-track { background: #182334; }
body.dark-theme .smart-select .smart-select-options::-webkit-scrollbar-thumb { background: #53647e; }

/* State hover/fokus kanonik untuk seluruh dropdown aplikasi. */
.smart-select .smart-select-trigger:not(:disabled):hover {
  border-color: #9eafff !important;
  background: #f8f9ff !important;
  box-shadow: 0 0 0 2px rgba(71,103,244,.10);
}
.smart-select .smart-select-option:not(.empty):not(:disabled) {
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.smart-select .smart-select-option:not(.empty):not(:disabled):hover,
.smart-select .smart-select-option:not(.empty):not(:disabled):focus-visible {
  outline: none;
  background: #eef2ff !important;
  color: #3f5fe8 !important;
  box-shadow: inset 0 0 0 1px rgba(71,103,244,.04);
}
.smart-select .smart-select-option:not(.empty):not(:disabled):hover .role-option-copy strong,
.smart-select .smart-select-option:not(.empty):not(:disabled):focus-visible .role-option-copy strong {
  color: #3f5fe8 !important;
}
body.dark-theme .smart-select .smart-select-trigger:not(:disabled):hover {
  border-color: #7892ff !important;
  background: #243249 !important;
  box-shadow: 0 0 0 2px rgba(91,119,255,.16);
}
body.dark-theme .smart-select .smart-select-option:not(.empty):not(:disabled):hover,
body.dark-theme .smart-select .smart-select-option:not(.empty):not(:disabled):focus-visible {
  background: #2a3d63 !important;
  color: #cbd5ff !important;
  box-shadow: inset 0 0 0 1px rgba(125,148,255,.08);
}
body.dark-theme .smart-select .smart-select-option:not(.empty):not(:disabled):hover .role-option-copy strong,
body.dark-theme .smart-select .smart-select-option:not(.empty):not(:disabled):focus-visible .role-option-copy strong {
  color: #cbd5ff !important;
}
