:root {
  color-scheme: light;
  --paper: #f6f1e6;
  --paper-deep: #eee6d3;
  --sheet: #fffdf6;
  --ink: #211c14;
  --ink-hover: #3a3122;
  --ink-soft: #524a39;
  --ink-faint: #8a7e66;
  --line: #ddd2b8;
  --line-strong: #c4b78f;
  --stamp: #bd3826;
  --stamp-hover: #a02c1c;
  --stamp-focus: rgba(189, 56, 38, 0.3);
  --good: #2f6b34;
  --good-bg: #e5edda;
  --good-border: #b9c9a4;
  --danger: #b3381f;
  --danger-bg: #f9e9e2;
  --danger-border: #e0a795;
  --warning: #8a5a16;
  --warning-bg: #f7ecd4;
  --warning-border: #e0c895;
  --font-display: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;
  --fs-meta: 12px;
  --fs-small: 14px;
  --fs-body: 16px;
  --radius: 4px;
  --radius-sm: 3px;
  --ease-out: cubic-bezier(0.22, 0.61, 0.21, 1);
  --transition: 150ms var(--ease-out);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.6) 0%, rgba(255, 253, 246, 0) 320px),
    var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 84px;
}

::selection { background: var(--stamp); color: var(--sheet); }

a { color: var(--stamp); }
a, button { -webkit-tap-highlight-color: transparent; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--stamp-focus);
  outline-offset: 2px;
}

/* === Layout === */
.container {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 16px 16px 24px;
}

.card {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

/* === Header / Nav === */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.page-header .muted {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 20px 18px 18px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--stamp);
}

.dashboard-hero__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.dashboard-hero__identity { min-width: 0; }

.dashboard-hero__warung {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.dashboard-hero__logout {
  width: auto;
  min-width: 72px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid rgba(246, 241, 230, 0.4);
  background: transparent;
  color: var(--paper);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.dashboard-hero__logout:hover:not(:disabled) { background: rgba(246, 241, 230, 0.12); }

.dashboard-hero__greeting {
  margin: 5px 0 0;
  color: rgba(246, 241, 230, 0.75);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.dashboard-hero__datetime {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: rgba(246, 241, 230, 0.6);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.03em;
}

.dashboard-hero__cash {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(246, 241, 230, 0.25);
}

.dashboard-hero__cash-label {
  margin: 0;
  color: rgba(246, 241, 230, 0.6);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.dashboard-hero__cash-value {
  margin: 5px 0 0;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 34px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.dashboard-hero__mini-summary {
  margin: 8px 0 0;
  color: rgba(246, 241, 230, 0.8);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.65;
}

.dashboard-hero__mini-summary strong {
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dashboard-hero__cash-breakdown {
  display: block;
  margin-top: 3px;
  color: rgba(246, 241, 230, 0.6);
  font-size: var(--fs-meta);
  font-weight: 500;
}

.dashboard-hero__cash-breakdown strong { font-size: var(--fs-meta); }

.dashboard-hero__footer {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(246, 241, 230, 0.1);
  color: rgba(246, 241, 230, 0.75);
}

.connection-status.online {
  background: rgba(47, 107, 52, 0.4);
  color: #c4e0bd;
}

.connection-status.offline {
  background: rgba(138, 90, 22, 0.45);
  color: #f0d5a8;
}

.nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.nav-link {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--sheet);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.nav-link:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.nav-link.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  text-decoration: none;
  color: var(--stamp);
  font-weight: 700;
  font-size: var(--fs-small);
  transition: color var(--transition);
}

.back-link:hover { color: var(--stamp-hover); text-decoration: underline; text-underline-offset: 3px; }

/* === Typography === */
.title {
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.nominal {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.riwayat-amount--masuk { color: var(--good); }
.riwayat-amount--keluar { color: var(--danger); }
.riwayat-amount--non_kas { color: var(--warning); }
.riwayat-amount--voided {
  color: var(--ink-faint);
  text-decoration: line-through;
}
.riwayat-item--voided { opacity: 0.75; }

.muted { color: var(--ink-soft); }
.error { color: var(--danger); font-weight: 600; min-height: 24px; }
.hidden { display: none !important; }
.small { font-size: 13px; }
.text-right { text-align: right; }

/* === Forms === */
label {
  display: block;
  font-family: var(--font-mono);
  font-weight: 600;
  margin: 14px 0 7px;
  font-size: var(--fs-meta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

label:first-child { margin-top: 0; }

input, select, textarea {
  width: 100%;
  min-height: 52px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 16px;
  font-family: var(--font-display);
  color: var(--ink);
  background: var(--sheet);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:hover, select:hover, textarea:hover {
  border-color: var(--ink-faint);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--stamp);
  box-shadow: 0 0 0 3px var(--stamp-focus);
}

input[type="number"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

input::placeholder, textarea::placeholder { color: var(--ink-faint); opacity: 0.8; }

textarea {
  min-height: 88px;
  padding: 12px 14px;
  resize: vertical;
}

select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23524a39' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.product-combobox {
  position: relative;
}

.product-combobox input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.product-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--sheet);
  box-shadow: 0 10px 24px rgba(37, 33, 24, 0.16);
}

.product-option {
  width: 100%;
  min-height: 52px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.product-option:last-child { border-bottom: 0; }
.product-option:hover, .product-option:focus { background: var(--paper); }
.product-option__name { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.product-option__price { flex-shrink: 0; color: var(--ink-soft); font-family: var(--font-mono); font-size: 12px; }

.product-options__status {
  margin: 0;
  padding: 14px;
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
}

.form-row {
  display: flex;
  gap: 8px;
}

.form-row > * { flex: 1; }

.form-error {
  color: var(--danger);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12.5px;
  min-height: 20px;
  margin: 8px 0 0;
}

/* === Buttons === */
button, .button {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), opacity var(--transition);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  cursor: progress;
  opacity: 0.55;
}

.primary {
  background: var(--ink);
  color: var(--paper);
}

.primary:hover:not(:disabled) { background: var(--ink-hover); }
.primary:active:not(:disabled) { background: var(--ink); }

.secondary {
  background: var(--sheet);
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
}

.secondary:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--paper-deep);
}

.danger {
  background: var(--danger);
  color: var(--sheet);
}

.danger:hover:not(:disabled) { background: #93290f; }

.btn-sm {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Button with spinner */
button[data-loading="true"] .btn-spinner { display: inline-block; }
button[data-loading="true"] .btn-label { opacity: 0.85; }
.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(246, 241, 230, 0.4);
  border-top-color: var(--paper);
  display: none;
  animation: spin 720ms linear infinite;
}

.secondary .btn-spinner {
  border-color: rgba(33, 28, 20, 0.25);
  border-top-color: var(--ink);
}

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

/* === Summary band === */
.summary {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-faint);
}

.summary-income { border-left-color: var(--good); }
.summary-expense { border-left-color: var(--danger); }
.summary-neutral { border-left-color: var(--warning); }

.summary-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--sheet);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.summary-income .summary-icon { color: var(--good); border-color: var(--good-border); }
.summary-expense .summary-icon { color: var(--danger); border-color: var(--danger-border); }
.summary-neutral .summary-icon { color: var(--warning); border-color: var(--warning-border); }

.summary-content { flex: 1; min-width: 0; }
.summary-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.summary-value {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
  letter-spacing: -0.01em;
}
.summary-income .summary-value { color: var(--good); }
.summary-expense .summary-value { color: var(--danger); }
.summary-neutral .summary-value { color: var(--warning); }

.summary-extra { font-size: var(--fs-meta); color: var(--ink-soft); margin-top: 2px; }

/* === Filter Bar === */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
  align-items: center;
}

.btn-filter {
  width: auto;
  padding: 7px 13px;
  min-height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--sheet);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  color: var(--ink-soft);
}

.btn-filter:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-filter.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.filter-date-input {
  width: auto;
  min-height: 38px;
  padding: 4px 10px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

/* === List Items === */
.list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.list-item {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--transition), background var(--transition);
  animation: item-in 200ms var(--ease-out) both;
}

.list-item:hover {
  border-color: var(--line-strong);
  background: var(--paper);
}

@keyframes item-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.list-item[data-type="income"] { border-left: 3px solid var(--good); }
.list-item[data-type="expense"] { border-left: 3px solid var(--danger); }
.list-item[data-type="kasbon"] { border-left: 3px solid var(--warning); }

.list-item .item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.list-item .main {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.list-item .amount {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.list-item[data-type="income"] .amount { color: var(--good); }
.list-item[data-type="expense"] .amount { color: var(--danger); }

.list-item .meta {
  font-size: 13px;
  color: var(--ink-soft);
}

.list-item .meta strong,
.list-item .meta { font-variant-numeric: tabular-nums; }

.list-item .actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* === Badge === */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--paper-deep);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
}

.badge-belum {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}

.badge-lunas {
  background: var(--good-bg);
  border-color: var(--good-border);
  color: var(--good);
}

/* === Kasbon Progress === */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar__fill {
  height: 100%;
  background: var(--good);
  transition: width 300ms var(--ease-out);
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 25, 15, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: overlay-in 150ms var(--ease-out);
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 32px 70px -24px rgba(31, 25, 15, 0.5);
  animation: modal-in 200ms var(--ease-out);
}

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--stamp);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.modal-message {
  font-size: var(--fs-small);
  color: var(--ink-soft);
  margin: 0 0 20px;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.modal-actions button { flex: 1; }

/* Quick amount buttons for kasbon bayar */
.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

.btn-quick-amount {
  width: auto;
  padding: 7px 12px;
  min-height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--sheet);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  color: var(--ink);
  transition: border-color var(--transition), background var(--transition);
}

.btn-quick-amount:hover {
  background: var(--paper-deep);
  border-color: var(--ink);
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--sheet);
  box-shadow: 0 8px 24px rgba(31, 25, 15, 0.28);
  z-index: 9999;
  max-width: 90%;
  text-align: center;
  animation: toast-in 200ms var(--ease-out);
  pointer-events: none;
}

.toast-success { background: var(--good); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast.toast-out {
  opacity: 0;
  transition: opacity 250ms var(--ease-out);
}

/* === Bottom Nav (Mobile) === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--sheet);
  border-top: 1px solid var(--line-strong);
  display: flex;
  z-index: 100;
  padding: 6px 0 env(safe-area-inset-bottom, 0);
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 7px;
  text-decoration: none;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color var(--transition);
  position: relative;
}

.bottom-nav a .nav-icon {
  display: inline-flex;
  line-height: 1;
}

.bottom-nav a.active {
  color: var(--stamp);
}

.bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--stamp);
}

@media (min-width: 640px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--ink-soft);
}

.empty-state__icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.45;
}

.empty-state__text {
  font-size: var(--fs-small);
  line-height: 1.55;
}

/* === Loading Skeleton === */
.skeleton {
  background: linear-gradient(90deg, var(--paper-deep) 25%, var(--line) 50%, var(--paper-deep) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-line {
  height: 16px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
}

.skeleton-line:last-child { margin-bottom: 0; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Menu Grid (Index) === */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.menu-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 14px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
  cursor: pointer;
}

.menu-card:hover {
  border-color: var(--ink);
  background: var(--paper);
  transform: translateY(-2px);
}

.menu-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.menu-card.income .menu-card__icon { color: var(--good); border-color: var(--good-border); }
.menu-card.expense .menu-card__icon { color: var(--danger); border-color: var(--danger-border); }
.menu-card.kasbon .menu-card__icon { color: var(--warning); border-color: var(--warning-border); }

.menu-card__label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.menu-card__desc {
  font-size: var(--fs-meta);
  color: var(--ink-soft);
  line-height: 1.45;
}

/* === Utilities === */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* === Responsive === */
@media (max-width: 480px) {
  .container { padding: 12px 12px 24px; }
  .card { padding: 16px; }
  .title { font-size: 24px; }
  .dashboard-hero { padding: 18px 16px 16px; }
  .dashboard-hero__warung { font-size: 22px; }
  .dashboard-hero__cash-value { font-size: 30px; }
  .dashboard-hero__logout { min-width: 68px; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .list-item, .toast, .modal-overlay, .modal, .menu-card { animation: none; }
  button, .button, .nav-link, .btn-filter, .menu-card, .list-item, .toast, .progress-bar__fill, input, select, textarea { transition: none; }
}

/* === Receipt (Nota) === */
.receipt-modal { max-width: 380px; }
.receipt-paper {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: 16px 12px;
  color: var(--ink);
  background: var(--sheet);
  border: 1px dashed var(--line-strong);
  font-family: var(--font-mono);
  font-size: 12px;
}
.receipt-meta { line-height: 1.5; overflow-wrap: anywhere; }
.receipt-rule { margin: 9px 0; border-top: 1px dashed var(--ink); }
.receipt-item { margin: 0 0 8px; overflow-wrap: anywhere; }
.receipt-item__price,
.receipt-total { display: flex; justify-content: space-between; gap: 8px; }
.receipt-item__price strong,
.receipt-total strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt-total { font-size: 14px; font-weight: 600; }
.receipt-print { display: none; }
.receipt-print-hint {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
}

@media print {
  @page { size: 58mm auto; margin: 0; }
  html,
  body,
  body.printing-receipt {
    width: 58mm !important;
    min-width: 58mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  body.printing-receipt > *:not(.receipt-print) { display: none !important; }
  body.printing-receipt .receipt-print {
    display: block !important;
    width: 58mm !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #000 !important;
    background: #fff !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  body.printing-receipt .receipt-paper {
    width: 58mm !important;
    max-width: 58mm !important;
    margin: 0 !important;
    padding: 3mm 4mm 5mm !important;
    border: 0 !important;
    box-sizing: border-box;
    font-size: 10px;
    line-height: 1.3;
  }
  body.printing-receipt .receipt-total { font-size: 12px; }
}

/* === Product Combobox Browse Button === */
.product-combobox__input-wrap {
  display: flex;
  gap: 0;
}

.product-combobox__input-wrap input[type="search"] {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.product-combobox__browse {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-left: none;
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.product-combobox__browse:hover,
.product-combobox__browse:focus {
  background: var(--line);
  color: var(--ink);
}

.link-btn {
  background: none;
  border: none;
  color: var(--stamp);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  color: var(--stamp-hover);
}

/* === Product Browser Modal === */
.product-browser-modal {
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.product-browser__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.product-browser__header .modal-title {
  margin: 0;
}

.product-browser__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.product-browser__close:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.product-browser__search {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.product-browser__search input {
  width: 100%;
  margin: 0;
}

.product-browser__info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-small);
}

.product-browser__list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.product-browser__item {
  width: 100%;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}

.product-browser__item:last-child {
  border-bottom: none;
}

.product-browser__item:hover,
.product-browser__item:focus {
  background: var(--paper-deep);
}

.product-browser__item-info {
  flex: 1;
  min-width: 0;
}

.product-browser__item-name {
  font-weight: 700;
  font-size: var(--fs-body);
  overflow-wrap: anywhere;
}

.product-browser__item-prices {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: var(--fs-meta);
  color: var(--ink-soft);
}

.product-browser__item-retail {
  color: var(--good);
}

.product-browser__item-grosir {
  color: var(--warning);
}

.product-browser__item-stok {
  color: var(--ink-muted);
}

.product-browser__item-action {
  flex-shrink: 0;
}

.product-browser__item-select {
  min-height: 36px;
  padding: 6px 14px;
  font-size: var(--fs-small);
}

/* === Product Browser Empty State === */
.product-browser__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
}

.product-browser__empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.product-browser__empty-text {
  font-size: var(--fs-small);
  margin: 0;
}

/* === Stock Management (Master Barang) === */

/* Filter stok: grid responsif. Di hape: Cari (baris 1), Status+Kondisi
   (baris 2), Batas Minimum (baris 3). Di layar lebar: satu baris penuh. */
.stock-filter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.stock-filter__status,
.stock-filter__kondisi {
  grid-column: span 1;
}

@media (min-width: 420px) {
  .stock-filter {
    grid-template-columns: 1fr 1fr;
  }

  .stock-filter__search,
  .stock-filter__batas {
    grid-column: span 2;
  }
}

@media (min-width: 760px) {
  .stock-filter {
    grid-template-columns: 2fr 1fr 1fr 1.4fr;
    align-items: end;
  }

  .stock-filter__search,
  .stock-filter__status,
  .stock-filter__kondisi,
  .stock-filter__batas {
    grid-column: span 1;
  }
}

.stock-limit-control {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stock-limit-control input {
  min-width: 0;
}

.badge-stock-minus {
  background: #fee2e2;
  color: #991b1b;
}

.badge-stock-empty {
  background: #f3f4f6;
  color: #374151;
}

.badge-stock-low {
  background: #fef3c7;
  color: #92400e;
}

.badge-stock-safe {
  background: #dcfce7;
  color: #166534;
}

.stock-history-list {
  max-height: 60vh;
  overflow-y: auto;
}

.stock-history-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.stock-history-item:last-child {
  border-bottom: none;
}

.stock-delta-positive {
  color: var(--good);
}

.stock-delta-negative {
  color: var(--danger);
}

.modal-wide {
  max-width: 520px;
}
