* { box-sizing: border-box; }

:root {
  /* Fallback bila tenant belum set tema (sama dengan aksen indigo sebelumnya). */
  --tenant-theme-seed: #4f46e5;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: 160ms ease-out both fade-out;
}

::view-transition-new(root) {
  animation: 220ms ease-out both fade-in;
}

@keyframes fade-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0.985; transform: translateY(4px); }
}

@keyframes fade-in {
  from { opacity: 0.985; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.55rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms, color 150ms;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  color: #4b5563;
}

.nav-link:hover {
  background-color: #f3f4f6;
  color: #1f2937;
}

.nav-link .nav-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  font-size: 0.75rem;
}

.nav-link:hover .nav-icon {
  background-color: #e5e7eb;
}

.nav-link.nav-active {
  background-color: color-mix(in srgb, var(--tenant-theme-seed) 14%, white);
  color: color-mix(in srgb, var(--tenant-theme-seed) 72%, #1e1b4b);
  font-weight: 600;
}

.nav-link.nav-active .nav-icon {
  background-color: color-mix(in srgb, var(--tenant-theme-seed) 28%, white);
  color: var(--tenant-theme-seed);
}

.nav-link .nav-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.nav-link-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-menu-badge {
  flex-shrink: 0;
  min-width: 1.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.nav-link.nav-active .nav-menu-badge {
  background: #dc2626;
  color: #fff;
}

[data-sidebar-nav].nav-active {
  outline: 2px solid color-mix(in srgb, var(--tenant-theme-seed) 24%, transparent);
  outline-offset: 1px;
}

a[data-sidebar-nav].nav-active {
  background-color: color-mix(in srgb, var(--tenant-theme-seed) 14%, white);
  color: color-mix(in srgb, var(--tenant-theme-seed) 72%, #1e1b4b);
}

.sidebar-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: #c7d2fe;
  border-radius: 4px;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 0.5rem;
  margin: 1rem 0 0.375rem;
}

.nav-section-label-tight {
  margin-top: 0;
}

.nav-link-danger {
  color: #ef4444;
}

.nav-link-danger .nav-icon {
  color: #ef4444;
}

.nav-link-danger:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

.nav-link-danger:hover .nav-icon {
  background-color: #fee2e2;
  color: #dc2626;
}

.nav-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 0.625rem 0.5rem;
}

.panel-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
}

.table-shell {
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fff;
}

/* Modal inventori tertutup tidak boleh menangkap klik di halaman stok */
[id^="modal-"][aria-hidden="true"] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Utang piutang & modal manajemen — di atas tombol AI (z-index 9999) */
.hp-modal-overlay {
  z-index: 10050 !important;
}

.hp-modal-sheet {
  max-height: min(92vh, 100%);
  display: flex;
  flex-direction: column;
}

.hp-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hp-modal-actions {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom, 0px) + 0.5rem);
  border-top: 1px solid #f3f4f6;
  background: #fff;
}

body.hp-modal-open #ai-btn,
body.hp-modal-open #ai-panel {
  display: none !important;
  pointer-events: none !important;
}

.hp-modal-msg {
  min-height: 1.25rem;
  font-size: 0.75rem;
  line-height: 1.35;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}

.hp-modal-msg.is-error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.hp-modal-msg.is-ok {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.cash-page {
  --cash-accent: #475569;
  --cash-soft: #f8fafc;
  --cash-header: #f8fafc;
  --cash-header-text: #475569;
}

.cash-page[data-theme="indigo"] {
  --cash-accent: #4f46e5;
  --cash-soft: #eef2ff;
  --cash-header: #eef2ff;
  --cash-header-text: #3730a3;
}

.cash-page[data-theme="emerald"] {
  --cash-accent: #059669;
  --cash-soft: #ecfdf5;
  --cash-header: #ecfdf5;
  --cash-header-text: #047857;
}

.cash-table-card {
  border-color: color-mix(in srgb, var(--cash-accent) 12%, #e5e7eb);
}

.cash-table thead {
  background: var(--cash-header);
  color: var(--cash-header-text);
}

.cash-table tbody tr.cash-table-row-tenant:hover {
  background-color: color-mix(in srgb, #4f46e5 10%, #eef2ff);
}

.cash-table tbody tr:hover {
  background: color-mix(in srgb, var(--cash-soft) 78%, white);
}

.cash-sort-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.cash-sort-btn:hover {
  color: var(--cash-accent, #6366f1);
}

.cash-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.cash-status-chip.active {
  background: #dcfce7;
  color: #166534;
}

.cash-status-chip.inactive {
  background: #f3f4f6;
  color: #6b7280;
}

/* Matriks penjualan foodcourt: kolom outlet mengikuti nama terpanjang, dibatasi untuk nama ekstrem */
.fc-matrix-outlet-th,
.fc-matrix-outlet-td {
  width: max-content;
  max-width: min(24rem, 55vw);
  white-space: nowrap;
}

.fc-matrix-outlet-th {
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-weight: 600;
  position: sticky;
  left: 0;
  z-index: 20;
  background-color: #f9fafb;
  box-shadow: 2px 0 0 rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid #f3f4f6;
}

.fc-matrix-outlet-td {
  padding: 0.5rem 0.75rem;
  position: sticky;
  left: 0;
  z-index: 10;
  font-weight: 500;
  color: #1f2937;
  box-shadow: 2px 0 0 rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid #f3f4f6;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-matrix-outlet-td.fc-matrix-outlet-td--stripe {
  background-color: #f9fafb;
}

.fc-matrix-outlet-td:not(.fc-matrix-outlet-td--stripe) {
  background-color: #fff;
}

.fc-matrix-outlet-chevron {
  transform: rotate(0deg);
}

.fc-matrix-outlet-chevron.fc-matrix-outlet-chevron--open {
  transform: rotate(90deg);
}

.fc-matrix-payment-detail td {
  vertical-align: middle;
}

.fc-matrix-payment-detail-first {
  position: sticky;
  left: 0;
  z-index: 9;
  width: max-content;
  max-width: min(24rem, 55vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 2px 0 0 rgba(0, 0, 0, 0.05);
}

/* Tooltip detail item / ongkir — riwayat penjualan */
.sh-lines-tooltip {
  position: fixed;
  z-index: 80;
  max-width: min(22rem, calc(100vw - 1rem));
  max-height: min(16rem, calc(100vh - 1rem));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
}

/* Jembatan hover agar kursor bisa pindah dari sel tabel ke tooltip tanpa hilang */
.sh-lines-tooltip::before {
  content: "";
  position: absolute;
  left: -0.5rem;
  right: -0.5rem;
  top: -1rem;
  height: 1rem;
}

.sh-item-cell:hover,
.sh-shipping-cell:hover {
  color: #4f46e5;
}

/* Pesanan Online — kolom Trx/Pelanggan tetap terlihat saat scroll horizontal (mobile) */
@media (max-width: 767px) {
  #po-table-wrap .po-sticky-customer-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #fff;
    box-shadow: 4px 0 8px -4px rgba(15, 23, 42, 0.12);
  }

  #po-table-wrap thead .po-sticky-customer-col {
    z-index: 3;
    background-color: #f9fafb;
  }

  #po-table-wrap tbody tr:hover .po-sticky-customer-col {
    background-color: #f9fafb;
  }
}

/* Pengaturan tenant — mobile-first toggle rows */
.settings-page {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

.settings-section {
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #fff;
  overflow: hidden;
}

.settings-section + .settings-section {
  margin-top: 0.75rem;
}

.settings-section-head {
  padding: 0.875rem 1rem;
  background: linear-gradient(to bottom, #f9fafb, #fff);
  border-bottom: 1px solid #f3f4f6;
}

.settings-section-head h3 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #374151;
  letter-spacing: 0.02em;
}

.settings-section-head p {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #6b7280;
}

.settings-section-body {
  padding: 0.25rem 0;
}

.settings-field {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.settings-field:last-child {
  border-bottom: none;
}

.settings-field label.settings-field-label {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b5563;
}

.settings-field input[type="text"],
.settings-field input[type="number"],
.settings-field input[type="time"],
.settings-field select {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: #374151;
}

.settings-field input[readonly] {
  background: #f9fafb;
  color: #6b7280;
}

.settings-field-hint {
  font-size: 0.6875rem;
  font-weight: 400;
  color: #9ca3af;
  line-height: 1.35;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 3.25rem;
}

.settings-toggle-row:last-child {
  border-bottom: none;
}

.settings-toggle-row.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.settings-toggle-copy {
  flex: 1;
  min-width: 0;
}

.settings-toggle-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.35;
}

.settings-toggle-desc {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: #6b7280;
}

.settings-toggle-switch {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.settings-toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.settings-toggle-track {
  position: relative;
  display: block;
  width: 2.75rem;
  height: 1.625rem;
  border-radius: 9999px;
  background: #d1d5db;
  transition: background-color 180ms ease;
}

.settings-toggle-knob {
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  transition: transform 180ms ease;
}

.settings-toggle-switch input:checked + .settings-toggle-track {
  background: var(--tenant-theme-seed, #4f46e5);
}

.settings-toggle-switch input:checked + .settings-toggle-track .settings-toggle-knob {
  transform: translateX(1.125rem);
}

.settings-toggle-switch input:disabled + .settings-toggle-track {
  opacity: 0.65;
}

.settings-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.settings-link-row:last-child {
  border-bottom: none;
}

.settings-link-row:hover {
  background: #f9fafb;
}

.settings-link-row i.fa-chevron-right {
  color: #9ca3af;
  font-size: 0.75rem;
}

.settings-note {
  margin: 0.5rem 1rem 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: #6b7280;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
}

.settings-note a {
  color: color-mix(in srgb, var(--tenant-theme-seed, #4f46e5) 85%, #1e1b4b);
  font-weight: 600;
}

.settings-note.is-warning {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.settings-save-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem calc(0.625rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid #e5e7eb;
  backdrop-filter: blur(8px);
}

  .settings-save-bar button {
  flex: 1;
  min-height: 2.75rem;
  border-radius: 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
}

tr.legacy-uom-suggested .js-uom {
  border-color: color-mix(in srgb, var(--tenant-theme-seed, #4f46e5) 45%, #c7d2fe);
  background-color: color-mix(in srgb, var(--tenant-theme-seed, #4f46e5) 6%, white);
}

.trf-has-floating-actions {
  padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)) !important;
}

.trf-floating-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.75rem 0.875rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
}

.trf-floating-actions:empty {
  display: none;
}

.trf-floating-actions button {
  min-height: 3rem;
  width: 100%;
}

.pfo-floating-actions {
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.pfo-has-floating-actions {
  padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)) !important;
}

.trf-top-snackbar-host {
  position: fixed;
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 80;
  display: flex;
  width: min(28rem, calc(100vw - 1.5rem));
  transform: translateX(-50%);
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.trf-top-snackbar {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  border-radius: 0.875rem;
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(-0.75rem);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: auto;
}

.trf-top-snackbar.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.trf-top-snackbar--error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.trf-top-snackbar--success {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

@media (min-width: 768px) {
  .settings-page {
    padding-bottom: 1.25rem;
  }

  .settings-save-bar {
    position: static;
    padding: 0;
    margin-top: 1rem;
    background: transparent;
    border-top: none;
    backdrop-filter: none;
    justify-content: flex-end;
  }

  .settings-save-bar button {
    flex: 0 0 auto;
    min-width: 7.5rem;
  }

  .settings-section + .settings-section {
    margin-top: 1rem;
  }
}

@keyframes stk-row-focus-pulse {
  0%,
  100% {
    background-color: rgb(238 242 255);
  }
  50% {
    background-color: rgb(199 210 254);
  }
}

tr.stk-row-focus-highlight {
  animation: stk-row-focus-pulse 0.8s ease-in-out 3;
  outline: 2px solid rgb(99 102 241);
  outline-offset: -2px;
}

a.bom-ingredient-link {
  cursor: pointer;
}

a.bom-ingredient-link.cursor-help,
.bom-line-item [data-bom-tip].cursor-help {
  cursor: help;
}

.bom-status-tooltip {
  position: fixed;
  z-index: 90;
  max-width: min(22rem, calc(100vw - 1rem));
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14);
  pointer-events: auto;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: #374151;
}

.bom-status-tooltip[data-status="rendah"] {
  border-color: #fecaca;
  background: #fffafb;
}

.bom-status-tooltip[data-status="menipis"] {
  border-color: #fde68a;
  background: #fffef7;
}

.bom-status-tooltip-line + .bom-status-tooltip-line {
  margin-top: 0.35rem;
}

.bom-status-tooltip-line:first-child {
  font-weight: 600;
  color: #111827;
}

.bom-status-tooltip[data-status="rendah"] .bom-status-tooltip-line:first-child {
  color: #b91c1c;
}

.bom-status-tooltip[data-status="menipis"] .bom-status-tooltip-line:first-child {
  color: #b45309;
}

.mt-store-map {
  width: 100%;
  height: min(62vh, 640px);
  min-height: 320px;
  background: #e5e7eb;
  z-index: 0;
}

.mt-store-map.leaflet-container {
  font: inherit;
}

.mt-store-map .leaflet-popup-content {
  margin: 10px 12px;
}

.mt-store-dot {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.mt-store-dot-approved { background: #059669; }
.mt-store-dot-pending { background: #d97706; }
.mt-store-dot-rejected { background: #dc2626; }
.mt-store-dot-suspended { background: #9ca3af; }
.mt-store-dot-hunter { background: #0284c7; }

.mt-store-map-marker-wrap {
  background: transparent;
  border: 0;
}

.mt-store-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  text-align: center;
}

.mt-store-marker-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.7rem;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  background: #eef2ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #4338ca;
  font-size: 0.9rem;
}

.mt-store-marker-approved .mt-store-marker-avatar {
  box-shadow: 0 0 0 2px #059669, 0 1px 4px rgba(0, 0, 0, 0.35);
}

.mt-store-marker-pending .mt-store-marker-avatar {
  box-shadow: 0 0 0 2px #d97706, 0 1px 4px rgba(0, 0, 0, 0.35);
  background: #fffbeb;
  color: #b45309;
}

.mt-store-marker-rejected .mt-store-marker-avatar {
  box-shadow: 0 0 0 2px #dc2626, 0 1px 4px rgba(0, 0, 0, 0.35);
  background: #fef2f2;
  color: #b91c1c;
}

.mt-store-marker-suspended .mt-store-marker-avatar {
  box-shadow: 0 0 0 2px #9ca3af, 0 1px 4px rgba(0, 0, 0, 0.35);
  background: #f3f4f6;
  color: #6b7280;
}

.mt-store-marker-hunter .mt-store-marker-avatar {
  box-shadow: 0 0 0 2px #0284c7, 0 1px 4px rgba(0, 0, 0, 0.35);
  background: #e0f2fe;
  color: #0369a1;
}

.mt-hunter-thumb {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.mt-hunter-thumb--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d1d5db;
}

.mt-store-marker-name,
.mt-store-marker-sub {
  display: block;
  max-width: 6.5rem;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}

.mt-store-marker-name {
  font-size: 0.625rem;
  font-weight: 700;
  color: #111827;
}

.mt-store-marker-sub {
  font-size: 0.5625rem;
  color: #4b5563;
}

.mt-map-shell.is-map-fullscreen {
  align-items: stretch !important;
  justify-content: stretch !important;
  padding: 0 !important;
  min-height: 100%;
}

.mt-map-panel.is-map-fullscreen {
  width: 100% !important;
  max-width: none !important;
  height: 100dvh !important;
  max-height: none !important;
  border-radius: 0 !important;
}

.mt-map-panel.is-map-fullscreen .mt-store-map {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-height: none !important;
}

#mt-map-modal.is-map-fullscreen {
  z-index: 9999;
}

#mt-map-modal.is-map-fullscreen [data-mt-map-backdrop] {
  display: none;
}

#mt-map-modal.is-map-fullscreen .mt-map-shell {
  min-height: 100dvh;
  height: 100dvh;
  width: 100vw;
}

#mt-map-modal.is-map-fullscreen .mt-map-panel {
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#mt-map-modal.is-map-fullscreen .mt-store-map {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-height: none !important;
}

#mt-map-modal.is-map-fullscreen #mt-map-unmapped {
  max-height: 4.5rem;
  overflow-y: auto;
}

/* Riwayat Penjualan Produk — loading & kartu ringkas */
.rpp-skel {
  height: 0.625rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef2f7 0%, #e2e8f0 40%, #eef2f7 80%);
  background-size: 200% 100%;
  animation: rpp-pulse 1.1s ease-in-out infinite;
}
@keyframes rpp-pulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.rpp-stat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  min-width: 0;
}
.rpp-stat .lbl {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.rpp-stat .val {
  margin-top: 0.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.rpp-shell {
  position: relative;
}
.rpp-shell.is-loading .rpp-shell-body {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.15);
}
.rpp-shell-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(1px);
}
.rpp-shell.is-loading .rpp-shell-overlay {
  display: flex;
}
.rpp-load-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ── Modal "Pembelian Ulang Produk" (#rpp-repeat) ─────────────────────────────
   Dilaporkan owner 2026-09-03: di HP kepala modal (judul + pemilih periode +
   tombol tutup) tak terlihat sama sekali. TIGA sebab yang bertumpuk:

   1. Induknya `main#page-content` ber-`space-y-4`, dan `space-y-*` memasang
      margin-top lewat `> * + *` — kena juga ke anak `position:fixed` yang sudah
      keluar dari aliran normal. Overlay `inset-0` jadi over-constrained: turun
      16px DAN menyusut 16px (terukur: rect.top=16 padahal computed top=0px),
      dan backdrop-nya ikut tak menutup pita 16px teratas.
   2. Kotaknya dibatasi `92vh`, sedangkan overlay `fixed` memakai viewport
      KECIL. Di HP `vh` = viewport BESAR (seolah bilah alamat sudah sembunyi),
      jadi kotaknya bisa LEBIH TINGGI daripada wadahnya sendiri.
   3. Wadahnya `items-end` (lembar bawah). Begitu isinya melebihi wadah,
      luapannya lari ke ATAS — dan luapan arah start di flexbox TAK BISA
      digulir. Yang pertama hilang persis kepalanya.

   Terukur sebelum perbaikan (bilah browser 74px): 390x844 kepala terpotong
   6,5px; 360x640 terpotong 22,8px; 414x896 (bilah 110px) terpotong 38,3px dan
   tombol tutup lenyap. Di headless `100dvh == 100vh` sehingga cacat ini TAK
   PERNAH muncul tanpa menyimulasikan bilah browser.

   Lihat memori [[gotcha-space-y-margin-anak-fixed]] dan
   [[gotcha-flex-overflow-min-height]] — resep di bawah yang dipakai. */
.rpp-modal {
  /* Lepas dari space-y-* induk. Wajib, dan jangan diganti kelas utilitas:
     margin-nya datang dari SELECTOR induk, bukan dari kelas elemen ini. */
  margin: 0 !important;
  /* Jangan bersandar pada `inset:0` saja — tinggi eksplisit membuat kotak di
     dalamnya punya acuan `max-height:100%` yang benar di HP. */
  height: 100vh;      /* cadangan untuk browser tanpa dvh */
  height: 100dvh;
  padding: 0;
}
/* `:not(.hidden)` supaya menang atas `.hidden` Tailwind apa pun urutan sheet-nya
   (Play CDN menyuntik style-nya saat runtime, urutannya tak bisa diandalkan). */
.rpp-modal:not(.hidden) {
  display: flex;
  align-items: flex-end;      /* HP: lembar bawah */
  justify-content: center;
}
@media (min-width: 640px) {
  .rpp-modal { padding: 1rem; }
  .rpp-modal:not(.hidden) { align-items: center; }
}
.rpp-modal-kotak {
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Ikut TINGGI OVERLAY, bukan 92vh: di HP vh memakai viewport besar sehingga
     kotaknya bisa melebihi wadahnya dan kepalanya terdorong keluar layar. */
  max-height: 100%;
}
/* Kepala TAK ikut digulir dan TAK boleh diremas flexbox. */
.rpp-modal-kepala {
  flex: 0 0 auto;
}
/* `min-height:0` WAJIB: begitu sebuah item flex punya overflow, ukuran minimum
   otomatisnya jadi 0 dan flexbox bebas meremasnya — lihat
   [[gotcha-flex-overflow-min-height]]. */
.rpp-modal-isi {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Jangan merembetkan gulir ke halaman di belakang saat isi modal habis. */
  overscroll-behavior: contain;
  /* Kaki layar HP (home indicator / bilah bawah) tak menutupi baris terakhir. */
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

/* ── Isyarat "tabel ini masih bisa digeser" ───────────────────────────────────
   Tabel halaman ini punya 11 kolom; di layar 390px hanya 4 yang muat, dan
   tujuh sisanya (Omzet, Margin, Diskon, dst.) hilang TANPA tanda apa pun —
   pembungkusnya cuma `overflow-x-auto`. Sama keluarganya dengan pelajaran
   "tooltip bukan UI di HP" [[pos-riwayat-penjualan-produk]]: kemampuan yang
   tak terlihat sama saja dengan tak ada.

   Caranya murni CSS, tanpa JS pengukur: dua lapis penutup ber-`local` ikut
   bergeser bersama isi, dua lapis bayangan ber-`scroll` diam di tepi. Saat
   masih ada isi tersembunyi, penutupnya sudah bergeser sehingga bayangannya
   tampak; begitu digulir mentok, penutupnya kembali menimpa bayangan dan
   isyaratnya hilang sendiri. */
.rpp-gulir-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background-image:
    linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to right, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0)),
    linear-gradient(to left, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0));
  background-position: left center, right center, left center, right center;
  background-repeat: no-repeat;
  background-size: 32px 100%, 32px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}

/* Riwayat Penjualan — kartu filter ringkasan */
.sh-finance-card,
.sh-filter-card {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  display: block;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.sh-finance-card:hover {
  border-color: #a7f3d0;
}
.sh-finance-card:focus-visible,
.sh-filter-card:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}
.sh-filter-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  text-align: left;
  min-width: 0;
}
.sh-filter-card--pending {
  border-color: #fde68a;
  background: #fffbeb;
}
.sh-filter-card--cancel {
  border-color: #fecaca;
  background: #fef2f2;
}
.sh-filter-card--return {
  border-color: #e2e8f0;
  background: #f8fafc;
}
.sh-filter-card--notes {
  border-color: #c7d2fe;
  background: #eef2ff;
}
.sh-filter-card--cashier-notes {
  border-color: #fecaca;
  background: #fef2f2;
}
.sh-filter-card--cashier-notes .sh-filter-kicker { color: #991b1b; }
.sh-filter-card--cashier-notes.is-active {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35);
}
.sh-filter-card.is-active {
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.28);
}
.sh-filter-card--done.is-active {
  border-color: #34d399;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.28);
}
.sh-filter-card--pending.is-active {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
}
.sh-filter-card--cancel.is-active {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.28);
}
.sh-filter-card--notes.is-active {
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.35);
}
.sh-filter-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0 0 0.2rem;
}
.sh-filter-card--pending .sh-filter-kicker { color: #92400e; }
.sh-filter-card--cancel .sh-filter-kicker { color: #991b1b; }
.sh-filter-card--return .sh-filter-kicker { color: #334155; }
.sh-filter-card--notes .sh-filter-kicker { color: #3730a3; }
.sh-filter-card--done .sh-filter-kicker { color: #047857; }
.sh-filter-count {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}
.sh-filter-total {
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: #64748b;
}
