/* ==========================================================================
   Beranda: Structured Business Dashboard (Mobile & Tablet)
   ========================================================================== */

.mobile-beranda-heading { display: none; }
.main-col:has(#view-beranda.active) .topbar { display: none; }
.main-col:has(#view-beranda.active) .workspace {
  background: #F1F3EE;
  padding: 14px 16px 24px;
}

@container pos-app (max-width: 839px) {
  .main-col:has(#view-beranda.active) .topbar {
    display: flex;
    border-bottom: 0;
  }
  .main-col:has(#view-beranda.active) .mobile-brand-bar,
  .main-col:has(#view-beranda.active) .topbar-right {
    display: none;
  }
  .main-col:has(#view-beranda.active) .mobile-beranda-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .mobile-beranda-heading .page-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
  }
  .mobile-beranda-heading .page-title .icon {
    width: 22px;
    height: 22px;
  }
  .mobile-beranda-heading #dashNotifBtn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
  }
}

.dashboard {
  --dash-brand-dark: #2F4F24;
  --dash-brand-dark-2: #3E662F;
  --dash-accent: #A7E646;
  --dash-accent-light: #C6F976;
  --dash-canvas: #F1F3EE;
  --dash-surface: #FFFFFF;
  --dash-ink: #263020;
  --dash-ink-2: #55634F;
  --dash-ink-muted: #5D6B57;
  --dash-border: #E0E5DB;
  --dash-divider: #E7EBE2;
  --dash-soft-green: #EAF4DB;
  --dash-warn-bg: #FFF0D9;
  --dash-warn-fg: #986421;
  --dash-err-bg: #FCE8E5;
  --dash-err-fg: #A93D34;
  --dash-gap: 14px;
  --dash-card-pad: 14px;
  --dash-card-radius: 14px;
  --dash-ctrl-radius: 10px;
  max-width: 1320px;
  margin-inline: auto;
  gap: var(--dash-gap);
  color: var(--dash-ink);
}

.dashboard [hidden],
.dash-date-picker [hidden] { display: none !important; }

.dashboard button:focus-visible,
.dash-date-picker button:focus-visible,
.dash-date-picker input:focus-visible {
  outline: 2px solid var(--brand-olive);
  outline-offset: 2px;
}

.dash-history-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink-secondary);
  font-size: 0.8rem;
}
.dash-history-filter[hidden] { display: none; }

/* ---------- Error & Loading ---------- */
.dash-load-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 14px;
  border-radius: var(--dash-ctrl-radius);
  background: var(--dash-err-bg);
  color: var(--dash-err-fg);
  font-size: 0.84rem;
  font-weight: 550;
}
.dash-load-error button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--dash-surface);
  color: var(--dash-err-fg);
  font-size: 0.8rem;
  font-weight: 600;
}

.dash-loading {
  padding: 10px 14px;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-ctrl-radius);
  background: var(--dash-surface);
  color: var(--dash-ink-2);
  font-size: 0.82rem;
}

/* ---------- 5-Surface Grid ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--dash-gap);
  align-items: stretch;
}

.dash-surface { min-width: 0; }

.dash-card {
  min-width: 0;
  padding: var(--dash-card-pad);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-card-radius);
  background: var(--dash-surface);
}

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.dash-card-head h2,
.dash-section-heading {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--dash-ink);
}

.dash-meta {
  color: var(--dash-ink-muted);
  font-size: 0.75rem;
  font-weight: 450;
}

.dash-divider {
  border: 0;
  border-top: 1px solid var(--dash-divider);
  margin: 0;
}

.dash-link-btn,
.dash-text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  margin-block: -10px;
  padding: 0 6px;
  border-radius: 8px;
  color: var(--brand-olive-deep);
  font-size: 0.8rem;
  font-weight: 600;
}
.dash-link-btn:hover,
.dash-text-button:hover { background: var(--dash-soft-green); }

/* ---------- Surface 1: Store Identity Card ---------- */
.dash-store {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 15px 16px;
  border-radius: var(--dash-card-radius);
  background-color: var(--dash-brand-dark);
  background-image:
    radial-gradient(circle at 96% 12%, rgba(198, 249, 118, 0.13) 0 28%, transparent 28.5% 42%, rgba(198, 249, 118, 0.06) 42.5% 56%, transparent 56.5%),
    linear-gradient(145deg, var(--dash-brand-dark), var(--dash-brand-dark-2));
  color: #FFFFFF;
}

.dash-store-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.dash-store-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  aspect-ratio: 1;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--dash-accent-light);
  overflow: hidden;
  flex-shrink: 0;
}
.dash-store-logo.has-image {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: visible;
}
.dash-store-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.18));
}
.dash-store-logo .icon {
  width: 28px;
  height: 28px;
  stroke-width: 1.8;
}

.dash-store-info {
  min-width: 0;
}

.dash-store-name {
  font-size: 1.38rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: #FFFFFF;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.dash-store-address {
  margin-top: 4px;
  color: #E8F2E0;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.dash-store-action {
  display: grid;
  place-items: center;
  align-self: start;
  width: 48px;
  height: 48px;
  margin: -4px -8px 0 0;
  border-radius: 10px;
  color: #DCE5D5;
}
.dash-store-action .icon {
  width: 21px;
  height: 21px;
}
.dash-store-action:hover { background: rgba(255, 255, 255, 0.1); color: #FFFFFF; }

.dash-store-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin: 0;
}

.dash-store-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.dash-clock-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.dash-clock-caption {
  font-size: 0.78rem;
  font-weight: 450;
  line-height: 1.2;
  color: #DFECD5;
}

.dash-clock-time-row {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
}

.dash-clock-time {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.95rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--dash-accent-light);
}

.dash-clock-sec {
  font-size: 0.56em;
  font-weight: 550;
  letter-spacing: -0.01em;
  opacity: 0.88;
  margin-left: 1px;
}

.dash-clock-zone {
  font-size: 0.78rem;
  font-weight: 500;
  color: #E8F2E0;
}

.dash-clock-date-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.3;
  color: #E8F2E0;
  min-width: 0;
}

.dash-clock-weekday {
  color: #FFFFFF;
  font-size: 0.9rem;
  font-weight: 600;
}

.dash-clock-date {
  white-space: nowrap;
}

/* ---------- Surface 2: Integrated Financial Overview ---------- */
.dash-finance {
  display: flex;
  flex-direction: column;
}

.dash-finance-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 11px;
  flex: 1;
}

.dash-finance-report-top { display: none; }
.dash-finance-today-tag { display: inline; }

.dash-primary-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-metric-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 450;
  line-height: 1.3;
  color: var(--dash-ink-2);
}

.dash-net-amount {
  display: block;
  font-size: clamp(1.65rem, 6.5cqw, 2rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--dash-ink);
  overflow-wrap: anywhere;
}

.dash-fin-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.dash-fin-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 10px 10px 10px 0;
}

/* Mobile 2x2 ordering matching wireframe: Row 1 Profit|Trx, Row 2 Cash|Debt */
.dash-fin-profit { order: 1; padding-top: 0; padding-right: 12px; border-right: 1px solid var(--dash-divider); border-bottom: 1px solid var(--dash-divider); }
.dash-fin-trx { order: 2; padding-top: 0; padding-left: 12px; padding-right: 0; border-bottom: 1px solid var(--dash-divider); }
.dash-fin-cash { order: 3; padding-bottom: 0; padding-right: 12px; border-right: 1px solid var(--dash-divider); }
.dash-fin-debt { order: 4; padding-bottom: 0; padding-left: 12px; padding-right: 0; }

.dash-fin-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--dash-ink);
  overflow-wrap: anywhere;
}

.dash-metric-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--dash-ink-muted);
  overflow-wrap: anywhere;
}

.dash-metric-sub.is-warn {
  color: var(--dash-warn-fg);
  font-weight: 500;
}

.dash-inline-note {
  font-size: 0.75rem;
  color: var(--dash-ink-muted);
  line-height: 1.4;
}

.dash-finance-mob-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: -8px;
}

.dash-card-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  color: var(--brand-olive-deep);
  font-size: 0.84rem;
  font-weight: 600;
}
.dash-card-footer-btn:hover { background: var(--dash-soft-green); }

/* ---------- Surface 3: Operasional ---------- */
.dash-ops {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dash-shortcut {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--dash-divider);
  border-radius: var(--dash-ctrl-radius);
  background: #F7F8F4;
  color: var(--dash-ink);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
}
.dash-shortcut:hover {
  background: var(--dash-soft-green);
  border-color: var(--brand-lime-border);
}
.dash-shortcut > .icon:first-child {
  width: 18px;
  height: 18px;
  color: var(--brand-olive);
  flex-shrink: 0;
}
.dash-shortcut > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}
.dash-chev {
  color: var(--dash-ink-muted);
  flex-shrink: 0;
}

.dash-ops-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-alerts-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-ops-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: var(--dash-ctrl-radius);
  background: transparent;
  color: var(--dash-ink);
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
}
.dash-ops-row:hover { background: var(--dash-canvas); }
.dash-ops-row > .icon:first-child { flex-shrink: 0; width: 18px; height: 18px; }
.dash-ops-row-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dash-ops-action {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.dash-ops-alert.warn {
  background: var(--dash-warn-bg);
  color: var(--dash-warn-fg);
}
.dash-ops-alert.warn:hover { filter: brightness(0.97); }

.dash-ops-alert.danger {
  background: var(--dash-err-bg);
  color: var(--dash-err-fg);
}
.dash-ops-alert.danger:hover { filter: brightness(0.97); }

.dash-ops-bill {
  border-top: 1px solid var(--dash-divider);
  border-radius: 0 0 8px 8px;
  padding-inline: 4px;
}
.dash-ops-bill > .icon:first-child { color: var(--brand-olive); }
.dash-ops-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--dash-soft-green);
  color: var(--brand-olive-deep);
  font-size: 0.78rem;
  font-weight: 650;
}
.dash-ops-count.is-zero {
  background: var(--dash-canvas);
  color: var(--dash-ink-muted);
}

/* ---------- Surface 4: Tren Penjualan ---------- */
.dash-trend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-trend-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
}

.dash-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-chart-tooltip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--dash-border);
  border-radius: 8px;
  background: #F8FAF5;
}
.dash-chart-tip-copy {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
.dash-chart-tip-copy strong {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--dash-ink);
}
.dash-chart-tip-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.dash-chart-tip-nav button {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  font-size: 1rem;
  color: var(--dash-ink-2);
}
.dash-chart-tip-nav button:hover:not(:disabled) { background: var(--dash-divider); color: var(--dash-ink); }
.dash-chart-tip-nav button:disabled { opacity: 0.35; }

.dash-plot-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}
.dash-chart-y {
  position: relative;
  min-width: 3em;
  margin-block: 0.55em;
  color: var(--dash-ink-muted);
  font-size: 0.7rem;
}
.dash-chart-y span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  white-space: nowrap;
}
.dash-plot {
  display: block;
  width: 100%;
  height: 112px;
  padding-block: 6px;
}
.dash-plot svg { width: 100%; height: 100%; overflow: visible; }
.dash-plot .gridline {
  stroke: var(--dash-divider);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
}
.dash-plot .baseline { stroke: var(--dash-border); stroke-dasharray: none; }
.dash-plot .bars { fill: #84B257; }
.dash-plot .negative { fill: var(--dash-warn-fg); }
.dash-plot .active-bar { fill: var(--dash-accent); }
.dash-plot .negative.active-bar { fill: var(--dash-err-fg); }
.dash-plot .active-guide {
  stroke: var(--brand-olive);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 3 3;
}
.dash-chart-x {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding-inline-start: 2.8rem;
}
.dash-chart-x.is-grid {
  display: grid;
  text-align: center;
  gap: 0;
}
.dash-chart-x span {
  color: var(--dash-ink-muted);
  font-size: 0.7rem;
}

/* ---------- Surface 5: Transaksi Terakhir ---------- */
.dash-recent {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-trx-table-wrap { display: none; }
.dash-trx-list { display: flex; flex-direction: column; }

.dash-trx {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--dash-divider);
  text-align: left;
}
.dash-trx:last-child { border-bottom: 0; padding-bottom: 2px; }
.dash-trx:hover { background: #F8FAF6; }

.dash-trx-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--dash-canvas);
  color: var(--brand-olive);
}
.dash-trx-icon .icon { width: 17px; height: 17px; }

.dash-trx-copy,
.dash-trx-end {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-trx-copy strong {
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--dash-ink);
  overflow-wrap: anywhere;
}
.dash-trx-cust { overflow-wrap: anywhere; }

.dash-trx-end {
  align-items: flex-end;
  text-align: right;
  flex-shrink: 0;
}
.dash-trx-end strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dash-ink);
  white-space: nowrap;
}

/* Semantic Status Indicators (compact, high-contrast) */
.dash-recent .status-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}
.dash-recent .status-badge.lunas { background: var(--dash-soft-green); color: var(--brand-olive-deep); }
.dash-recent .status-badge.kasbon { background: var(--dash-warn-bg); color: var(--dash-warn-fg); }
.dash-recent .status-badge.refund { background: var(--dash-err-bg); color: var(--dash-err-fg); }

/* Full-width Tablet Table */
.dash-trx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.dash-trx-table thead th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--dash-border);
  background: #F7F8F4;
  color: var(--dash-ink-2);
  font-size: 0.75rem;
  font-weight: 550;
  text-align: left;
  white-space: nowrap;
}
.dash-trx-table thead th:first-child { border-radius: 8px 0 0 8px; }
.dash-trx-table thead th:last-child { border-radius: 0 8px 8px 0; }
.dash-trx-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--dash-divider);
  color: var(--dash-ink);
  vertical-align: middle;
}
.dash-trx-table tbody tr:last-child td { border-bottom: 0; }
.dash-trx-table tbody tr {
  cursor: pointer;
  transition: background-color 140ms var(--ease);
}
.dash-trx-table tbody tr:hover { background: #F8FAF5; }

.dash-trx-id-btn {
  min-height: 36px;
  padding: 0;
  color: var(--dash-ink);
  font-size: 0.85rem;
  font-weight: 550;
  text-align: left;
}
.dash-trx-id-btn:hover { color: var(--brand-olive-deep); text-decoration: underline; }
.dash-col-time,
.dash-col-method,
.dash-col-customer { color: var(--dash-ink-2); }
.dash-col-total {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}
.dash-trx-table thead th.dash-col-total { text-align: right; }
.dash-col-status { text-align: right; white-space: nowrap; }
.dash-trx-table thead th.dash-col-status { text-align: right; }

/* ---------- Empty State ---------- */
.dash-empty {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 84px;
  padding: 14px 12px;
  border-radius: var(--dash-ctrl-radius);
  background: #F8FAF6;
  text-align: center;
  font-size: 0.82rem;
}
.dash-empty > .icon { color: var(--dash-ink-muted); width: 20px; height: 20px; }
.dash-empty strong { font-weight: 600; color: var(--dash-ink); }

/* Editorial Empty State for Sales Trend Chart */
.dash-trend-empty {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 172px;
  padding: 20px 16px;
  border: 1px dashed var(--dash-border);
  border-radius: 12px;
  background: #FAFBF8;
  text-align: center;
  overflow: hidden;
}
.dash-trend-empty-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 10px 6px;
  border-bottom: 1.5px solid var(--dash-divider);
}
.dash-trend-empty-bars span {
  display: block;
  width: 12px;
  border-radius: 4px 4px 1px 1px;
  background: #E6ECE0;
}
.dash-trend-empty-bars span:nth-child(1) { height: 16px; }
.dash-trend-empty-bars span:nth-child(2) { height: 28px; }
.dash-trend-empty-bars span:nth-child(3) { height: 20px; }
.dash-trend-empty-bars span:nth-child(4) { height: 36px; background: #D7E9BF; }
.dash-trend-empty-bars span:nth-child(5) { height: 24px; }
.dash-trend-empty-bars span:nth-child(6) { height: 14px; }
.dash-trend-empty-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 300px;
}
.dash-trend-empty-copy strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dash-ink);
}
.dash-trend-empty-copy span {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--dash-ink-muted);
}
.dash-trend-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--brand-lime-border);
  border-radius: var(--dash-ctrl-radius);
  background: var(--dash-soft-green);
  color: var(--brand-olive-deep);
  font-size: 0.8rem;
  font-weight: 600;
}
.dash-trend-empty-cta:hover {
  background: var(--dash-accent);
  border-color: var(--dash-accent);
  color: var(--dash-brand-dark);
}

/* ---------- Custom Date Picker Modal ---------- */
.modal-card:has(.dash-date-picker) { max-width: 460px; padding: 14px; }
.dash-date-picker { display: grid; gap: 10px; min-width: 0; }
.dash-date-picker .modal-head { align-items: center; }
.dash-date-picker .modal-head button { width: 48px; height: 48px; flex: 0 0 48px; }
.dash-date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dash-date-fields label { min-width: 0; display: grid; gap: 4px; font-size: 0.8rem; font-weight: 600; }
.dash-date-fields input {
  width: 100%; min-width: 0; min-height: 48px; padding-inline: 8px; font-size: 0.95rem;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--ink-primary);
}
.dash-date-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.dash-date-nav button { width: 48px; min-height: 48px; border-radius: var(--radius-sm); background: var(--bg-subtle); font-size: 1.15rem; }
.dash-date-nav button:disabled { opacity: 0.35; }
.dash-date-nav span { font-size: 0.75rem; color: var(--ink-secondary); text-align: center; }
.dash-months { display: grid; gap: 12px; }
.dash-month + .dash-month { display: none; }
.dash-month h3 { text-align: center; font-size: 0.85rem; margin-bottom: 5px; }
.dash-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.dash-weekday { font-size: 0.7rem; color: var(--ink-secondary); padding-block: 4px; }
.dash-day { min-height: 44px; font-size: 0.8rem; border-radius: 6px; font-weight: 600; }
.dash-day:disabled { color: var(--ink-muted); opacity: 0.5; }
.dash-day.is-in-range { background: var(--brand-lime-soft); }
.dash-day[aria-pressed="true"] { background: var(--brand-lime); box-shadow: inset 0 0 0 1px var(--brand-olive); color: var(--brand-olive-deep); }
.dash-date-error { font-size: 0.8rem; color: var(--danger-text); }
.dash-date-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.dash-date-actions button { min-height: 48px; padding-inline: 14px; }
.dash-date-actions .dash-text-button { margin-inline-end: auto; }

/* Store Profile Logo Picker in Modal */
.store-logo-field {
  display: flex;
  align-items: center;
  gap: 12px;
}
.store-logo-preview {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  color: var(--brand-olive);
  overflow: hidden;
  flex-shrink: 0;
}
.store-logo-preview.has-image { background: #FFFFFF; padding: 4px; }
.store-logo-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.store-logo-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ==========================================================================
   Responsive Breakpoints (Container Query: pos-app)
   ========================================================================== */

/* Very narrow mobile (<= 340px, e.g. 320x640) */
@container pos-app (max-width: 430px) {
  .dash-shortcut .dash-chev { display: none; }
}
@container pos-app (max-width: 340px) {
  .main-col:has(#view-beranda.active) .workspace { padding-inline: 12px; }
  .dash-store { padding: 14px; }
  .dash-store-logo { width: 48px; height: 48px; }
  .dash-store-name { font-size: 1.15rem; }
  .dash-clock-time { font-size: 1.55rem; }
  .dash-shortcuts { grid-template-columns: minmax(0, 1fr); }
  .dash-fin-metrics { grid-template-columns: minmax(0, 1fr); }
  .dash-fin-profit,
  .dash-fin-trx,
  .dash-fin-cash,
  .dash-fin-debt {
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid var(--dash-divider);
  }
  .dash-fin-profit { padding-top: 0; }
  .dash-fin-debt { padding-bottom: 0; border-bottom: 0; }
}

/* Medium / Compact Tablet (>= 720px): Full-width date picker & Transaction Table */
@container pos-app (min-width: 720px) {
  .modal-card:has(.dash-date-picker) { max-width: 740px; }
  .dash-months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-month + .dash-month { display: block; order: -1; }
  .dash-trx-table-wrap { display: block; }
  .dash-trx-list { display: none; }
}

@container pos-app (720px <= width < 920px) {
  .dash-col-customer { display: none; }
}

/* Tablet Shell (>= 840px: Navigation rail active, header period selector) */
@container pos-app (min-width: 840px) {
  .main-col:has(#view-beranda.active) .workspace {
    padding: 18px 20px 28px;
  }
  .dashboard {
    --dash-gap: 16px;
    --dash-card-pad: 18px;
    --dash-card-radius: 14px;
  }
  .dash-finance-today-tag,
  .dash-finance-mob-foot { display: none; }
  .dash-finance-report-top { display: inline-flex; }
  .dash-card-head h2 { font-size: 1.06rem; }

  /* Store Identity Tablet Composition */
  .dash-store { padding: 16px 20px; gap: 14px; }
  .dash-store-main { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; }
  .dash-store-logo { width: 66px; height: 66px; border-radius: 15px; }
  .dash-store-logo.has-image { border-radius: 0; }
  .dash-store-logo .icon { width: 32px; height: 32px; }
  .dash-store-name { font-size: clamp(1.48rem, 2cqw, 1.78rem); }
  .dash-store-address { font-size: 0.88rem; }
  .dash-clock-caption { font-size: 0.8rem; }
  .dash-clock-time { font-size: clamp(2rem, 2.5cqw, 2.3rem); }
  .dash-clock-weekday { font-size: 0.94rem; }
  .dash-clock-date-row { font-size: 0.84rem; }
  .dash-finance-card { padding: 18px 20px; gap: 14px; }
  .dash-plot { height: 150px; }
}

/* Structured 12-Column Tablet Grid (5:7) (>= 900px, covers 960x600 .. 1440x900) */
@container pos-app (min-width: 900px) {
  .dash-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
  }
  .dash-store {
    grid-column: span 5;
    justify-content: flex-start;
    padding: 18px 20px;
    gap: 14px;
  }
  .dash-store-main {
    flex: 1;
    align-items: center;
  }
  .dash-store-bottom {
    min-height: 56px;
  }
  .dash-finance { grid-column: span 7; }
  .dash-finance-card { justify-content: flex-start; }
  .dash-primary-metric { flex: 1; justify-content: center; }
  .dash-fin-metrics { min-height: 56px; align-items: start; }
  .dash-ops { grid-column: span 5; }
  .dash-trend { grid-column: span 7; }
  .dash-recent { grid-column: 1 / -1; }
  .dash-net-amount { font-size: clamp(1.9rem, 2.5cqw, 2.25rem); }
  .dash-plot { height: 176px; }
}

/* 4-Column Horizontal Secondary Financial Metrics on Wide Tablet (>= 1080px) */
@container pos-app (min-width: 1080px) {
  .dash-fin-metrics {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1.16fr) minmax(0, 0.74fr) minmax(0, 0.98fr);
  }
  .dash-fin-profit { order: 1; padding: 0 16px 0 0; border-bottom: 0; border-right: 1px solid var(--dash-divider); }
  .dash-fin-cash { order: 2; padding: 0 16px; border-bottom: 0; border-right: 1px solid var(--dash-divider); }
  .dash-fin-trx { order: 3; padding: 0 16px; border-bottom: 0; border-right: 1px solid var(--dash-divider); }
  .dash-fin-debt { order: 4; padding: 0 0 0 16px; border-bottom: 0; border-right: 0; }
  .dash-fin-value { font-size: 1.02rem; }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard,
  .dashboard *,
  .modal-card:has(.dash-date-picker) {
    animation: none !important;
    transition: none !important;
  }
}

/* Report period and feature directory */
.report-heading,
.report-filters,
.more-search,
.more-group {
  min-width: 0;
}

.report-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.report-heading #btnExportCsv { min-height: 44px; }
.report-filters {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.report-filters h2, .more-group h2, #view-laporan .pnl-dark-card h2 {
  font-size: .9rem;
  font-weight: 650;
}

.report-period-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 103px), 1fr));
  gap: 6px;
}

.report-period-options button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.25;
}

.report-period-options button:hover { background: var(--bg-subtle); }
.report-period-options button[aria-pressed="true"] {
  background: var(--brand-lime-soft);
  border-color: var(--brand-lime-border);
  color: var(--brand-olive-deep);
}

#view-laporan .pnl-line { gap: 8px; }
#view-laporan .pnl-line strong { white-space: nowrap; }
#view-laporan .section-sub { margin-block: 3px 8px; }

.more-search { display: grid; gap: 5px; }
.more-search label { font-size: .8rem; font-weight: 600; }
.more-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-inline: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink-secondary);
}

.more-search-field:focus-within { outline: 2px solid var(--brand-olive); outline-offset: 1px; }
.more-search-field input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-primary);
  font: inherit;
  font-size: 1rem;
}

.more-group { display: grid; gap: 8px; }
#view-lainnya [hidden] { display: none; }
#view-lainnya .more-menu-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr));
  gap: 8px;
}

#view-lainnya .more-menu-card {
  min-height: 60px;
  align-items: flex-start;
  gap: 8px;
  padding: 9px;
}

.more-menu-card > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.more-menu-card strong, .more-menu-card small { display: block; line-height: 1.35; }
.more-menu-card strong { font-size: .8rem; font-weight: 650; }
.more-menu-card small { margin-top: 2px; font-size: .72rem; color: var(--ink-secondary); }
.more-menu-icon {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand-lime-soft);
  color: var(--brand-olive-deep);
}

@container pos-app (min-width: 840px) {
  #view-lainnya .more-menu-grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
}

/* ==========================================================================
   Produk & Stok: Clean Catalog Ledger + Tab Mutasi (Mobile & Tablet)
   ========================================================================== */

.mobile-produk-heading { display: none; }
.main-col:has(#view-produk.active) .topbar { display: none; }
.main-col:has(#view-produk.active) .workspace {
  background: #F1F3EE;
  padding: 14px 16px 24px;
}

@container pos-app (max-width: 839px) {
  .main-col:has(#view-produk.active) .topbar {
    display: flex;
    border-bottom: 0;
  }
  .main-col:has(#view-produk.active.in-detail) .topbar,
  .main-col:has(#view-produk.active.in-logs) .topbar {
    display: none;
  }
  .main-col:has(#view-produk.active) .mobile-brand-bar,
  .main-col:has(#view-produk.active) .topbar-right {
    display: none;
  }
  .main-col:has(#view-produk.active) .mobile-produk-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }
  .mobile-produk-heading .page-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
  }
  .mobile-produk-heading .page-title .icon {
    width: 22px;
    height: 22px;
  }
}

.inv-page.in-logs .inv-header {
  display: none;
}

.inv-mob-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.inv-mob-stock-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--ink-primary);
  flex-shrink: 0;
}
.inv-mob-stock-icon-btn:hover { background: var(--bg-subtle); }

.inv-log-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.inv-mob-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--brand-lime);
  border: 1px solid rgba(36, 56, 10, 0.14);
  color: #192412;
  font-size: 0.84rem;
  font-weight: 650;
  white-space: nowrap;
  flex-shrink: 0;
}
.inv-mob-add-btn:hover { background: var(--brand-lime-hover); }

.inv-page {
  --inv-surface: #FFFFFF;
  --inv-canvas: #F1F3EE;
  --inv-subtle: #F7F8F4;
  --inv-ink: #263020;
  --inv-ink-2: #4E5B48;
  --inv-ink-muted: #5D6B57;
  --inv-border: #E0E5DB;
  --inv-divider: #E7EBE2;
  --inv-ctrl-border: #D5DCD0;
  --inv-soft-green: #EAF4DB;
  --inv-green-fg: #24380A;
  --inv-warn-bg: #FFF0D9;
  --inv-warn-fg: #986421;
  --inv-err-bg: #FCE8E5;
  --inv-err-fg: #A93D34;
  max-width: 1320px;
  margin-inline: auto;
  gap: 14px;
  color: var(--inv-ink);
}

.inv-page [hidden] { display: none !important; }

.inv-page button:focus-visible,
.inv-page input:focus-visible,
.inv-page select:focus-visible {
  outline: 2px solid var(--brand-olive);
  outline-offset: 2px;
}

/* Tablet Top Header */
.inv-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.inv-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.inv-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--inv-ink);
}

.inv-title .icon {
  width: 23px;
  height: 23px;
  color: #2F4F24;
}

.inv-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.inv-btn-outline,
.inv-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 650;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.inv-btn-outline {
  background: var(--inv-surface);
  border: 1px solid var(--inv-ctrl-border);
  color: var(--inv-ink);
}
.inv-btn-outline:hover { background: var(--inv-subtle); }

.inv-btn-primary {
  background: var(--brand-lime);
  border: 1px solid rgba(36, 56, 10, 0.14);
  color: #192412;
  padding: 0 16px;
}
.inv-btn-primary:hover { background: var(--brand-lime-hover); }

/* Segmented Tabs */
.inv-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: #E5E9DF;
}

.inv-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--inv-ink-2);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}

.inv-tab:hover { color: var(--inv-ink); }

.inv-tab.active {
  background: var(--inv-surface);
  color: var(--inv-ink);
  box-shadow: 0 1px 2px rgba(24, 34, 18, 0.08);
}

.inv-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ECEFE7;
  color: var(--inv-ink-2);
  font-size: 0.72rem;
  font-weight: 650;
}

.inv-tab.active .inv-tab-count {
  background: var(--inv-soft-green);
  color: var(--inv-green-fg);
}

/* Integrated 1-Bar Summary Strip */
.inv-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--inv-surface);
  border: 1px solid var(--inv-border);
  border-radius: 14px;
  overflow: hidden;
}

.inv-sum-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  min-width: 0;
}

.inv-sum-sku {
  border-right: 1px solid var(--inv-divider);
  border-bottom: 1px solid var(--inv-divider);
}
.inv-sum-low {
  border-bottom: 1px solid var(--inv-divider);
}
.inv-sum-asset {
  border-right: 1px solid var(--inv-divider);
}

.inv-sum-label {
  font-size: 0.74rem;
  font-weight: 550;
  color: var(--inv-ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-sum-val {
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--inv-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-sum-btn {
  text-align: left;
  width: 100%;
  background: transparent;
  transition: background 0.14s ease;
}
.inv-sum-btn:hover { background: #FAFBF8; }
.inv-sum-btn.has-low .inv-sum-val { color: var(--inv-warn-fg); }
.inv-sum-btn.active { background: #FFF7E8; }
.inv-sum-btn.active .inv-sum-label { color: var(--inv-warn-fg); font-weight: 650; }

/* Mobile Tab & Stock-In Row */
.inv-mob-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inv-tabs-mob {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inv-tabs-mob .inv-tab {
  min-height: 36px;
  padding: 0 8px;
}

.inv-mob-stock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--inv-surface);
  border: 1px solid var(--inv-ctrl-border);
  color: var(--inv-ink);
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
  flex-shrink: 0;
}
.inv-mob-stock-btn:hover { background: var(--inv-subtle); }

/* Main Catalog & Log Cards */
.inv-list-shell {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.inv-card {
  background: var(--inv-surface);
  border: 1px solid var(--inv-border);
  border-radius: 14px;
  overflow: hidden;
  min-width: 0;
}

/* Catalog Toolbar */
.inv-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--inv-divider);
  min-width: 0;
}

.inv-toolbar > * { min-width: 0; }

.inv-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  min-width: 0;
}

.inv-cat-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--inv-ctrl-border);
  background: var(--inv-surface);
  color: var(--inv-ink-2);
  flex-shrink: 0;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.inv-cat-icon-btn:hover { background: var(--inv-subtle); color: var(--inv-ink); }
.inv-cat-icon-btn.active,
.inv-cat-icon-btn.active:hover {
  background: #EAF4DB;
  border-color: #B4DA77;
  color: #24380A;
}

.inv-cat-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3F5E16;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
}
.inv-cat-icon-btn.active .inv-cat-dot {
  opacity: 1;
  transform: scale(1);
}

.inv-select-wrap.inv-cat-select-wrap {
  display: none;
}

/* Mobile Separated Product Cards (< 760px) */
#invCatalogPanel {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  display: grid;
  gap: 12px;
}

#invCatalogPanel .inv-toolbar {
  background: var(--inv-surface);
  border: 1px solid var(--inv-border);
  border-radius: 14px;
  padding: 12px;
}

#invCatalogPanel .inv-empty {
  background: var(--inv-surface);
  border: 1px solid var(--inv-border);
  border-radius: 14px;
}

.inv-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--inv-ctrl-border);
  border-radius: 10px;
  background: var(--inv-subtle);
  color: var(--inv-ink-muted);
  transition: background 0.14s ease, border-color 0.14s ease;
}

.inv-search-field:focus-within {
  background: var(--inv-surface);
  border-color: var(--brand-olive);
  box-shadow: 0 0 0 2px rgba(63, 94, 22, 0.12);
}

.inv-search-field input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--inv-ink);
  font: inherit;
  font-size: 0.9rem;
}

.inv-search-field input::placeholder {
  color: var(--inv-ink-muted);
}

.inv-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  border-radius: 10px;
  overflow: hidden;
}

.inv-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--inv-ctrl-border);
  border-radius: 10px;
  background-color: var(--inv-surface);
  background-image: none;
  color: var(--inv-ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 550;
  line-height: normal;
  cursor: pointer;
}
.inv-select::-ms-expand { display: none; }

.inv-select-icon {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--inv-ink-muted);
}

.inv-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-width: 0;
}

.inv-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
  scrollbar-width: none;
  padding-bottom: 1px;
}
.inv-pills::-webkit-scrollbar { display: none; }

.inv-pill {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #DCE2D6;
  background: var(--inv-surface);
  color: var(--inv-ink-2);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.inv-pill:hover { background: var(--inv-subtle); }
.inv-pill.active {
  background: var(--inv-soft-green);
  border-color: #B4DA77;
  color: var(--inv-green-fg);
}

.inv-meta-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--inv-ink-muted);
}

.inv-reset-btn {
  min-height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--inv-soft-green);
  color: var(--inv-green-fg);
  font-size: 0.76rem;
  font-weight: 650;
}
.inv-reset-btn:hover { background: #DCEFB9; }

/* Semantic Stock Badges & Category Tag */
.inv-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.inv-stock-badge.ok {
  background: var(--inv-soft-green);
  color: var(--inv-green-fg);
}
.inv-stock-badge.low {
  background: var(--inv-warn-bg);
  color: var(--inv-warn-fg);
}
.inv-stock-badge.out {
  background: var(--inv-err-bg);
  color: var(--inv-err-fg);
}
.inv-stock-badge.nonstock {
  background: #F1F3EE;
  color: var(--inv-ink-2);
}

.inv-cat-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #F1F3EE;
  color: var(--inv-ink-2);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Action Buttons inside Rows */
.inv-act-stock,
.inv-act-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.inv-act-stock {
  background: var(--inv-soft-green);
  border: 1px solid #C5E293;
  color: var(--inv-green-fg);
}
.inv-act-stock:hover { background: #DEF1BC; }

.inv-act-edit {
  background: var(--inv-surface);
  border: 1px solid var(--inv-ctrl-border);
  color: var(--inv-ink);
}
.inv-act-edit:hover { background: var(--inv-subtle); }

/* Mobile Product List (< 760px) */
.inv-table-wrap { display: none; }
.inv-mob-list {
  display: grid;
  gap: 10px;
}

.inv-mob-row {
  display: grid;
  gap: 10px;
  padding: 13px 14px 10px;
  background: var(--inv-surface);
  border: 1px solid var(--inv-border);
  border-radius: 14px;
}

.inv-mob-top {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.inv-mob-thumb {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--inv-subtle);
  border: 1px solid var(--inv-divider);
  display: block;
}

.inv-mob-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.inv-mob-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.inv-mob-name {
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--inv-ink);
  min-width: 0;
  overflow-wrap: anywhere;
}

.inv-mob-meta {
  font-size: 0.76rem;
  color: var(--inv-ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-mob-prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 2px;
}

.inv-mob-price {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--inv-ink);
}

.inv-mob-unit {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--inv-ink-muted);
}

.inv-mob-hpp {
  font-size: 0.75rem;
  color: var(--inv-ink-muted);
}

.inv-mob-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-mob-actions button {
  flex: 1 1 0;
  min-height: 40px;
}

/* Tablet Ledger Table (>= 760px) */
.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.inv-table thead th {
  background: var(--inv-subtle);
  color: var(--inv-ink-muted);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1;
  vertical-align: middle;
  text-align: left;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--inv-divider);
  white-space: nowrap;
}

.inv-table th.inv-num,
.inv-table td.inv-num {
  text-align: right;
}

.inv-table th.inv-col-cat,
.inv-table td.inv-col-cat,
.inv-table th.inv-col-stock,
.inv-table td.inv-col-stock,
.inv-table th.inv-col-actions,
.inv-table td.inv-col-actions {
  text-align: center;
}

.inv-table tbody tr {
  border-bottom: 1px solid #EEF1EA;
  transition: background 0.12s ease;
}
.inv-table tbody tr:last-child { border-bottom: 0; }
.inv-table tbody tr:hover { background: #FAFBF8; }

.inv-table tbody td {
  padding: 11px 14px;
  vertical-align: middle;
}

.inv-prod-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.inv-thumb {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--inv-subtle);
  border: 1px solid var(--inv-divider);
  flex-shrink: 0;
  display: block;
}

.inv-prod-name {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--inv-ink);
  line-height: 1.3;
}

.inv-sku {
  font-size: 0.74rem;
  color: var(--inv-ink-muted);
  margin-top: 1px;
}

.inv-price-main {
  font-size: 0.93rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1F2D18;
  white-space: nowrap;
}

.inv-price-sub {
  font-size: 0.73rem;
  color: var(--inv-ink-muted);
  margin-top: 1px;
  white-space: nowrap;
}

.inv-hpp-main {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--inv-ink-2);
  white-space: nowrap;
}

.inv-margin-sub {
  font-size: 0.73rem;
  font-weight: 550;
  color: #3A6620;
  margin-top: 1px;
  white-space: nowrap;
}

.inv-margin-sub.low {
  color: var(--inv-warn-fg);
}

.inv-row-actions {
  display: inline-grid;
  grid-template-columns: repeat(4, 32px);
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.inv-icon-spacer {
  width: 32px;
  height: 32px;
  display: block;
}

/* Stock Mutation History Panel */
.inv-log-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 14px;
  border-bottom: 1px solid var(--inv-divider);
}

.inv-log-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--inv-ink);
}

.inv-log-sub {
  font-size: 0.78rem;
  color: var(--inv-ink-muted);
  margin-top: 2px;
}

.inv-log-table-wrap { display: none; }
.inv-log-list { display: block; }

.inv-log-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #EEF1EA;
}
.inv-log-row:last-child { border-bottom: 0; }

.inv-log-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.inv-log-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.inv-log-prod {
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--inv-ink);
}

.inv-log-detail {
  font-size: 0.76rem;
  color: var(--inv-ink-muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.inv-log-delta {
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--inv-ink);
}
.inv-log-delta.pos { color: #246016; }

/* Empty State */
.inv-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 36px 20px;
  text-align: center;
}

.inv-empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--inv-subtle);
  border: 1px solid var(--inv-divider);
  color: var(--inv-ink-muted);
}

.inv-empty-title {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--inv-ink);
}

.inv-empty-sub {
  font-size: 0.8rem;
  color: var(--inv-ink-muted);
  max-width: 320px;
}

/* Responsive Rules for Produk */
@container pos-app (max-width: 350px) {
  .main-col:has(#view-produk.active) .workspace { padding-inline: 12px; }
  .inv-mob-bar { flex-wrap: wrap; }
  .inv-mob-stock-btn { width: 100%; }
  .inv-sum-cell { padding: 10px 11px; }
  .inv-sum-val { font-size: 0.94rem; }
}

@container pos-app (min-width: 720px) {
  .inv-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .inv-sum-sku,
  .inv-sum-low,
  .inv-sum-asset {
    border-bottom: 0;
    border-right: 1px solid var(--inv-divider);
  }
  .inv-sum-margin {
    border-bottom: 0;
    border-right: 0;
  }
  .inv-sum-cell {
    padding: 13px 16px;
  }
  .inv-sum-val {
    font-size: 1.12rem;
  }
}

@container pos-app (min-width: 760px) {
  .inv-search-row {
    grid-template-columns: minmax(0, 1fr) 210px;
  }
  .inv-cat-icon-btn { display: none; }
  .inv-select-wrap.inv-cat-select-wrap { display: flex; }

  #invCatalogPanel {
    background: var(--inv-surface);
    border: 1px solid var(--inv-border);
    border-radius: 14px;
    overflow: hidden;
    display: block;
  }
  #invCatalogPanel .inv-toolbar {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--inv-divider);
    border-radius: 0;
    padding: 14px;
  }
  #invCatalogPanel .inv-empty {
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .inv-table-wrap,
  .inv-log-table-wrap { display: block; }
  .inv-mob-list,
  .inv-log-list { display: none; }
}

@container pos-app (760px <= width < 920px) {
  .inv-col-cat { display: none; }
}

@container pos-app (min-width: 840px) {
  .main-col:has(#view-produk.active) .workspace {
    padding: 18px 20px 28px;
  }
  .inv-header { display: flex; }
  .inv-mob-bar { display: none; }
  .inv-toolbar { padding: 14px 16px; }
  .inv-log-head { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .inv-page,
  .inv-page * {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Produk: Icon-Only Row Actions & Product Detail (Pergerakan Stok)
   ========================================================================== */

.inv-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--inv-ink-2);
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease;
}

.inv-icon-btn .icon-sm {
  width: 16px;
  height: 16px;
}

.inv-icon-btn:hover {
  background: #EFF2EB;
  color: var(--inv-ink);
}

.inv-icon-btn.stock {
  background: transparent;
  border: 0;
  color: #3F6A1A;
}

.inv-icon-btn.stock:hover {
  background: var(--inv-soft-green);
  color: var(--inv-green-fg);
}

.inv-icon-btn.danger {
  background: transparent;
  border: 0;
  color: #B84A41;
}

.inv-icon-btn.danger:hover {
  background: var(--inv-err-bg);
  color: var(--inv-err-fg);
}

.inv-icon-btn.fav.is-fav {
  color: #D98B0A;
}

.inv-icon-btn.fav.is-fav svg {
  fill: currentColor;
}

.product-fav-star {
  display: inline-block;
  width: 13px;
  height: 13px;
  color: #D98B0A;
  fill: currentColor;
  vertical-align: -1.5px;
  margin-right: 4px;
  flex-shrink: 0;
}

.inv-icon-btn.fav:hover {
  background: #FFF6E0;
  color: #B87206;
}

.inv-icon-btn.more[aria-expanded="true"] {
  background: #EAEFE3;
  color: var(--inv-ink);
}

/* Floating Three-Dot Row Action Menu */
.inv-row-menu {
  position: fixed;
  z-index: 95;
  min-width: 164px;
  padding: 5px;
  border-radius: 11px;
  background: #FFFFFF;
  border: 1px solid #DCE2D6;
  box-shadow: 0 10px 26px rgba(24, 34, 18, 0.14);
  display: grid;
  gap: 2px;
}

.inv-row-menu[hidden] {
  display: none !important;
}

.inv-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: #263020;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.inv-menu-item:hover {
  background: #F4F6F1;
}

.inv-menu-item:focus-visible {
  outline: 2px solid var(--brand-olive);
  outline-offset: -2px;
}

.inv-menu-item.danger {
  color: #A93D34;
}

.inv-menu-item.danger:hover {
  background: #FCE8E5;
}

.inv-detail-head-actions .inv-icon-btn {
  width: 36px;
  height: 36px;
  background: var(--inv-surface);
  border: 1px solid var(--inv-border);
}

.inv-detail-head-actions .inv-icon-btn.stock {
  background: var(--inv-soft-green);
  border-color: #C5E293;
  color: var(--inv-green-fg);
}

.inv-detail-head-actions .inv-icon-btn.danger {
  border-color: #E7D4D2;
}

.inv-mob-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #F1F3EE;
}

.inv-mob-icon-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.inv-mob-icon-actions .inv-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.inv-mob-icon-actions .inv-icon-btn .icon-sm {
  width: 15px;
  height: 15px;
}

/* Product Detail Sub-View */
.inv-detail {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.inv-detail > * { min-width: 0; }

.inv-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
}

.inv-detail-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 220px;
}

.inv-detail-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--inv-surface);
  border: 1px solid var(--inv-border);
  color: var(--inv-ink);
  flex-shrink: 0;
  transition: background 0.14s ease;
}
.inv-detail-back:hover { background: var(--inv-subtle); }

.inv-detail-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--inv-divider);
  background: var(--inv-surface);
  flex-shrink: 0;
  display: block;
}

.inv-detail-title-wrap {
  min-width: 0;
}

.inv-detail-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--inv-ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.inv-detail-sub {
  font-size: 0.78rem;
  color: var(--inv-ink-muted);
  margin-top: 2px;
}

.inv-detail-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Current Stock Card */
.inv-detail-stock-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 16px;
  background: var(--inv-surface);
  border: 1px solid var(--inv-border);
  border-radius: 14px;
}

.inv-detail-stock-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.inv-detail-stock-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--inv-soft-green);
  color: var(--inv-green-fg);
  flex-shrink: 0;
}

.inv-detail-stock-label {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--inv-ink);
}

.inv-detail-stock-meta {
  font-size: 0.76rem;
  color: var(--inv-ink-muted);
  margin-top: 1px;
}

.inv-detail-stock-val {
  font-size: 1.18rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--inv-ink);
  white-space: nowrap;
}
.inv-detail-stock-val.low { color: var(--inv-warn-fg); }
.inv-detail-stock-val.out { color: var(--inv-err-fg); }
.inv-detail-stock-val.nonstock { color: var(--inv-ink-muted); font-size: 0.94rem; font-weight: 650; }

/* Period Segmented Bar (7 Hari | 30 Hari | Semua) */
.inv-detail-periods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 4px;
  border-radius: 12px;
  background: #E5E9DF;
}

.inv-detail-period {
  min-height: 38px;
  border-radius: 9px;
  color: var(--inv-ink-2);
  font-size: 0.84rem;
  font-weight: 600;
  transition: background 0.14s ease, color 0.14s ease;
}
.inv-detail-period:hover { color: var(--inv-ink); }
.inv-detail-period.active {
  background: var(--inv-surface);
  color: var(--inv-ink);
  box-shadow: 0 1px 2px rgba(24, 34, 18, 0.08);
}

/* 4-Metric Movement Summary Strip (2x2 mobile, 4-col tablet) */
.inv-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--inv-surface);
  border: 1px solid var(--inv-border);
  border-radius: 14px;
  overflow: hidden;
}

.inv-stat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 12px;
  text-align: center;
  min-width: 0;
}

.inv-stat-masuk {
  border-right: 1px solid var(--inv-divider);
  border-bottom: 1px solid var(--inv-divider);
}
.inv-stat-terjual {
  border-bottom: 1px solid var(--inv-divider);
}
.inv-stat-keluar {
  border-right: 1px solid var(--inv-divider);
}

.inv-stat-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.inv-stat-icon.masuk { background: var(--inv-soft-green); color: #246016; }
.inv-stat-icon.terjual { background: var(--inv-warn-bg); color: var(--inv-warn-fg); }
.inv-stat-icon.keluar { background: var(--inv-err-bg); color: var(--inv-err-fg); }
.inv-stat-icon.opname { background: #EEF2F7; color: #3A5169; }

.inv-stat-num {
  font-size: 1.24rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--inv-ink);
  line-height: 1.15;
}

.inv-stat-lbl {
  font-size: 0.75rem;
  font-weight: 550;
  color: var(--inv-ink-muted);
}

/* Movement Ledger Rows */
.inv-move-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #EEF1EA;
  width: 100%;
  text-align: left;
  background: transparent;
  transition: background 0.12s ease;
}
.inv-move-row:last-child { border-bottom: 0; }
button.inv-move-row { cursor: pointer; }
button.inv-move-row:hover { background: #FAFBF8; }

.inv-move-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.inv-move-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}
.inv-move-icon.masuk { background: var(--inv-soft-green); color: #246016; }
.inv-move-icon.terjual { background: var(--inv-warn-bg); color: var(--inv-warn-fg); }
.inv-move-icon.keluar { background: var(--inv-err-bg); color: var(--inv-err-fg); }
.inv-move-icon.opname { background: #EEF2F7; color: #3A5169; }

.inv-move-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.inv-move-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.inv-move-time {
  font-size: 0.75rem;
  color: var(--inv-ink-muted);
}

.inv-move-detail {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--inv-ink);
  overflow-wrap: anywhere;
}

.inv-move-delta {
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.inv-move-delta.pos { color: #246016; }
.inv-move-delta.neg { color: var(--inv-err-fg); }

@container pos-app (min-width: 720px) {
  .inv-detail-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .inv-stat-masuk,
  .inv-stat-terjual,
  .inv-stat-keluar {
    border-bottom: 0;
    border-right: 1px solid var(--inv-divider);
  }
  .inv-stat-opname {
    border-bottom: 0;
    border-right: 0;
  }
  .inv-stat-cell { padding: 16px 14px; }
  .inv-stat-num { font-size: 1.36rem; }
}

@container pos-app (min-width: 840px) {
  .inv-detail-title { font-size: 1.32rem; }
  .inv-move-row { padding: 13px 16px; }
}

/* Compact Import CSV Modal */
.modal-card:has(> .imp-sheet) {
  max-width: 440px;
  padding: 20px;
  border-radius: 18px;
}

.imp-sheet {
  display: grid;
  gap: 14px;
  color: #263020;
}

.imp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.imp-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #263020;
}

.imp-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: -6px;
  border-radius: 9px;
  background: transparent;
  color: #55634F;
}
.imp-close:hover { background: #F1F3EE; color: #263020; }

.imp-sub {
  font-size: 0.85rem;
  color: #55634F;
  margin-top: -6px;
}

.inv-import-drop {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 24px 16px;
  border: 1px solid #DCE2D6;
  border-radius: 12px;
  background: #F7F8F4;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.inv-import-drop:hover {
  border-color: #B4DA77;
  background: #F1F6E8;
}

.imp-drop-icon {
  color: #3A6620;
  margin-bottom: 2px;
}
.imp-drop-icon .icon {
  width: 28px;
  height: 28px;
}

.imp-drop-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #263020;
}

.imp-drop-sub {
  font-size: 0.8rem;
  color: #5D6B57;
}

.imp-template-wrap {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.imp-template-q {
  font-size: 0.82rem;
  color: #5D6B57;
}

.imp-template-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #3A6620;
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
}
.imp-template-link:hover { text-decoration: underline; }

.imp-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #E7EBE2;
}

.imp-btn-cancel {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #55634F;
  font-size: 0.88rem;
  font-weight: 600;
}
.imp-btn-cancel:hover { background: #F1F3EE; color: #263020; }

.imp-btn-submit {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid rgba(36, 56, 10, 0.14);
  background: var(--brand-lime);
  color: #192412;
  font-size: 0.88rem;
  font-weight: 650;
  transition: background 0.14s ease, opacity 0.14s ease;
}
.imp-btn-submit:hover:not(:disabled) { background: var(--brand-lime-hover); }
.imp-btn-submit:disabled {
  background: #DFEEB9;
  border-color: transparent;
  color: #7D8F67;
  cursor: not-allowed;
}

.inv-import-preview {
  max-height: 200px;
  overflow: auto;
  border: 1px solid #E0E5DB;
  border-radius: 10px;
}

.inv-import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.inv-import-table th {
  position: sticky;
  top: 0;
  background: #F7F8F4;
  color: #5D6B57;
  font-weight: 650;
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid #E7EBE2;
}

.inv-import-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #EEF1EA;
  color: #263020;
}
.inv-import-table tr:last-child td { border-bottom: 0; }

/* ==========================================================================
   Product Form Modal (Tambah / Edit Produk)
   ========================================================================== */

.modal-card:has(> .pf-sheet) {
  max-width: 640px;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}

.pf-sheet {
  position: relative;
  --inv-surface: #FFFFFF;
  --inv-subtle: #F7F8F4;
  --inv-ink: #263020;
  --inv-ink-2: #4E5B48;
  --inv-ink-muted: #5D6B57;
  --inv-border: #E0E5DB;
  --inv-divider: #E7EBE2;
  --inv-ctrl-border: #D5DCD0;
  --inv-soft-green: #EAF4DB;
  --inv-green-fg: #24380A;
  --inv-warn-bg: #FFF0D9;
  --inv-warn-fg: #986421;
  --inv-err-bg: #FCE8E5;
  --inv-err-fg: #A93D34;
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 840px);
  min-height: 0;
  color: #263020;
}

.pf-sheet [hidden] {
  display: none !important;
}

.pf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #E7EBE2;
  background: #FFFFFF;
  flex-shrink: 0;
}

.pf-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #263020;
}

.pf-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  padding: 16px 20px 20px;
  overflow-y: auto;
  min-height: 0;
}

.pf-body > * {
  flex-shrink: 0;
}

.pf-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.pf-label {
  font-size: 0.8rem;
  font-weight: 650;
  color: #263020;
}

.pf-req {
  color: #A93D34;
}

.pf-input,
.pf-textarea {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid #D5DCD0;
  border-radius: 10px;
  background: #FFFFFF;
  color: #263020;
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.pf-input {
  height: 44px;
}

.pf-textarea {
  padding: 10px 12px;
  resize: vertical;
  min-height: 82px;
  line-height: 1.45;
}

.pf-input:focus,
.pf-textarea:focus {
  outline: none;
  border-color: var(--brand-olive);
  box-shadow: 0 0 0 2px rgba(63, 94, 22, 0.12);
}

.pf-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-inline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #D5DCD0;
  background: #FFFFFF;
  color: #4E5B48;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease;
}
.pf-inline-btn:hover {
  background: #F4F6F1;
  color: #263020;
}

.pf-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-photo[src^="data:image/"] {
  object-fit: cover;
}

.inv-thumb-ph {
  display: inline-grid;
  place-items: center;
  background: #F1F3EE;
  color: #7A8774;
}

.pf-opt {
  font-weight: 500;
  color: #6E7B68;
}

/* Minimal Photo Selector (No outer container, border, or shadow) */
.pf-photo-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 2px 4px 2px 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease;
}

.pf-photo-trigger:hover {
  background: #F7F8F4;
}

.pf-photo-filled {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 0;
}

.pf-photo-thumb {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: #F1F3EE;
  color: #6E7B68;
  overflow: hidden;
  flex-shrink: 0;
}

.pf-photo-thumb .icon {
  width: 26px;
  height: 26px;
}

.pf-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pf-photo-copy {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.pf-photo-title {
  font-size: 0.92rem;
  font-weight: 650;
  color: #263020;
  line-height: 1.3;
}

.pf-photo-sub {
  font-size: 0.8rem;
  color: #5D6B57;
  line-height: 1.35;
}

.pf-photo-chev {
  width: 18px;
  height: 18px;
  color: #6E7B68;
  flex-shrink: 0;
}

.pf-photo-actions-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.pf-text-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #3A6620;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}
.pf-text-act:hover { text-decoration: underline; }
.pf-text-act.danger { color: #B84A41; }

/* Source Picker: Bottom Sheet on Mobile, Compact Dialog on Tablet */
.pf-source-scrim {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 26, 17, 0.42);
}

.pf-source-card {
  width: 100%;
  max-width: 320px;
  background: #FFFFFF;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
  box-shadow: 0 18px 40px rgba(18, 24, 15, 0.22);
}

.pf-source-handle {
  display: none;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #D5DCD0;
  margin: 0 auto 4px;
}

.pf-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 4px;
}

.pf-source-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #263020;
}

.pf-source-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #E7EBE2;
  background: #FAFBF8;
  color: #263020;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.pf-source-item:hover {
  background: #EAF4DB;
  border-color: #C5E293;
  color: #24380A;
}

.pf-source-item .icon {
  color: #3A6620;
  flex-shrink: 0;
}

@container pos-app (max-width: 600px) {
  .pf-source-scrim {
    align-items: flex-end;
    padding: 0;
  }
  .pf-source-card {
    max-width: none;
    border-radius: 18px 18px 0 0;
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .pf-source-handle {
    display: block;
  }
}

/* ==========================================================================
   Compact Photo Editor (1:1 Cropper - Tablet Centered Dialog & Mobile Full-Screen)
   ========================================================================== */

.pce-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 20, 14, 0.56);
}

.pce-backdrop[hidden] {
  display: none !important;
}

.pce-dialog {
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-radius: 16px;
  overflow: hidden;
  color: #263020;
  box-shadow: 0 20px 44px rgba(14, 20, 11, 0.24);
}

.pce-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #E7EBE2;
  background: #FFFFFF;
  flex-shrink: 0;
}

.pce-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pce-back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-left: -12px;
  border-radius: 12px;
  background: transparent;
  color: #263020;
  flex-shrink: 0;
}
.pce-back-btn:hover { background: #F1F3EE; }
.pce-back-btn .icon { width: 22px; height: 22px; }

.pce-title-group {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pce-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #263020;
  line-height: 1.25;
}

.pce-sub {
  font-size: 0.78rem;
  color: #5D6B57;
  line-height: 1.3;
}

.pce-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-right: -10px;
  border-radius: 12px;
  background: transparent;
  color: #4E5B48;
  flex-shrink: 0;
}
.pce-close-btn:hover { background: #F1F3EE; color: #263020; }
.pce-close-btn .icon { width: 20px; height: 20px; }

/* Dark Neutral Crop Workspace */
.pce-stage-wrap {
  padding: 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
}

.pce-stage {
  position: relative;
  width: 100%;
  height: 316px;
  border-radius: 12px;
  background: #191D16;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pce-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
.pce-canvas.dragging { cursor: grabbing; }

.pce-hint {
  font-size: 0.78rem;
  color: #5D6B57;
  text-align: center;
  line-height: 1.3;
}

/* Editor Controls (Flat, compact, 48x48 touch targets) */
.pce-controls {
  padding: 8px 16px 12px;
  display: grid;
  gap: 4px;
  flex-shrink: 0;
}

.pce-zoom-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pce-icon-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: transparent;
  color: #263020;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease;
}
.pce-icon-act:hover { background: #F1F3EE; }
.pce-icon-act:disabled { opacity: 0.35; cursor: not-allowed; }
.pce-icon-act .icon { width: 20px; height: 20px; }

.pce-slider {
  flex: 1 1 auto;
  min-width: 0;
  height: 32px;
  accent-color: #3F6A1A;
  cursor: pointer;
}

.pce-zoom-pct {
  min-width: 46px;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 650;
  color: #4E5B48;
}

.pce-tools-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pce-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  padding: 0 10px;
  border-radius: 12px;
  background: transparent;
  color: #263020;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}
.pce-tool-btn:hover { background: #F1F3EE; }
.pce-tool-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pce-tool-btn .icon { width: 20px; height: 20px; color: #4E5B48; flex-shrink: 0; }

/* Sticky Footer Directly Below Controls */
.pce-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 12px;
  padding: 12px 16px 16px;
  border-top: 1px solid #E7EBE2;
  background: #FFFFFF;
  flex-shrink: 0;
}

.pce-btn-cancel,
.pce-btn-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 650;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.pce-btn-cancel {
  background: #FFFFFF;
  border: 1px solid #D5DCD0;
  color: #263020;
}
.pce-btn-cancel:hover { background: #F4F6F1; }

.pce-btn-apply {
  background: var(--brand-lime);
  border: 1px solid rgba(36, 56, 10, 0.14);
  color: #192412;
}
.pce-btn-apply:hover { background: var(--brand-lime-hover); }

.pce-dialog button:focus-visible,
.pce-dialog input:focus-visible {
  outline: 2px solid var(--brand-olive);
  outline-offset: 2px;
}

/* Mobile Full-Screen Photo Editor (<= 600px) */
@media (max-width: 600px) {
  .pce-backdrop {
    padding: 0;
    background: #FFFFFF;
  }
  .pce-dialog {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
  .pce-head {
    padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  }
  .pce-back-btn { display: inline-flex; }
  .pce-close-btn { display: none; }
  .pce-sub { display: none; }
  .pce-stage-wrap {
    padding: 0;
    gap: 0;
    background: #191D16;
  }
  .pce-stage {
    flex: 1 1 auto;
    height: auto;
    min-height: 260px;
    border-radius: 0;
  }
  .pce-hint {
    padding: 10px 16px 12px;
    color: rgba(255, 255, 255, 0.72);
    background: #191D16;
  }
  .pce-controls {
    padding: 10px 16px 8px;
    background: #FFFFFF;
  }
  .pce-foot {
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  }
}

/* Mobile Preview Frame Mode Support */
body.mobile-preview .pce-backdrop {
  position: absolute;
  padding: 0;
  background: #FFFFFF;
}
body.mobile-preview .pce-dialog {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}
body.mobile-preview .pce-back-btn { display: inline-flex; }
body.mobile-preview .pce-close-btn { display: none; }
body.mobile-preview .pce-sub { display: none; }
body.mobile-preview .pce-stage-wrap {
  padding: 0;
  gap: 0;
  background: #191D16;
}
body.mobile-preview .pce-stage {
  flex: 1 1 auto;
  height: auto;
  min-height: 260px;
  border-radius: 0;
}
body.mobile-preview .pce-hint {
  padding: 10px 16px 12px;
  color: rgba(255, 255, 255, 0.72);
  background: #191D16;
}
body.mobile-preview .pce-controls {
  padding: 10px 16px 8px;
  background: #FFFFFF;
}
body.mobile-preview .pce-foot {
  padding: 12px 16px 16px;
}

/* ==========================================================================
   Detail Produk: Product Overview & Simple Stock Activity (Mobile & Tablet)
   ========================================================================== */

.pd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pd-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pd-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-left: -6px;
  border-radius: 12px;
  background: transparent;
  color: #263020;
  flex-shrink: 0;
  transition: background 0.14s ease;
}
.pd-back-btn:hover { background: #E5E9DF; }
.pd-back-btn .icon { width: 22px; height: 22px; }

.pd-page-title {
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #263020;
  white-space: nowrap;
}

.pd-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pd-head-tablet-acts {
  display: none;
  align-items: center;
  gap: 8px;
}

.pd-head-tablet-acts .inv-btn-outline,
.pd-head-tablet-acts .inv-btn-primary {
  min-height: 44px;
  border-radius: 11px;
}

.pd-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: transparent;
  color: #263020;
  flex-shrink: 0;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.pd-more-btn:hover { background: #E5E9DF; }
.pd-more-btn .icon { width: 20px; height: 20px; }

/* Integrated Product Overview Card */
.pd-overview {
  background: #FFFFFF;
  border: 1px solid #E0E5DB;
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.pd-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.pd-identity-wrap {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 12px;
  align-items: start;
  min-width: 0;
}

.pd-photo {
  grid-column: 1;
  grid-row: 1;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  background: #F1F3EE;
  border: 1px solid #EAEFE5;
  flex-shrink: 0;
  display: block;
}

.pd-photo.inv-thumb-ph {
  display: inline-grid;
  place-items: center;
}
.pd-photo.inv-thumb-ph .icon {
  width: 28px;
  height: 28px;
}

.pd-mid {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pd-name {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #263020;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pd-meta-line {
  font-size: 0.82rem;
  color: #687762;
  line-height: 1.35;
}

.pd-fav-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 650;
  color: #B87206;
  margin-top: 2px;
}
.pd-fav-tag svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.pd-desc {
  font-size: 0.82rem;
  color: #55634F;
  line-height: 1.45;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

/* Pricing Strip inside Overview Card */
.pd-pricing {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 0.7fr);
  padding-top: 12px;
  border-top: 1px solid #E7EBE2;
}

.pd-price-col {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-right: 10px;
}

.pd-price-col + .pd-price-col {
  padding-left: 10px;
  border-left: 1px solid #E7EBE2;
}

.pd-price-col:last-child {
  padding-right: 0;
}

.pd-price-lbl {
  font-size: 0.74rem;
  font-weight: 550;
  color: #687762;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-lbl-full { display: none; }
.pd-lbl-short { display: inline; }

.pd-price-val {
  font-size: 0.98rem;
  font-weight: 700;
  color: #263020;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pd-price-val.hpp {
  font-weight: 600;
  color: #3F4C3A;
}

.pd-price-val.margin {
  color: #2F6018;
}
.pd-price-val.margin.low {
  color: #986421;
}

.pd-price-unit {
  font-size: 0.72rem;
  color: #687762;
}

/* Current Stock Highlight Box */
.pd-stock-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #EAF4DB;
  color: #202D19;
  min-width: 0;
}

.pd-stock-box.low {
  background: #FFF0D9;
  color: #7D4E12;
}

.pd-stock-box.out {
  background: #FCE8E5;
  color: #8F2F28;
}

.pd-stock-box.nonstock {
  background: #F1F3EE;
  color: #55634F;
}

.pd-stock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pd-stock-lbl {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.85;
}

.pd-stock-top .icon {
  width: 20px;
  height: 20px;
  opacity: 0.85;
}

.pd-stock-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}

.pd-stock-qty-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.pd-stock-num {
  font-size: 1.85rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.pd-stock-unit {
  font-size: 0.92rem;
  font-weight: 600;
  opacity: 0.88;
}

.pd-stock-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 650;
}

.pd-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.pd-nonstock-text {
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.35;
}

/* Mobile Action Buttons inside Overview Card */
.pd-mob-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pd-mob-actions.single {
  grid-template-columns: minmax(0, 1fr);
}

.pd-mob-actions button {
  min-height: 48px;
  border-radius: 12px;
  font-size: 0.86rem;
}

/* Section Header & Period Filter */
.pd-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.pd-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #263020;
  line-height: 1.25;
}

.pd-period-seg {
  display: none;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: #E5E9DF;
  flex-shrink: 0;
}

.pd-period-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4E5B48;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}
.pd-period-btn:hover { color: #263020; }
.pd-period-btn.active {
  background: #FFFFFF;
  color: #263020;
  box-shadow: 0 1px 2px rgba(20, 30, 15, 0.08);
}

.pd-period-select-wrap {
  width: 132px;
  flex-shrink: 0;
  border-radius: 999px;
}

.pd-period-select-wrap .inv-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  height: 38px;
  padding: 0 32px 0 14px;
  border: 1px solid #DCE2D6;
  border-radius: 999px;
  background-color: #FFFFFF;
  background-image: none;
  color: #263020;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 36px;
  white-space: nowrap;
}

.pd-period-select-wrap .inv-select-icon {
  right: 11px;
  color: #55634F;
}

/* Integrated 3-Column Summary Card (Interactive Filter) */
.pd-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #FFFFFF;
  border: 1px solid #E0E5DB;
  border-radius: 14px;
  overflow: hidden;
}

.pd-sum-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 86px;
  padding: 12px 8px;
  background: transparent;
  text-align: center;
  cursor: pointer;
  min-width: 0;
  transition: background 0.14s ease, box-shadow 0.14s ease;
}

.pd-sum-btn + .pd-sum-btn {
  border-left: 1px solid #E7EBE2;
}

.pd-sum-btn:hover {
  background: #FAFBF8;
}

.pd-sum-btn.active.masuk {
  background: #F2F9E8;
  box-shadow: inset 0 0 0 1.5px #B4DA77;
}
.pd-sum-btn.active.terjual {
  background: #FFF6E6;
  box-shadow: inset 0 0 0 1.5px #E8C07D;
}
.pd-sum-btn.active.keluar {
  background: #FDF0EE;
  box-shadow: inset 0 0 0 1.5px #E5ABA4;
}

.pd-sum-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
}
.pd-sum-icon.masuk { background: #EAF4DB; color: #246016; }
.pd-sum-icon.terjual { background: #FFF0D9; color: #986421; }
.pd-sum-icon.keluar { background: #FCE8E5; color: #A93D34; }
.pd-sum-icon .icon { width: 18px; height: 18px; }

.pd-sum-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.pd-sum-lbl {
  font-size: 0.74rem;
  font-weight: 600;
  color: #687762;
}

.pd-sum-qty {
  font-size: 1.04rem;
  font-weight: 750;
  color: #263020;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.pd-sum-unit {
  font-size: 0.74rem;
  font-weight: 550;
  color: #687762;
}

/* History Header & Filter Reset */
.pd-hist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #E7EBE2;
}

.pd-hist-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #263020;
}

.pd-hist-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #687762;
}

.pd-reset-link {
  min-height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  background: #EAF4DB;
  color: #24380A;
  font-size: 0.76rem;
  font-weight: 650;
}
.pd-reset-link:hover { background: #DCEFB9; }

/* Tablet Full-Width Table vs Mobile Grouped List */
.pd-table-wrap { display: none; }
.pd-mob-groups { display: block; }

.pd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.pd-table thead th {
  background: #F7F8F4;
  color: #687762;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1;
  vertical-align: middle;
  text-align: left;
  padding: 13px 16px 11px;
  border-bottom: 1px solid #E7EBE2;
  white-space: nowrap;
}

.pd-table th.pd-col-qty,
.pd-table td.pd-col-qty {
  text-align: right;
  white-space: nowrap;
}

.pd-table tbody tr {
  border-bottom: 1px solid #EEF1EA;
}
.pd-table tbody tr:last-child { border-bottom: 0; }

.pd-table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
}

.pd-cell-time {
  color: #687762;
  font-size: 0.8rem;
  white-space: nowrap;
}

.pd-cell-main {
  font-size: 0.86rem;
  font-weight: 650;
  color: #263020;
  line-height: 1.3;
}

.pd-cell-sub {
  font-size: 0.76rem;
  color: #687762;
  margin-top: 2px;
  line-height: 1.35;
}

/* Mobile Date Groups */
.pd-date-group + .pd-date-group {
  border-top: 1px solid #E7EBE2;
}

.pd-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: #F7F8F4;
  border-bottom: 1px solid #EEF1EA;
  font-size: 0.76rem;
  font-weight: 650;
  color: #55634F;
}

.pd-mob-move {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  width: 100%;
  text-align: left;
  background: transparent;
  border-bottom: 1px solid #EEF1EA;
}
.pd-mob-move:last-child { border-bottom: 0; }

.pd-mob-move-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.pd-mob-move-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pd-mob-move-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: #687762;
}

.pd-mob-move-kind {
  font-weight: 700;
}
.pd-mob-move-kind.masuk { color: #246016; }
.pd-mob-move-kind.terjual { color: #986421; }
.pd-mob-move-kind.keluar { color: #A93D34; }

.pd-mob-move-title {
  font-size: 0.85rem;
  font-weight: 650;
  color: #263020;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pd-mob-move-sub {
  font-size: 0.76rem;
  color: #687762;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pd-move-qty {
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.pd-move-qty.pos { color: #246016; }
.pd-move-qty.neg { color: #A93D34; }

.inv-cat-scrim {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(16, 20, 14, 0.42);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.inv-cat-scrim[hidden] {
  display: none !important;
}

.inv-cat-sheet {
  width: 100%;
  max-width: 480px;
  max-height: min(76dvh, 520px);
  background: #FFFFFF;
  border-radius: 18px 18px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 -8px 28px rgba(14, 20, 11, 0.16);
}

.inv-cat-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid #EEF1EA;
}

.inv-cat-sheet-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #263020;
}

.inv-cat-clear {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: #EAF4DB;
  color: #24380A;
  font-size: 0.78rem;
  font-weight: 650;
}

.inv-cat-sheet-list {
  display: grid;
  gap: 2px;
  overflow-y: auto;
  min-height: 0;
}

.inv-cat-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 11px;
  background: transparent;
  color: #263020;
  font-size: 0.9rem;
  font-weight: 550;
  text-align: left;
  transition: background 0.12s ease;
}
.inv-cat-option:hover { background: #F5F7F2; }
.inv-cat-option.active {
  background: #EAF4DB;
  color: #24380A;
  font-weight: 700;
}

.inv-cat-opt-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inv-cat-opt-count {
  font-size: 0.76rem;
  font-weight: 600;
  color: #687762;
  padding: 2px 7px;
  border-radius: 999px;
  background: #F1F3EE;
}
.inv-cat-option.active .inv-cat-opt-count {
  background: #D8ECBA;
  color: #24380A;
}

.inv-cat-check {
  color: #2F6018;
  flex-shrink: 0;
}

/* Detail Three-Dot Action Menu (Bottom Sheet Mobile, Anchored Popover Tablet) */
.pd-action-scrim {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(16, 20, 14, 0.42);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.pd-action-scrim[hidden] {
  display: none !important;
}

.pd-action-card {
  width: 100%;
  background: #FFFFFF;
  border-radius: 18px 18px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  display: grid;
  gap: 4px;
  box-shadow: 0 -8px 28px rgba(14, 20, 11, 0.16);
}

.pd-action-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #D5DCD0;
  margin: 0 auto 6px;
}

.pd-action-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #263020;
  padding: 4px 6px 8px;
  border-bottom: 1px solid #EEF1EA;
}

.pd-action-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 48px;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  color: #263020;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  transition: background 0.12s ease;
}
.pd-action-item:hover { background: #F4F6F1; }
.pd-action-item .icon { width: 20px; height: 20px; color: #4E5B48; flex-shrink: 0; }
.pd-action-item.fav .icon { color: #D98B0A; }
.pd-action-item.fav.is-fav .icon { fill: currentColor; }
.pd-action-item.danger { color: #B84A41; }
.pd-action-item.danger .icon { color: #B84A41; }
.pd-action-item.danger:hover { background: #FCE8E5; }

.pd-action-sep {
  height: 1px;
  background: #EEF1EA;
  margin: 4px 0;
}

@media (min-width: 601px) {
  body:not(.mobile-preview) .pd-action-scrim {
    background: transparent;
    display: block;
  }
  body:not(.mobile-preview) .pd-action-card {
    position: fixed;
    width: 240px;
    border-radius: 14px;
    border: 1px solid #DCE2D6;
    padding: 8px;
    box-shadow: 0 12px 30px rgba(20, 28, 16, 0.16);
  }
  body:not(.mobile-preview) .pd-action-handle {
    display: none;
  }
  body:not(.mobile-preview) .pd-action-title {
    font-size: 0.82rem;
    padding: 4px 8px 6px;
  }
  body:not(.mobile-preview) .pd-action-item {
    min-height: 44px;
    font-size: 0.84rem;
  }
}

/* Popup Kurangi Stok (Stock-Out Modal) */
.modal-card:has(> .so-sheet) {
  max-width: 440px;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}

.so-sheet {
  display: flex;
  flex-direction: column;
  max-height: min(90dvh, 720px);
  color: #263020;
}

.so-sheet [hidden] { display: none !important; }

.so-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 12px;
}

.so-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #263020;
}

.so-prod-name {
  font-size: 0.86rem;
  font-weight: 650;
  color: #263020;
}

.so-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 18px 16px;
  overflow-y: auto;
  min-height: 0;
}
.so-body > * { flex-shrink: 0; }

.so-stock-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #F4F6F1;
  font-size: 0.84rem;
  color: #55634F;
}

.so-stock-pill strong {
  color: #263020;
  font-size: 0.9rem;
}

.so-qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.so-qty-unit {
  font-size: 0.86rem;
  font-weight: 600;
  color: #55634F;
  white-space: nowrap;
}

.so-reasons {
  display: grid;
  gap: 4px;
}

.so-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: #263020;
  transition: background 0.12s ease;
}
.so-radio:hover { background: #F7F8F4; }
.so-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #202D19;
  cursor: pointer;
  flex-shrink: 0;
}

.so-error {
  font-size: 0.78rem;
  font-weight: 600;
  color: #A93D34;
}

.so-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #E7EBE2;
  font-size: 0.86rem;
  color: #55634F;
}

.so-preview strong {
  font-size: 1.04rem;
  font-weight: 750;
  color: #263020;
}
.so-preview.invalid strong {
  color: #A93D34;
}

.so-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  gap: 10px;
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  background: #FFFFFF;
  flex-shrink: 0;
}

.so-foot .pce-btn-apply:disabled {
  background: #DFEEB9;
  border-color: transparent;
  color: #7D8F67;
  cursor: not-allowed;
}

/* Tablet Breakpoint (>= 760px) for Detail Produk */
@container pos-app (min-width: 760px) {
  .pd-back-btn {
    width: 44px;
    height: 44px;
    margin-left: 0;
    background: #FFFFFF;
    border: 1px solid #E0E5DB;
  }
  .pd-more-btn {
    width: 44px;
    height: 44px;
    background: #FFFFFF;
    border: 1px solid #E0E5DB;
  }
  .pd-head-tablet-acts { display: flex; }
  .pd-mob-actions { display: none; }

  .pd-overview {
    padding: 18px 20px;
  }
  .pd-overview-grid {
    grid-template-columns: minmax(0, 1fr) 232px;
    gap: 20px;
    align-items: stretch;
  }
  .pd-identity-wrap {
    grid-template-columns: 128px minmax(0, 1fr);
    column-gap: 18px;
    row-gap: 8px;
  }
  .pd-photo {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 128px;
    height: 128px;
    border-radius: 14px;
  }
  .pd-name {
    font-size: 1.32rem;
  }
  .pd-pricing {
    grid-column: 2;
    grid-row: 2;
    margin-top: 4px;
  }
  .pd-price-val {
    font-size: 1.06rem;
  }
  .pd-price-col + .pd-price-col {
    border-left: 0;
    padding-left: 14px;
  }
  .pd-stock-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .pd-stock-num {
    font-size: 2rem;
  }

  .pd-period-seg { display: inline-flex; }
  .pd-period-select-wrap { display: none; }

  .pd-sum-btn {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 18px;
    min-height: 76px;
    text-align: left;
  }
  .pd-sum-icon {
    width: 40px;
    height: 40px;
  }
  .pd-sum-qty {
    font-size: 1.18rem;
  }
  .pd-sum-qty-inline {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
  }

  .pd-table-wrap { display: block; }
  .pd-mob-groups { display: none; }
}

@container pos-app (min-width: 920px) {
  .pd-lbl-full { display: inline; }
  .pd-lbl-short { display: none; }
}

.pf-profit-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 9px;
  background: #F7F8F4;
  border: 1px solid #E7EBE2;
  font-size: 0.78rem;
  color: #4E5B48;
}
.pf-profit-hint strong { color: #24380A; }
.pf-profit-hint.warn strong { color: #986421; }

.pf-toggle-card {
  border: 1px solid #E0E5DB;
  border-radius: 12px;
  background: #FFFFFF;
  overflow: hidden;
}

.pf-toggle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.pf-toggle-head .switch {
  flex-shrink: 0;
}

.pf-switch-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #D5DCD0;
  border-radius: 10px;
  background: #FFFFFF;
}

.pf-switch-box-label {
  font-size: 0.86rem;
  font-weight: 550;
  color: #4E5B48;
  white-space: nowrap;
}

.pf-switch-box.is-on {
  background: #FAFBF8;
  border-color: #B4DA77;
}

.pf-switch-box.is-on .pf-switch-box-label {
  color: #24380A;
  font-weight: 650;
}

.pf-switch-box .switch {
  flex-shrink: 0;
}

.pf-toggle-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pf-toggle-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 650;
  color: #263020;
}

.pf-toggle-title .icon {
  color: #3A6620;
}

.pf-toggle-sub {
  font-size: 0.75rem;
  line-height: 1.4;
  color: #5D6B57;
}

.pf-toggle-body {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid #EEF1EA;
  background: #FAFBF8;
}

.pf-sub-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.pf-sub-row.bundle {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.75fr) auto;
}

.pf-sub-row .pf-input,
.pf-sub-row .inv-select {
  height: 38px;
  font-size: 0.84rem;
}

.pf-rm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid #E7D4D2;
  background: #FFFFFF;
  color: #A93D34;
}
.pf-rm-btn:hover { background: #FCE8E5; }

.pf-add-sub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px dashed #B9C7AD;
  background: #FFFFFF;
  color: #24380A;
  font-size: 0.78rem;
  font-weight: 650;
  justify-self: start;
}
.pf-add-sub-btn:hover { background: #EAF4DB; }

.pf-char-count {
  text-align: right;
  font-size: 0.73rem;
  color: #5D6B57;
}

.pf-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #E7EBE2;
  background: #FFFFFF;
  flex-shrink: 0;
}

.pf-foot .inv-btn-primary,
.pf-foot .inv-btn-outline {
  min-height: 44px;
  padding: 0 18px;
}

.pf-preset-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding-top: 4px;
}

.pf-preset-grid[hidden],
.pf-toggle-body[hidden],
#pfStockFields[hidden],
#pfNewCatWrap[hidden] {
  display: none !important;
}

@container pos-app (max-width: 520px) {
  .modal-card:has(> .pf-sheet) {
    border-radius: 18px 18px 0 0;
  }
  .pf-head,
  .pf-body,
  .pf-foot {
    padding-inline: 16px;
  }
  .pf-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .pf-preset-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .pf-foot {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }
}
