@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --alam-cream: #FEFAEE;
  --alam-green: #4CAF4A;
  --alam-green-dark: #1E5E3A;
  --alam-green-light: #E8F5E9;
  --alam-orange: #FF8A00;
  --alam-orange-tint: #FFE6CC;
  --alam-text: #123F2E;
  --alam-muted: #667085;
  --alam-border: #E7E1D5;
  --alam-surface: #FFFFFF;
}

* { scrollbar-width: thin; scrollbar-color: rgba(30, 94, 58, 0.25) transparent; }

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--alam-cream);
  color: var(--alam-text);
  font-family: Inter, 'Plus Jakarta Sans', system-ui, sans-serif;
  font-feature-settings: "kern" 1, "liga" 1;
}

@media (max-width: 767px) {
  .input-field,
  .input-with-prefix,
  input[type="text"],
  input[type="search"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

.num-cell,
.tabular-nums,
.page-stats-value,
.kpi-tile-value,
[data-format] {
  font-variant-numeric: tabular-nums;
}

body.login-body {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  margin: 0;
}
html.login-html {
  height: 100%;
  overflow: hidden;
}
.login-page {
  position: relative;
  display: flex;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: url('../images/bg-login.webp') center / cover no-repeat;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(16, 94, 53, 0.72);
  pointer-events: none;
}
.login-page-main {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  min-height: 0;
  place-items: center;
  width: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1rem 0.5rem;
}
.login-card {
  width: 100%;
  max-width: 26rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, .98);
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 24px 60px rgba(8, 30, 18, .28);
}
@media (min-width: 640px) {
  .login-card { padding: 2rem 2rem 1.75rem; }
}
.login-brand {
  text-align: center;
  margin-bottom: 1.1rem;
}
.login-logo {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto;
  object-fit: contain;
}
.login-brand-title {
  margin: .65rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #105e35;
  letter-spacing: -.01em;
}
.login-brand-sub {
  margin: .2rem 0 0;
  font-size: .76rem;
  color: #667085;
}
.login-welcome-block {
  text-align: center;
}
.login-welcome {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #105e35;
  line-height: 1.25;
}
.login-welcome-sub {
  margin: .35rem 0 0;
  font-size: .78rem;
  color: #667085;
  line-height: 1.45;
}
.login-form {
  margin-top: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.login-field-group {
  display: block;
}
.login-field-label {
  display: block;
  margin-bottom: .35rem;
  font-size: .76rem;
  font-weight: 700;
  color: #105e35;
}
.login-field-wrap {
  position: relative;
}
.login-field-icon {
  position: absolute;
  left: .8rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8a9a8e;
  pointer-events: none;
  z-index: 1;
}
.login-field-input {
  width: 100%;
  min-height: 2.65rem;
  padding: .55rem 2.5rem .55rem 2.45rem;
  border: 1px solid rgba(219, 210, 190, .9);
  border-radius: .7rem;
  background: #fff;
  font-size: .82rem;
  color: var(--alam-text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.login-field-wrap-password .login-field-input {
  padding-right: 2.75rem;
}
.login-field-input::placeholder {
  color: #a0a8b0;
}
.login-field-input:focus {
  border-color: rgba(16, 94, 53, .45);
  box-shadow: 0 0 0 3px rgba(16, 94, 53, .1);
}
.login-field-wrap.is-caps .login-field-input {
  border-color: rgba(255, 160, 50, .75);
  box-shadow: 0 0 0 3px rgba(255, 160, 50, .16);
}
.login-field-wrap.is-caps:hover .login-field-input,
.login-field-wrap.is-caps .login-field-input:focus {
  border-color: rgba(255, 138, 0, .9);
  box-shadow:
    0 0 0 4px rgba(255, 160, 50, .28),
    0 0 20px rgba(255, 160, 50, .35);
}
.login-password-toggle {
  position: absolute;
  right: .45rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: #8a9a8e;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.login-password-toggle:hover {
  background: rgba(234, 247, 228, .8);
  color: #105e35;
}
.login-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .1rem;
}
.login-remember {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .74rem;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
}
.login-remember input {
  width: .95rem;
  height: .95rem;
  accent-color: #105e35;
  cursor: pointer;
}
.login-forgot {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: .74rem;
  font-weight: 700;
  color: #105e35;
  cursor: pointer;
  text-decoration: none;
}
.login-forgot:hover {
  text-decoration: underline;
}
.login-submit {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.75rem;
  margin-top: .25rem;
  border: 0;
  border-radius: .75rem;
  background: linear-gradient(180deg, #1a6b42, #105e35);
  color: #fff;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(16, 94, 53, .28);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.login-submit-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .22s ease;
}
.login-submit:hover {
  filter: brightness(1.04);
  box-shadow: 0 12px 28px rgba(16, 94, 53, .34);
}
.login-submit:hover .login-submit-arrow {
  transform: translateX(5px);
}
.login-submit:active {
  transform: translateY(1px);
}
.login-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  padding: 0.65rem 1rem calc(env(safe-area-inset-bottom) + 0.65rem);
  text-align: center;
  font-size: .7rem;
  color: rgba(255, 255, 255, .82);
  line-height: 1.5;
}
.login-footer-link {
  color: rgba(255, 255, 255, .95);
  font-weight: 700;
  text-decoration: none;
}
.login-footer-link:hover {
  color: #eaf7e4;
}
.login-card svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* PWA splash overlay (standalone mode) */
.pwa-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: #fefaee;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.pwa-splash[hidden] {
  display: none;
}
.pwa-splash.is-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.pwa-splash-logo {
  width: 5.5rem;
  height: 5.5rem;
  object-fit: contain;
  border-radius: 1.25rem;
  box-shadow: 0 12px 32px rgba(16, 94, 53, 0.18);
}
.pwa-splash-title {
  margin: 0.75rem 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #105e35;
  letter-spacing: -0.02em;
}
.pwa-splash-sub {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #667085;
}

.glass-card svg,
.panel-card svg,
.sidebar-item svg,
.sidebar-item-active svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.mobile-bottom-safe { padding-bottom: calc(env(safe-area-inset-bottom) + 5.25rem); }
@media (min-width: 1024px) {
  .lg\:mobile-bottom-safe-0 { padding-bottom: 0; }
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
  .print-card { box-shadow: none !important; border: 0 !important; }
}

.receipt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: #111;
  max-width: 280px;
  margin: 0 auto;
}
.receipt hr { border: 0; border-top: 1px dashed #777; margin: 8px 0; }
.receipt .row { display: flex; justify-content: space-between; gap: 8px; }
.receipt .center { text-align: center; }
.receipt .bold { font-weight: 700; }

/* =========================================================
   ALAM SEGAR UI REFACTOR — 2026
   Safe visual layer only: tidak mengubah query, route, atau logic.
   ========================================================= */
:root {
  --alam-cream: #fffaf0;
  --alam-cream-2: #f7fbef;
  --alam-green-dark: #0f5a34;
  --alam-green-deep: #064728;
  --alam-green: #37a735;
  --alam-green-soft: #eaf7e4;
  --alam-orange: #ff7a00;
  --alam-orange-soft: #fff0dd;
  --alam-card-shadow: 0 18px 45px rgba(16, 74, 44, .075);
  --alam-card-shadow-hover: 0 22px 55px rgba(16, 74, 44, .12);
}

body {
  background:
    radial-gradient(circle at top right, rgba(255, 138, 0, .055), transparent 34rem),
    linear-gradient(135deg, var(--alam-cream), var(--alam-cream-2));
}

.app-sidebar {
  background:
    radial-gradient(circle at 110% 90%, rgba(76, 175, 74, .16), transparent 16rem),
    linear-gradient(180deg, var(--alam-green-deep), var(--alam-green-dark));
  box-shadow: 0 12px 40px rgba(5, 56, 31, .14);
  border: 1px solid rgba(255,255,255,.08);
  z-index: 40;
}

.app-main-column {
  min-width: 0;
  width: 100%;
}

.app-topbar-shell {
  width: 100%;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 45;
  padding: calc(env(safe-area-inset-top, 0px) + .65rem) max(1rem, env(safe-area-inset-right, 0px)) 0 max(1rem, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, var(--alam-cream) 78%, rgba(254, 250, 238, 0));
  isolation: isolate;
  overflow: visible;
}

.app-content {
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
  min-height: 0;
  padding: .75rem 1rem 1.25rem;
  overflow-x: hidden;
}

@media (min-width: 640px) {
  .app-content { padding-left: 1.25rem; padding-right: 1.25rem; }
}

@media (min-width: 1024px) {
  .app-body {
    overflow: hidden;
    height: 100svh;
  }
  .app-sidebar {
    position: fixed;
    left: 1rem;
    top: 1rem;
    bottom: 1rem;
    width: 15rem;
    display: flex !important;
    flex-direction: column;
    border-radius: 1rem;
    overflow: hidden;
  }
  .app-main-column {
    margin-left: calc(15rem + 2rem);
    width: auto;
    height: 100svh;
    max-height: 100svh;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }
  .app-topbar-shell {
    padding: calc(env(safe-area-inset-top, 0px) + 1rem) max(1rem, env(safe-area-inset-right, 0px)) 0 max(1rem, env(safe-area-inset-left, 0px));
    top: 0;
  }
  .app-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: .75rem 1rem 1.5rem;
    overscroll-behavior: contain;
  }
}

/* Dashboard grids — fallback karena kelas Tailwind arbitrary sering tidak ter-build */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  align-items: stretch;
}
@media (min-width: 640px) {
  .dashboard-kpi-grid { gap: .85rem; }
}
@media (min-width: 1280px) {
  .dashboard-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
}

.dashboard-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .dashboard-charts-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.25rem;
  }
  .dashboard-charts-grid > .page-main:first-child {
    grid-column: span 4;
    order: 1;
  }
  .dashboard-charts-grid > .page-main:last-child {
    grid-column: span 8;
    order: 2;
  }
}

.dashboard-panels-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .dashboard-panels-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.25rem;
  }
  .dashboard-panels-grid > .page-main:first-child { grid-column: span 7; }
  .dashboard-panels-grid > .page-main:last-child { grid-column: span 5; }
}

.page-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
@media (min-width: 640px) {
  .page-kpi-grid.sm-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .page-kpi-grid.xl-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
}

.app-topbar {
  border: 1px solid rgba(219, 210, 190, .78) !important;
  border-bottom: 0 !important;
  background: rgba(255, 255, 255, .97) !important;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(16, 74, 44, .07) !important;
  width: 100%;
  border-radius: 1rem !important;
  padding: .55rem .65rem;
  overflow: visible;
  position: relative;
  z-index: 1;
}
.app-topbar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "lead actions"
    "search search";
  gap: .55rem .65rem;
  align-items: center;
}
@media (min-width: 768px) {
  .app-topbar-grid {
    grid-template-columns: minmax(0, 1fr) minmax(12rem, 1.6fr) auto;
    grid-template-areas: "lead search actions";
    gap: .65rem;
  }
}
.app-topbar-leading {
  grid-area: lead;
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}
.app-topbar-titles { min-width: 0; }
.app-topbar-eyebrow {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #667085;
  line-height: 1.1;
}
.app-topbar-title {
  margin: 0;
  font-size: .92rem;
  font-weight: 800;
  color: var(--alam-green-dark);
  line-height: 1.2;
}
@media (min-width: 640px) {
  .app-topbar-title { font-size: 1rem; }
}
.app-topbar-search-trigger {
  grid-area: search;
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  min-height: 2.45rem;
  padding: 0 .75rem;
  border: 1px solid rgba(219, 210, 190, .85);
  border-radius: .8rem;
  background: linear-gradient(180deg, #fff, #fbf8f1);
  color: #667085;
  font-size: .78rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.app-topbar-search-trigger:hover {
  border-color: rgba(30, 94, 58, .25);
  box-shadow: 0 0 0 3px rgba(76, 175, 74, .08);
}
.app-topbar-search-placeholder {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-topbar-search-kbd {
  display: none;
  padding: .12rem .4rem;
  border-radius: .4rem;
  border: 1px solid rgba(219, 210, 190, .9);
  background: #fff;
  font-size: .62rem;
  font-weight: 700;
  color: #667085;
}
@media (min-width: 768px) {
  .app-topbar-search-kbd { display: inline-flex; }
}
.app-topbar-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .4rem;
}
.app-topbar-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(219, 210, 190, .85);
  border-radius: .8rem;
  background: #fff;
  color: var(--alam-green-dark);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.app-topbar-icon-btn:hover {
  background: var(--alam-green-soft);
  border-color: rgba(30, 94, 58, .18);
}
.app-topbar-menu-btn {
  display: none !important;
}
.app-topbar-badge {
  position: absolute;
  top: -.28rem;
  right: -.28rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 .22rem;
  border-radius: 9999px;
  background: var(--alam-orange);
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
  line-height: 1rem;
  text-align: center;
}
.app-topbar-popover-wrap {
  position: relative;
}
.app-topbar-popover {
  position: absolute;
  top: calc(100% + .45rem);
  right: 0;
  z-index: 60;
  width: min(20rem, calc(100vw - 2rem));
  border: 1px solid rgba(219, 210, 190, .85);
  border-radius: .95rem;
  background: #fff;
  box-shadow: 0 18px 40px rgba(16, 74, 44, .14);
  overflow: hidden;
  transform-origin: top right;
  animation: topbar-popover-in .16s ease;
}
.app-topbar-popover[hidden] {
  display: none !important;
}
@keyframes topbar-popover-in {
  from { opacity: 0; transform: translateY(-.35rem) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.app-topbar-popover-head {
  padding: .75rem .85rem .55rem;
  border-bottom: 1px solid rgba(231, 225, 213, .65);
}
.app-topbar-popover-title {
  font-size: .84rem;
  font-weight: 800;
  color: var(--alam-green-dark);
}
.app-topbar-popover-sub {
  margin-top: .12rem;
  font-size: .68rem;
  color: #667085;
}
.app-topbar-popover-foot {
  padding: .55rem .85rem .7rem;
  border-top: 1px solid rgba(231, 225, 213, .65);
  background: #fbfaf6;
}
.app-notif-list {
  max-height: 16rem;
  overflow-y: auto;
}
.app-notif-item {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .65rem .85rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(231, 225, 213, .45);
  transition: background .15s ease;
}
.app-notif-item:hover { background: rgba(234, 247, 228, .55); }
.app-notif-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: .65rem;
  flex-shrink: 0;
}
.app-notif-item-icon.is-danger { background: #ffe8e4; color: #d92d20; }
.app-notif-item-icon.is-warn { background: #fff4d6; color: #b7791f; }
.app-notif-item-title {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--alam-green-dark);
}
.app-notif-item-meta {
  display: block;
  margin-top: .08rem;
  font-size: .66rem;
  color: #667085;
}
.app-notif-item-amount {
  flex-shrink: 0;
  font-size: .74rem;
  font-weight: 800;
  color: var(--alam-orange);
}
.app-notif-empty {
  padding: 1rem .85rem;
  font-size: .76rem;
  color: #667085;
  text-align: center;
}
.app-notif-foot-link {
  display: block;
  font-size: .74rem;
  font-weight: 700;
  color: var(--alam-green-dark);
  text-decoration: none;
}
.app-topbar-profile { position: relative; }
.app-topbar-avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 9999px;
}
.app-topbar-avatar-btn::-webkit-details-marker { display: none; }
.app-topbar-avatar-btn:focus-visible {
  outline: 2px solid rgba(30, 94, 58, .45);
  outline-offset: 2px;
}
.app-topbar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 9999px;
  border: 2px solid rgba(30, 94, 58, .18);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(16, 74, 44, .12);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.app-topbar-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.app-topbar-avatar-btn:hover .app-topbar-avatar,
.app-topbar-profile[open] .app-topbar-avatar {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(16, 74, 44, .18);
  border-color: rgba(30, 94, 58, .35);
}
/* legacy class kept hidden if referenced elsewhere */
.app-topbar-profile-btn { display: none !important; }
.app-topbar-profile-name { display: none !important; }
.app-topbar-profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + .45rem);
  z-index: 60;
  min-width: 11rem;
  border: 1px solid rgba(219, 210, 190, .85);
  border-radius: .9rem;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16, 74, 44, .12);
  overflow: hidden;
}
.app-topbar-profile-meta {
  padding: .7rem .8rem;
  border-bottom: 1px solid rgba(231, 225, 213, .65);
  font-size: .7rem;
  color: #667085;
}
.app-topbar-profile-link {
  display: block;
  padding: .62rem .8rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--alam-text);
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.app-topbar-profile-link:hover { background: rgba(234, 247, 228, .55); }

/* Command palette */
.command-palette {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 1rem 1rem;
  background: rgba(8, 30, 18, .45);
}
.command-palette.is-open {
  display: flex;
}
.command-palette-box {
  width: min(36rem, 100%);
  border: 1px solid rgba(219, 210, 190, .85);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 74, 44, .18);
  overflow: hidden;
}
.command-palette-head {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .75rem .85rem;
  border-bottom: 1px solid rgba(231, 225, 213, .65);
  color: var(--alam-green-dark);
}
.command-palette-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: .92rem;
  color: var(--alam-text);
}
.command-palette-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: .55rem;
  background: rgba(234, 247, 228, .65);
  color: var(--alam-green-dark);
  cursor: pointer;
}
.command-palette-body {
  max-height: min(52vh, 22rem);
  overflow-y: auto;
  padding: .45rem .55rem .65rem;
}
.command-palette-section {
  margin: .45rem .35rem .25rem;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #667085;
}
.command-palette-foot {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .85rem;
  padding: .55rem .85rem;
  border-top: 1px solid rgba(231, 225, 213, .65);
  background: #fbfaf6;
  font-size: .64rem;
  color: #667085;
}
.command-palette-foot kbd {
  padding: .08rem .32rem;
  border-radius: .35rem;
  border: 1px solid rgba(219, 210, 190, .9);
  background: #fff;
  font-size: .6rem;
  font-weight: 700;
}
.command-palette-empty {
  padding: .85rem .5rem;
  text-align: center;
  font-size: .76rem;
  color: #667085;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .58rem .65rem;
  border-radius: .7rem;
  text-decoration: none;
  color: var(--alam-text);
  transition: background .12s ease;
}
.cmd-item:hover,
.cmd-item.cmd-item-active {
  background: rgba(234, 247, 228, .75);
}
.cmd-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: .55rem;
  background: var(--alam-green-soft);
  color: var(--alam-green-dark);
  font-size: .62rem;
  font-weight: 800;
  flex-shrink: 0;
}
.cmd-item-text {
  display: flex;
  flex-direction: column;
  gap: .08rem;
  min-width: 0;
  font-size: .82rem;
  font-weight: 600;
}
.cmd-item-text small {
  font-size: .68rem;
  font-weight: 600;
  color: #667085;
}
.app-topbar > div {
  min-height: 0;
}
.brand-block {
  padding: 1rem .85rem .85rem;
  margin: 0 .65rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  text-align: center;
}
.brand-link {
  display: inline-flex;
  justify-content: center;
  line-height: 0;
  width: 100%;
}
.brand-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 2.5rem;
  margin: 0 auto;
  object-fit: contain;
  object-position: center center;
  mix-blend-mode: screen;
}
.app-sidebar-nav {
  padding: .75rem .65rem .65rem;
}
.app-sidebar-nav .nav-link,
.app-sidebar-nav .sidebar-item {
  margin-bottom: .35rem;
}
.app-sidebar .sidebar-user-actions,
.app-drawer-footer .sidebar-user-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin: .5rem .65rem .65rem;
  padding: .45rem .5rem .45rem .55rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9999px;
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.app-drawer-footer .sidebar-user-actions {
  margin: .85rem 1rem calc(env(safe-area-inset-bottom) + .85rem);
}
.sidebar-avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 9999px;
  background: #fff;
  color: var(--alam-green-dark);
  font-size: .8rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
}
.sidebar-user-profile {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  flex: 1;
}
.sidebar-user-name {
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logout-form {
  margin: 0;
  display: flex;
  justify-content: flex-end;
}
.sidebar-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9999px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.sidebar-logout-btn:hover {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .28);
  transform: scale(1.04);
}
.sidebar-section-label {
  padding-left: .15rem;
  padding-right: .15rem;
  padding-top: .9rem;
  padding-bottom: .35rem;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}

.nav-link,
.sidebar-item,
.sidebar-item-active {
  border-radius: .75rem !important;
  min-height: 2.5rem !important;
  padding: .58rem .75rem !important;
  font-size: .82rem !important;
}
.nav-link:not(.sidebar-item-active),
.sidebar-item:not(.sidebar-item-active) {
  color: rgba(255,255,255,.82) !important;
}
.nav-link:not(.sidebar-item-active):hover,
.sidebar-item:not(.sidebar-item-active):hover {
  background: rgba(255,255,255,.10) !important;
  color: #fff !important;
}
.sidebar-item-active {
  background: linear-gradient(135deg, rgba(76,175,74,.95), rgba(78,160,51,.85)) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.18) !important;
}

.card,
.panel-card,
.glass-card,
.page-main,
.filter-panel,
.insight-panel {
  border-radius: .9rem !important;
  border-color: rgba(219, 210, 190, .78) !important;
  background: rgba(255,255,255,.92) !important;
  box-shadow: var(--alam-card-shadow) !important;
}
.page-main:hover,
.panel-card:hover,
.glass-card:hover {
  box-shadow: var(--alam-card-shadow-hover) !important;
}

.page-toolbar {
  border-bottom-color: rgba(231,225,213,.72) !important;
  padding: .6rem .85rem !important;
}
.page-body { padding: .75rem .85rem !important; }
.page-heading { color: #143f2e !important; font-size: .9rem !important; }
.page-heading-sub { color: #667085 !important; font-size: .72rem !important; }

.kpi-card-v3,
.kpi-card-v2,
section > .kpi-card-v3 {
  border-radius: .9rem !important;
  border-color: rgba(219,210,190,.78) !important;
  background: rgba(255,255,255,.92) !important;
  box-shadow: 0 8px 24px rgba(16, 74, 44, .06) !important;
  padding: .75rem !important;
}
.kpi-card-v3-icon,
.context-card-icon,
.timeline-icon {
  border-radius: .7rem !important;
  background: var(--alam-green-soft) !important;
  color: var(--alam-green-dark) !important;
  height: 2rem !important;
  width: 2rem !important;
}
.kpi-card-v3-icon svg { height: .95rem !important; width: .95rem !important; }
.kpi-card-v3-value { color: #123f2e !important; letter-spacing: -.03em; font-size: 1.15rem !important; }
.kpi-card-v3-label { font-size: .72rem !important; margin-top: .55rem !important; }
.kpi-card-v3-spark { height: 1.75rem !important; width: 3.5rem !important; }

/* KPI tile cards — gaya tile berwarna + ghost icon */
.kpi-dashboard-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  padding: .95rem 1rem;
  min-height: 5.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(15, 40, 25, .14) !important;
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15, 40, 25, .2) !important;
}
.kpi-dashboard-card[data-variant="sales"] {
  background: linear-gradient(145deg, var(--alam-green) 0%, #105e35 100%);
}
.kpi-dashboard-card[data-variant="profit"] {
  background: linear-gradient(145deg, #1a6b42 0%, var(--alam-green-dark) 100%);
}
.kpi-dashboard-card[data-variant="trx"] {
  background: linear-gradient(145deg, #7cb342 0%, #558b2f 100%);
}
.kpi-dashboard-card[data-variant="debt"] {
  background: linear-gradient(145deg, #3d9970 0%, #2f7a6e 100%);
}
.kpi-dashboard-card[data-variant="kg"] {
  background: linear-gradient(145deg, #66bb6a 0%, #388e3c 100%);
}
.kpi-dashboard-card[data-variant="users"] {
  background: linear-gradient(145deg, #43a047 0%, #1b5e20 100%);
}
.kpi-dashboard-card[data-variant="neutral"] {
  background: linear-gradient(145deg, #81a684 0%, #5d7360 100%);
}
.kpi-tile-ghost {
  position: absolute;
  right: -.35rem;
  bottom: -.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: .18;
  transform: rotate(-12deg);
  pointer-events: none;
  z-index: 0;
}
.kpi-tile-ghost svg {
  width: 4.75rem !important;
  height: 4.75rem !important;
  stroke-width: 1.35;
}
.kpi-tile-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  min-width: 0;
}
.kpi-tile-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .12rem;
  min-width: 0;
  flex: 1;
}
.kpi-tile-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .65rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .22);
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(6px);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.kpi-tile-icon-box svg {
  width: 1.15rem !important;
  height: 1.15rem !important;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kpi-tile-value {
  margin: 0;
  font-size: clamp(1rem, 2.8vw, 1.55rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.03em;
  color: #fff !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-tile-label {
  margin: 0;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 255, 255, .88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 639px) {
  .dashboard-kpi-grid .kpi-dashboard-card {
    min-height: 4.85rem;
    padding: .7rem .75rem;
    border-radius: .9rem;
  }
  .dashboard-kpi-grid .kpi-tile-inner {
    gap: .55rem;
  }
  .dashboard-kpi-grid .kpi-tile-value {
    font-size: clamp(.82rem, 3.6vw, 1.05rem);
  }
  .dashboard-kpi-grid .kpi-tile-label {
    font-size: .62rem;
  }
  .dashboard-kpi-grid .kpi-tile-icon-box {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: .55rem;
  }
  .dashboard-kpi-grid .kpi-tile-icon-box svg {
    width: 1rem !important;
    height: 1rem !important;
  }
  .dashboard-kpi-grid .kpi-tile-ghost svg {
    width: 3.5rem !important;
    height: 3.5rem !important;
  }
}
@media (min-width: 640px) {
  .kpi-tile-value { font-size: 1.45rem; }
}
@media (min-width: 1280px) {
  .kpi-tile-value { font-size: 1.6rem; }
  .kpi-dashboard-card { min-height: 5.75rem; padding: 1rem 1.05rem; }
}

.btn-primary,
.btn-accent,
.btn-secondary,
.btn-ghost {
  border-radius: .7rem !important;
  min-height: 2.15rem !important;
  padding: .4rem .8rem !important;
  font-size: .78rem !important;
}
.btn-primary {
  background: linear-gradient(135deg, #16823c, #0f5a34) !important;
  box-shadow: 0 6px 14px rgba(15,90,52,.12) !important;
}
.btn-accent {
  background: linear-gradient(135deg, #ff8a00, #ff6400) !important;
  box-shadow: 0 6px 14px rgba(255,122,0,.14) !important;
}
.input-field {
  border-radius: .7rem !important;
  border-color: rgba(219,210,190,.92) !important;
  background: rgba(255,255,255,.94) !important;
  min-height: 2.15rem !important;
  padding: .45rem .7rem !important;
  font-size: .8rem !important;
}
.input-field:focus {
  box-shadow: 0 0 0 3px rgba(76,175,74,.11) !important;
}

/* Input dengan ikon prefix — fallback karena utility Tailwind sering tidak ter-build */
.input-prefix-wrap {
  position: relative;
  min-width: 0;
}
.page-toolbar .input-prefix-wrap,
.input-prefix-wrap.is-flex {
  flex: 1;
}
.input-prefix {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  color: #667085;
  pointer-events: none;
  z-index: 1;
}
.input-field.input-with-prefix {
  padding-left: 2.55rem !important;
}
.trucks-search-wrap {
  width: min(14rem, 100%);
  flex-shrink: 0;
}

.data-table { border-collapse: separate !important; border-spacing: 0 !important; width: 100%; }
.data-table thead {
  color: #5f6b7a !important;
  background: linear-gradient(180deg, #f7f4ec 0%, #f2ede3 100%);
}
.data-table th,
.data-table td {
  padding: .55rem .7rem !important;
  vertical-align: middle;
  font-size: .78rem !important;
  border-bottom: 1px solid rgba(219, 210, 190, .55);
}
.data-table thead th {
  font-size: .66rem !important;
  font-weight: 800 !important;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 2px solid rgba(219, 210, 190, .85);
}
.data-table tbody tr {
  background: #fff;
  transition: background .12s ease;
}
.data-table tbody tr:nth-child(even) {
  background: rgba(251, 248, 241, .65);
}
.data-table tbody tr:hover {
  background: rgba(232, 245, 233, .5) !important;
}
.data-table tbody tr[data-preview-href] {
  cursor: pointer;
}
.data-table tbody tr[data-preview-href]:active {
  background: rgba(30, 94, 58, .08) !important;
}
.data-table tbody tr[data-preview-href] td:first-child {
  position: relative;
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table th.col-actions,
.data-table td.col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right !important;
  padding-left: .35rem !important;
  padding-right: .45rem !important;
}
.data-table-sheet {
  border: 1px solid rgba(219, 210, 190, .78);
  border-radius: .85rem;
  /* overflow:hidden memutus position:sticky pada kolom Aksi */
  overflow: visible;
  background: #fff;
}
.table-sheet-wrap {
  border: 1px solid rgba(219, 210, 190, .78);
  border-radius: .95rem;
  background: #fff;
  box-shadow: 0 4px 18px rgba(16, 74, 44, .04);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  /* scrollport untuk sticky kolom Aksi */
  position: relative;
}
.page-body .table-sheet-wrap {
  margin: 0;
}
.table-sheet-wrap .data-table-sheet {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .28rem;
}
.table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(219, 210, 190, .9);
  border-radius: .6rem;
  background: #fff;
  color: var(--alam-green-dark);
  cursor: pointer;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .1s ease;
}
.table-action-btn:hover {
  background: var(--alam-green-soft);
  border-color: rgba(30, 94, 58, .22);
  color: var(--alam-green-dark);
}
.table-action-btn:active {
  transform: scale(.96);
}
.table-action-btn.is-danger {
  color: #d92d20;
  border-color: rgba(217, 45, 32, .22);
  background: #fff;
}
.table-action-btn.is-danger:hover {
  background: #fff0ee;
  border-color: rgba(217, 45, 32, .35);
}
.table-action-btn.is-muted {
  color: #667085;
}
.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(219, 210, 190, .9);
  border-radius: .6rem;
  background: #fff;
  color: var(--alam-green-dark);
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
}
.icon-action-btn:hover {
  background: var(--alam-green-soft);
  border-color: rgba(30, 94, 58, .22);
}
.icon-action-btn-danger {
  color: #d92d20;
  border-color: rgba(217, 45, 32, .22);
}
.icon-action-btn-danger:hover {
  background: #fff0ee;
}
.data-table th.text-right,
.data-table td.num-cell,
.data-table td.text-right,
.data-table th.col-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}
.donut-swatch {
  display: inline-block;
  height: .65rem;
  width: .65rem;
  border-radius: 9999px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.product-tile-placeholder {
  background: linear-gradient(145deg, #eff9e9 0%, #f8f4e8 100%);
  color: #1e5e3a;
}
.product-tile-placeholder svg {
  opacity: .72;
}
.app-content {
  min-height: auto;
}
.pos-page,
.trucks-page {
  padding-bottom: .25rem;
}

/* Ringkasan ringkas — halaman operasional (bukan dashboard) */
.page-stats-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .75rem;
  padding: .55rem .75rem;
  border-radius: .75rem;
  border: 1px solid rgba(219, 210, 190, .72);
  background: rgba(255, 255, 255, .88);
}
.page-stats-item {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .3rem .4rem;
  padding-right: .75rem;
  border-right: 1px solid rgba(231, 225, 213, .65);
}
.page-stats-item:last-child {
  border-right: 0;
  padding-right: 0;
}
.page-stats-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #667085;
}
.page-stats-value {
  font-size: .86rem;
  font-weight: 800;
  color: var(--alam-green-dark);
  font-variant-numeric: tabular-nums;
}
.page-stats-meta {
  font-size: .65rem;
  font-weight: 600;
  color: #667085;
}

/* POS — alur kasir lebih fokus */
.pos-layout {
  display: grid;
  gap: 1rem;
  align-items: start;
}
@media (min-width: 1280px) {
  .pos-layout {
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: 1rem;
  }
}
.pos-main-col {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-width: 0;
}
.pos-context-bar .page-body,
.pos-context-fields {
  padding-top: .65rem !important;
  padding-bottom: .65rem !important;
}
.pos-context-fields {
  display: grid;
  gap: .65rem;
}
@media (min-width: 768px) {
  .pos-context-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.pos-section-label {
  margin-bottom: .45rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #667085;
}
.pos-manual-row {
  display: grid;
  gap: .5rem;
  align-items: end;
}
@media (min-width: 768px) {
  .pos-manual-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .9fr) auto;
  }
}
.pos-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding-top: .15rem;
}
.pos-pay-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  color: #667085;
}
.pos-pay-line b {
  color: var(--alam-green-dark);
  font-variant-numeric: tabular-nums;
}
.pos-pay-line-soft {
  padding: .45rem .6rem;
  border-radius: .65rem;
  background: rgba(234, 247, 228, .65);
}
.pos-pay-line-soft b { color: var(--alam-green-dark); }
.pos-pay-line-warn {
  padding: .45rem .6rem;
  border-radius: .65rem;
  background: rgba(255, 240, 221, .85);
}
.pos-pay-line-warn b { color: var(--alam-orange); }
.pos-pay-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .55rem 0 .15rem;
  border-top: 1px solid rgba(231, 225, 213, .65);
  border-bottom: 1px solid rgba(231, 225, 213, .65);
  font-weight: 700;
  color: var(--alam-green-dark);
}
.pos-pay-total b {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}
.pos-checkout-sticky {
  height: fit-content;
}
@media (min-width: 1280px) {
  .pos-checkout-sticky {
    position: sticky;
    top: 5.5rem;
  }
}
.status-paid,
.status-normal { background: #e8f7df !important; color: #166534 !important; }
.status-partial { background: #fff4d6 !important; color: #b7791f !important; }
.status-debt,
.status-due-soon,
.status-in-progress { background: #fff0dd !important; color: #f06400 !important; }
.status-overdue { background: #ffe8e4 !important; color: #d92d20 !important; }
.status-waiting { background: #eef4ff !important; color: #1d4ed8 !important; }

.product-tile {
  width: 10rem !important;
  min-height: 8.7rem;
  border-radius: 1.2rem !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(30,94,58,.055) !important;
}
.product-tile-img {
  border-radius: 1rem !important;
  background: linear-gradient(135deg, #eff9e9, #fff7ea) !important;
}
.product-tile-add {
  bottom: .7rem !important;
  right: .7rem !important;
  width: 1.8rem !important;
  height: 1.8rem !important;
  box-shadow: 0 8px 18px rgba(76,175,74,.28) !important;
}

.pos-checkout-sticky .page-body {
  background: linear-gradient(180deg, #fff, #fffaf0);
  border-radius: 0 0 1.35rem 1.35rem;
}
.quick-tender-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.quick-tender-btn {
  border: 0 !important;
  background: #e8f7df !important;
  color: #14532d !important;
  font-weight: 800 !important;
}
.payment-toggle {
  background: transparent !important;
  gap: .6rem !important;
}
.payment-toggle-btn {
  border: 1px solid rgba(219,210,190,.95) !important;
  background: #fff !important;
  border-radius: .95rem !important;
}
.payment-toggle-active {
  border-color: var(--alam-green) !important;
  color: #14532d !important;
  box-shadow: 0 8px 18px rgba(76,175,74,.12) !important;
}

.context-card {
  border-radius: 1.35rem !important;
  background: rgba(255,255,255,.92) !important;
  box-shadow: var(--alam-card-shadow) !important;
}
.filter-panel {
  padding: .75rem !important;
}

.best-seller-tile {
  border-radius: 1.15rem !important;
  background: #fff !important;
}
.best-seller-img {
  border-radius: 1rem !important;
  background: #f1faec !important;
}

/* Responsive tidy for iPad and mobile */
@media (max-width: 1023px) {
  main { margin-left: 0 !important; }
  .page-toolbar {
    align-items: stretch !important;
    gap: .75rem !important;
    padding: .85rem 1rem !important;
  }
  .page-toolbar.page-toolbar-row {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .page-toolbar.page-toolbar-stack,
  .page-toolbar:has(form) {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .page-toolbar > div:first-child { min-width: 0; }
  .page-body { padding: .9rem 1rem !important; }
  .product-tile { width: 8.2rem !important; }
  .kpi-card-v3-value { font-size: 1.25rem !important; }
  .chart-box-sm { height: 10rem !important; }
  .chart-box-md { height: 13rem !important; }
  .chart-box-lg { height: 15rem !important; }
  .chart-box-trend { height: 12.5rem !important; }
  .filter-panel form,
  .filter-bar,
  .page-toolbar form {
    width: 100%;
  }
  .filter-panel .form-group,
  .filter-panel label,
  .page-toolbar .input-field,
  .page-toolbar select {
    width: 100% !important;
    min-width: 0 !important;
  }
  .tab-nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  .tab-nav-item { white-space: nowrap; }
  .table-scroll-wrap {
    margin: 0 -.25rem;
    padding-bottom: .25rem;
    -webkit-overflow-scrolling: touch;
  }
  .app-topbar > div { padding-top: .75rem !important; padding-bottom: .75rem !important; }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .chart-box-sm { height: 12rem !important; }
  .chart-box-md { height: 16rem !important; }
  .chart-box-lg { height: 18rem !important; }
  .chart-box-trend { height: 14rem !important; }
}

@media (max-width: 640px) {
  .data-table th, .data-table td { padding: .6rem .65rem !important; font-size: .78rem !important; }
  .card, .panel-card, .page-main, .filter-panel { border-radius: 1.05rem !important; }
  .quick-action-btn { min-height: 4.25rem; padding: .85rem !important; }
  .quick-action-btn span:last-child { font-size: .78rem; line-height: 1.25; }
  .bottom-nav-item span:last-child { font-size: 10px; }
  .donut-legend-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .35rem .75rem;
  }
  .kpi-card-v3 { padding: .75rem !important; }
  .kpi-card-v3-spark { width: 3.5rem !important; }
  .pos-checkout-sticky { position: static !important; top: auto !important; }
  .debt-priority-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: .65rem !important;
  }
  .debt-priority-row > .text-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    width: 100%;
  }
  .dashboard-trx-card { padding: .85rem !important; }
}

/* App modal */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  visibility: hidden;
  pointer-events: none;
}
.app-modal.open {
  visibility: visible;
  pointer-events: auto;
}
.app-modal-overlay {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(6, 39, 24, .52);
  opacity: 0;
  transition: opacity .2s ease;
  cursor: pointer;
}
.app-modal.open .app-modal-overlay {
  opacity: 1;
}
.app-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  max-height: min(86vh, 760px);
  width: 100%;
  flex-direction: column;
  border: 1px solid rgba(219, 210, 190, .9);
  border-radius: 1rem 1rem 0 0;
  background: #fff;
  box-shadow: 0 -12px 40px rgba(16, 74, 44, .22);
  transform: translateY(100%);
  transition: transform .24s ease;
  opacity: 1;
}
.app-modal.open .app-modal-panel {
  transform: translateY(0);
}
.app-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  border-bottom: 1px solid rgba(231, 225, 213, .8);
  padding: .75rem .85rem;
}
.app-modal-title {
  font-size: .95rem;
  font-weight: 800;
  color: #143f2e;
}
.app-modal-subtitle {
  margin-top: .1rem;
  font-size: .72rem;
  color: #667085;
}
.app-modal-close {
  display: inline-flex;
  height: 2rem;
  width: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: .65rem;
  border: 1px solid rgba(219, 210, 190, .9);
  background: #fff;
  color: #1e5e3a;
  transition: background .15s ease;
}
.app-modal-close:hover { background: #e8f5e9; }
.app-modal-body {
  overflow-y: auto;
  padding: .75rem .85rem .85rem;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) {
  .app-modal {
    align-items: center;
    padding: .75rem;
  }
  .app-modal-panel {
    max-width: 28rem;
    border-radius: 1rem;
    transform: translateY(10px) scale(.98);
  }
  .app-modal.open .app-modal-panel {
    transform: translateY(0) scale(1);
  }
}
@media (min-width: 768px) {
  .app-modal-panel { max-width: 30rem; }
}

.app-drawer {
  background:
    radial-gradient(circle at 110% 90%, rgba(76, 175, 74, .16), transparent 16rem),
    linear-gradient(180deg, var(--alam-green-deep), var(--alam-green-dark));
  box-shadow: 0 -14px 42px rgba(5, 56, 31, .32);
  color: #fff;
}
.app-drawer-grab {
  display: none;
  width: 2.75rem;
  height: .28rem;
  margin: .55rem auto .15rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .35);
  flex-shrink: 0;
}
.app-drawer-overlay {
  opacity: 0;
  transition: opacity .25s ease;
}
.app-drawer-overlay-visible {
  opacity: 1;
}
.app-drawer-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .55rem 1rem .75rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  flex-shrink: 0;
}
.app-drawer-brand-center {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0 2.75rem;
  text-decoration: none;
}
.app-drawer-logo-full {
  display: block;
  width: auto;
  max-width: 9.5rem;
  height: auto;
  max-height: 2.5rem;
  object-fit: contain;
  mix-blend-mode: screen;
}
.app-drawer-close {
  position: absolute;
  right: 1rem;
  top: .65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .15s ease;
}
.app-drawer-close:hover {
  background: rgba(255, 255, 255, .18);
}
.app-drawer-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: .75rem .85rem .65rem;
}
.app-drawer-section-label,
.app-drawer-nav .sidebar-section-label {
  padding: .15rem .35rem .5rem;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}
.app-drawer-nav .sidebar-section-label {
  padding-top: 1rem;
  padding-bottom: .45rem;
}
.app-drawer-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 0;
}

/* Mobile bottom nav + drawer — fallback karena utility Tailwind sering tidak ter-build */
@media (max-width: 1023px) {
  .app-sidebar {
    display: none !important;
  }
  .bottom-nav-app {
    display: block !important;
    position: fixed;
    left: .75rem;
    right: .75rem;
    bottom: calc(env(safe-area-inset-bottom) + .75rem);
    z-index: 42;
  }
  .bottom-nav-app > div {
    display: grid;
    gap: .25rem;
    text-align: center;
  }
  .bottom-nav-app .bottom-nav-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .bottom-nav-app .bottom-nav-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .app-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 74;
    background: rgba(0, 0, 0, .45);
  }
  .app-drawer-overlay.hidden {
    display: none !important;
  }
  .app-drawer {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 75;
    width: 100%;
    max-width: none;
    max-height: min(88svh, 42rem);
    display: flex;
    flex-direction: column;
    border-radius: 1.35rem 1.35rem 0 0;
    transform: translateY(105%);
    transition: transform .32s cubic-bezier(.32, .72, 0, 1);
    padding-bottom: calc(env(safe-area-inset-bottom) + .35rem);
  }
  .app-drawer-grab {
    display: block;
  }
  .app-drawer.app-drawer-open {
    transform: translateY(0) !important;
  }
  .app-topbar-menu-btn {
    display: inline-flex;
  }
}
@media (min-width: 1024px) {
  .bottom-nav-app,
  .app-drawer,
  .app-drawer-overlay {
    display: none !important;
  }
}
.app-drawer-nav .nav-link,
.app-drawer-nav .sidebar-item {
  min-height: 2.75rem !important;
  border-radius: .85rem !important;
  margin-bottom: .4rem;
}
.app-drawer-nav .nav-link:not(.sidebar-item-active),
.app-drawer-nav .sidebar-item:not(.sidebar-item-active) {
  color: rgba(255, 255, 255, .88) !important;
}
.app-drawer-nav .sidebar-item-active {
  background: linear-gradient(135deg, rgba(76, 175, 74, .95), rgba(78, 160, 51, .85)) !important;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .14) !important;
}

/* Quick actions FAB */
.quick-fab {
  position: fixed;
  z-index: 43;
  right: 1rem;
  bottom: calc(env(safe-area-inset-bottom) + 6.15rem);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}
.quick-fab > * {
  pointer-events: auto;
}
@media (min-width: 1024px) {
  .quick-fab {
    right: 1.5rem;
    bottom: 1.5rem;
  }
}
.quick-fab-actions {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: .55rem;
  margin-bottom: .7rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(.45rem) scale(.96);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.quick-fab.is-open .quick-fab-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.quick-fab-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  color: inherit;
}
.quick-fab-label {
  padding: .35rem .65rem;
  border-radius: 9999px;
  background: rgba(30, 94, 58, .92);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(16, 74, 44, .18);
  opacity: 0;
  transform: translateX(.35rem);
  transition: opacity .18s ease, transform .18s ease;
}
.quick-fab.is-open .quick-fab-item .quick-fab-label {
  opacity: 1;
  transform: translateX(0);
}
.quick-fab-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(30, 94, 58, .12);
  background: #fff;
  color: var(--alam-green-dark);
  box-shadow: 0 8px 22px rgba(16, 74, 44, .14);
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.quick-fab-item:hover .quick-fab-action,
.quick-fab-item:focus-visible .quick-fab-action {
  background: var(--alam-green-soft);
  transform: scale(1.05);
}
.quick-fab-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.35rem;
  height: 3.35rem;
  border: 0;
  border-radius: 9999px;
  background: linear-gradient(145deg, #2a7a4d 0%, var(--alam-green-dark) 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(16, 74, 44, .28);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.quick-fab-toggle:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 30px rgba(16, 74, 44, .34);
}
.quick-fab-toggle-icon {
  position: absolute;
  transition: opacity .18s ease, transform .18s ease;
}
.quick-fab-toggle {
  position: relative;
}
.quick-fab-toggle-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(.8);
}
.quick-fab.is-open .quick-fab-toggle-icon-open {
  opacity: 0;
  transform: rotate(90deg) scale(.8);
}
.quick-fab.is-open .quick-fab-toggle-icon-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* Detail page (transactions/show, dll) */
.detail-page { max-width: 100%; }
.detail-hero {
  padding: 0;
  overflow: hidden;
}
.detail-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding: 1rem 1rem .75rem;
  border-bottom: 1px solid rgba(231, 225, 213, .65);
  background: linear-gradient(180deg, #fff, #fbf8f1);
}
.detail-hero-eyebrow {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #667085;
}
.detail-hero-title {
  margin: .15rem 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--alam-green-dark);
  line-height: 1.2;
}
.detail-hero-sub {
  margin: .25rem 0 0;
  font-size: .76rem;
  color: #667085;
}
.detail-hero-status { flex-shrink: 0; }
.detail-hero-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  padding: .75rem 1rem;
}
.detail-amount-card {
  border: 1px solid rgba(219, 210, 190, .75);
  border-radius: .75rem;
  background: #fff;
  padding: .55rem .65rem;
}
.detail-amount-label {
  display: block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #667085;
}
.detail-amount-value {
  display: block;
  margin-top: .15rem;
  font-size: .95rem;
  font-weight: 800;
  color: var(--alam-green-dark);
  font-variant-numeric: tabular-nums;
}
.detail-amount-card.is-paid .detail-amount-value { color: #166534; }
.detail-amount-card.is-debt {
  border-color: rgba(255, 138, 0, .28);
  background: #fff9f2;
}
.detail-amount-card.is-debt .detail-amount-value { color: var(--alam-orange); }
.detail-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  padding: 0 1rem 1rem;
}
.detail-action-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2rem;
  padding: 0 .7rem;
  border: 1px solid rgba(219, 210, 190, .85);
  border-radius: .65rem;
  background: #fff;
  color: var(--alam-green-dark);
  font-size: .74rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
}
.detail-action-chip:hover {
  background: var(--alam-green-soft);
  border-color: rgba(30, 94, 58, .2);
}
.detail-action-chip.is-ghost {
  color: #667085;
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
@media (min-width: 1024px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}
.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem 1rem;
}
@media (min-width: 768px) {
  .detail-meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.detail-meta-item {
  border: 1px solid rgba(231, 225, 213, .55);
  border-radius: .7rem;
  background: #fbfaf6;
  padding: .55rem .65rem;
}
.detail-meta-label {
  display: block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #667085;
}
.detail-meta-value {
  display: block;
  margin-top: .2rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--alam-green-dark);
}
.detail-link {
  color: var(--alam-green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.detail-table-foot td {
  background: rgba(234, 247, 228, .45) !important;
  border-top: 2px solid rgba(219, 210, 190, .75) !important;
}
.detail-payment-row {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .55rem .6rem;
  border: 1px solid rgba(231, 225, 213, .55);
  border-radius: .7rem;
  background: #fff;
}
.detail-payment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: .55rem;
  background: var(--alam-green-soft);
  color: var(--alam-green-dark);
  flex-shrink: 0;
}
.detail-payment-amount {
  font-size: .86rem;
  font-weight: 800;
  color: var(--alam-green-dark);
}
.detail-payment-meta {
  margin-top: .08rem;
  font-size: .68rem;
  color: #667085;
}
.detail-empty-payments {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: 1.25rem .75rem;
  border: 1px dashed rgba(219, 210, 190, .85);
  border-radius: .75rem;
  text-align: center;
  color: #667085;
  font-size: .76rem;
}
.detail-debt-note {
  border-color: rgba(255, 138, 0, .25) !important;
  background: linear-gradient(180deg, #fff9f2, #fff) !important;
}
@media (max-width: 640px) {
  .detail-hero-amounts { grid-template-columns: 1fr; }
  .detail-meta-grid { grid-template-columns: 1fr; }
}

/* Bottom nav app-style */
.bottom-nav-app {
  box-shadow: 0 8px 28px rgba(16, 74, 44, .12);
}
.app-topbar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--alam-border);
  border-radius: .75rem;
  background: #fff;
  color: var(--alam-green-dark);
}
@media (min-width: 640px) {
  .app-topbar-hamburger {
    width: 2.5rem;
    height: 2.5rem;
  }
}
.bottom-nav-item {
  min-height: 2.65rem;
  border-radius: .85rem;
  transition: background .15s ease, color .15s ease;
}
.bottom-nav-item-active {
  background: var(--alam-green-soft) !important;
  color: var(--alam-green-dark) !important;
}

/* Table horizontal scroll hint */
.table-scroll-wrap {
  position: relative;
  overflow-x: auto;
}
.table-scroll-wrap::after {
  content: '';
  position: sticky;
  right: 0;
  top: 0;
  float: right;
  width: 1.5rem;
  height: 100%;
  margin-left: -1.5rem;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,250,240,.9));
}
@media (min-width: 1024px) {
  .table-scroll-wrap::after { display: none; }
}

.chart-box-sm { height: 9rem; }
.chart-box-md { height: 12rem; }
.chart-box-lg { height: 13rem; }
.chart-box-trend { height: 11.5rem; position: relative; }

/* Dashboard chart cards */
.chart-card {
  overflow: hidden;
  position: relative;
  border-radius: 1.15rem !important;
  box-shadow: 0 10px 32px rgba(16, 74, 44, .07) !important;
}
.chart-card-donut::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--alam-green-dark) 0%, #4caf4a 55%, #c6f135 100%);
  opacity: .85;
  z-index: 1;
}
.chart-card-trend::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #105e35 0%, #4caf4a 100%);
  opacity: .85;
  z-index: 1;
}
.chart-card::before {
  display: none;
}
.chart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.1rem .75rem;
  border-bottom: 1px solid rgba(231, 225, 213, .5);
  background: linear-gradient(180deg, rgba(251, 248, 241, .65) 0%, transparent 100%);
}
.chart-card-body {
  padding: .9rem 1.1rem 1.1rem;
}
.chart-card-sub {
  margin-top: .2rem;
  font-size: .72rem;
  line-height: 1.4;
  color: #667085;
}
.chart-card-pill {
  flex-shrink: 0;
  padding: .32rem .65rem;
  border-radius: 9999px;
  background: var(--alam-green-soft);
  color: var(--alam-green-dark);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  border: 1px solid rgba(16, 94, 53, .12);
}
.chart-donut-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
@media (min-width: 480px) {
  .chart-donut-layout {
    flex-direction: row;
    align-items: center;
    gap: 1.1rem;
  }
}
.chart-donut-wrap {
  position: relative;
  width: 8.75rem;
  height: 8.75rem;
  flex-shrink: 0;
}
.chart-donut-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.chart-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  pointer-events: none;
  text-align: center;
  padding: 0 .75rem;
}
.chart-donut-center-label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #667085;
}
.chart-donut-center-value {
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--alam-green-dark);
}
.chart-legend-list {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.chart-legend-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .28rem;
}
.chart-legend-name {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  font-size: .74rem;
  font-weight: 600;
  color: #3d5348;
}
.chart-legend-pct {
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 800;
  color: var(--alam-green-dark);
}
.chart-legend-bar {
  height: .32rem;
  border-radius: 9999px;
  background: rgba(231, 225, 213, .55);
  overflow: hidden;
}
.chart-legend-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  min-width: 0;
  transition: width .6s ease;
}
.chart-legend-amount {
  margin-top: .22rem;
  font-size: .68rem;
  font-weight: 600;
  color: #667085;
  text-align: right;
}
.chart-series-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem .55rem;
}
.chart-series-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .22rem .5rem;
  border-radius: 9999px;
  background: rgba(234, 247, 228, .75);
  border: 1px solid rgba(30, 94, 58, .08);
  font-size: .64rem;
  font-weight: 700;
  color: var(--alam-green-dark);
  white-space: nowrap;
}
.chart-series-dot {
  width: .45rem;
  height: .45rem;
  border-radius: 9999px;
  flex-shrink: 0;
}
.chart-series-dot-sales { background: #1e5e3a; }
.chart-series-dot-profit {
  background: transparent;
  border: 2px solid #4caf4a;
  width: .5rem;
  height: .5rem;
}
.chart-trend-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin-bottom: .75rem;
}
.chart-trend-stat {
  padding: .5rem .65rem;
  border-radius: .75rem;
  background: linear-gradient(135deg, rgba(234, 247, 228, .65), rgba(255, 250, 240, .9));
  border: 1px solid rgba(30, 94, 58, .07);
}
.chart-trend-stat-label {
  display: block;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #667085;
}
.chart-trend-stat-value {
  display: block;
  margin-top: .15rem;
  font-size: .82rem;
  font-weight: 800;
  color: var(--alam-green-dark);
  line-height: 1.25;
}
@media (max-width: 479px) {
  .chart-card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .chart-series-legend {
    justify-content: flex-start;
  }
  .chart-card-pill {
    align-self: flex-start;
  }
}

/* Dashboard responsive */
.dashboard-page {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.dashboard-page .page-main {
  min-width: 0;
  width: 100%;
}
.dashboard-panel-card {
  border-radius: 1.15rem !important;
  box-shadow: 0 10px 32px rgba(16, 74, 44, .07) !important;
  overflow: hidden;
}
.dashboard-panel-card .page-toolbar {
  background: linear-gradient(180deg, rgba(251, 248, 241, .55) 0%, transparent 100%);
  border-bottom-color: rgba(231, 225, 213, .5) !important;
  padding: .85rem 1.1rem !important;
}
.dashboard-panel-card .page-body {
  padding: .85rem 1.1rem 1.1rem !important;
}
.dashboard-link-more {
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 700;
  color: var(--alam-green-dark);
  text-decoration: none;
  padding: .35rem .65rem;
  border-radius: .55rem;
  transition: background .12s ease;
}
.dashboard-link-more:hover {
  background: var(--alam-green-soft);
  text-decoration: underline;
}
.dashboard-alert-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 9999px;
  background: rgba(255, 138, 0, .14);
  color: #e67d00;
  flex-shrink: 0;
}
.dashboard-trx-card {
  min-width: 0;
  border-radius: .85rem !important;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.dashboard-trx-card:hover {
  box-shadow: 0 6px 18px rgba(16, 74, 44, .08);
}
.dashboard-page .timeline-item {
  padding: .55rem .65rem;
  border-radius: .75rem;
  border: 1px solid rgba(231, 225, 213, .45);
  background: #fbfaf6;
  transition: background .12s ease;
}
.dashboard-page .timeline-item:hover {
  background: rgba(234, 247, 228, .45);
}
.dashboard-page .timeline-icon {
  border-radius: .55rem !important;
}
.donut-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  font-size: .875rem;
}
.page-toolbar-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

/* ===== List / filter compact + tombol kembali ===== */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 2rem;
  padding: .3rem .7rem;
  border-radius: .65rem;
  background: var(--alam-green);
  color: #fff !important;
  font-size: .78rem !important;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
  border: 0;
  box-shadow: 0 2px 8px rgba(16, 74, 44, .16);
  width: fit-content;
  flex-shrink: 0;
}
.btn-back:hover {
  filter: brightness(1.05);
  color: #fff !important;
}
.btn-back svg { flex-shrink: 0; }

.list-section-head {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .65rem .85rem .5rem !important;
  border-bottom: 1px solid rgba(231, 225, 213, .72);
}
.list-section-titles { min-width: 0; }
.page-filter-bar {
  padding: .55rem .75rem !important;
  border-bottom: 1px solid rgba(231, 225, 213, .65);
  background: rgba(251, 248, 241, .45);
}
.page-filter-standalone {
  overflow: hidden;
}
.page-filter-standalone .page-filter-bar {
  border-bottom: 0;
}
.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .45rem .5rem;
  width: 100%;
}
.filter-toolbar .input-field,
.filter-toolbar select {
  min-width: 0;
  width: auto;
  flex: 1 1 8.5rem;
}
.filter-toolbar-search {
  flex: 1 1 12rem !important;
  min-width: 0 !important;
}
.filter-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  flex: 1 1 auto;
}
.filter-toolbar-actions .btn-primary,
.filter-toolbar-actions .btn-ghost,
.filter-toolbar-actions .btn-secondary,
.filter-toolbar-primary {
  flex: 0 0 auto;
  min-height: 2.15rem;
  padding: .4rem .75rem !important;
  font-size: .78rem !important;
}
.date-range-field {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex: 1 1 14rem;
  min-width: 0;
}
.date-range-field .input-field {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
}
.date-range-sep {
  color: #98a2b3;
  font-size: .78rem;
  flex-shrink: 0;
}
.page-detail-head {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.page-detail-head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem .75rem;
}

@media (max-width: 767px) {
  .app-content {
    max-width: 100vw;
    overflow-x: visible; /* jangan clip — agar sticky Aksi di dalam .table-sheet-wrap bisa jalan */
  }
  .page-filter-bar,
  .page-filter-standalone,
  .filter-toolbar {
    max-width: 100%;
    overflow-x: clip;
  }
  .list-section,
  .list-section .page-body {
    max-width: 100%;
    overflow: visible;
  }
  .list-section-head {
    padding: .45rem .6rem .35rem !important;
    gap: .3rem;
  }
  .page-filter-bar {
    padding: .45rem .6rem .55rem !important;
  }
  .filter-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .35rem;
    align-items: stretch;
  }
  .filter-toolbar .date-range-field,
  .filter-toolbar .filter-toolbar-search,
  .filter-toolbar .filter-toolbar-actions,
  .filter-toolbar .filter-toolbar-primary {
    grid-column: 1 / -1;
  }
  .filter-toolbar .input-field,
  .filter-toolbar select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none;
    min-height: 2.35rem !important;
    padding: .4rem .55rem !important;
  }

  /* ss1: tanggal tidak meluber — stack vertikal */
  .date-range-field {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .35rem !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }
  .date-range-sep { display: none !important; }
  .date-range-field .input-field,
  .date-range-field input[type="date"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* ss2: aksi filter sticky di atas bottom nav */
  .filter-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 4.35rem);
    z-index: 25;
    gap: .35rem;
    margin-top: .15rem;
    padding: .4rem;
    border-radius: .7rem;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(219, 210, 190, .85);
    box-shadow: 0 8px 22px rgba(16, 74, 44, .12);
  }
  .filter-toolbar-actions .btn-secondary {
    grid-column: 1 / -1;
  }
  .filter-toolbar-actions > * {
    width: 100%;
    justify-content: center;
  }
  .filter-toolbar-actions .btn-primary,
  .filter-toolbar-actions .btn-ghost,
  .filter-toolbar-actions .btn-secondary {
    min-height: 2.05rem !important;
    padding: .35rem .55rem !important;
    font-size: .7rem !important;
  }

  /* ss3: teks tabel tidak turun baris */
  .table-sheet-wrap .data-table th,
  .table-sheet-wrap .data-table td {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 9.5rem;
  }
  /* Kolom Aksi sticky di tepi kanan saat geser tabel */
  .table-sheet-wrap .data-table th.col-actions,
  .table-sheet-wrap .data-table td.col-actions {
    position: sticky !important;
    right: 0 !important;
    z-index: 5 !important;
    max-width: none !important;
    width: auto !important;
    min-width: 5.5rem;
    overflow: visible !important;
    text-overflow: clip !important;
    background: #fff !important;
    box-shadow: -8px 0 14px rgba(16, 74, 44, .12);
  }
  .table-sheet-wrap .data-table thead th.col-actions {
    z-index: 6 !important;
    background: #f7f3ea !important;
  }
  .table-sheet-wrap .data-table tbody tr:nth-child(even) td.col-actions {
    background: #fbf8f1 !important;
  }
  .table-sheet-wrap .data-table tbody tr:hover td.col-actions {
    background: #eef8ef !important;
  }

  .page-heading { font-size: .76rem !important; line-height: 1.25 !important; }
  .page-heading-sub { font-size: .64rem !important; margin-top: .05rem !important; }
  .detail-hero-eyebrow { font-size: .6rem !important; }
  .detail-hero-title { font-size: .9rem !important; }
  .detail-hero-sub { font-size: .66rem !important; }
  .detail-meta-label,
  .form-label,
  .pos-section-label { font-size: .64rem !important; }
  .detail-meta-value,
  .detail-amount-label { font-size: .68rem !important; }
  .detail-amount-value { font-size: .88rem !important; }
  .btn-primary,
  .btn-secondary,
  .btn-ghost,
  .btn-accent,
  .detail-action-chip {
    font-size: .7rem !important;
    min-height: 2.05rem;
  }
  .app-topbar-eyebrow { font-size: .58rem !important; }
  .app-topbar-title { font-size: .82rem !important; }
  .kpi-dashboard-card .kpi-value,
  .kpi-card-v3-value { font-size: .92rem !important; }
  .kpi-dashboard-card .kpi-label,
  .kpi-card-v3-label { font-size: .64rem !important; }
  .tab-nav-item { font-size: .68rem !important; padding: .35rem .6rem !important; }
  .page-body { padding: .55rem .6rem !important; }
  .page-toolbar { padding: .5rem .6rem !important; }
  .data-table th { font-size: .6rem !important; padding: .45rem .5rem !important; }
  .data-table td { font-size: .68rem !important; padding: .45rem .5rem !important; }
  .btn-back { font-size: .68rem !important; min-height: 1.8rem; padding: .28rem .6rem; }
}
@media (min-width: 1024px) {
  .chart-box-lg { height: 14rem; }
  .chart-box-md { height: 13rem; }
  .chart-box-trend { height: 13.5rem; }
  .chart-donut-wrap {
    width: 9.25rem;
    height: 9.25rem;
  }
  .chart-donut-center-value { font-size: .78rem; }
  .chart-card-head { padding: .95rem 1.1rem .75rem; }
  .chart-card-body { padding: .95rem 1.1rem 1.1rem; }
}

/* POS mobile */
#product-carousel {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
#product-carousel .product-tile {
  scroll-snap-align: start;
  flex-shrink: 0;
}
@media (max-width: 1279px) {
  .pos-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Safe area + anti-zoom — HARUS di akhir agar menang atas .input-field !important */
@supports (padding: env(safe-area-inset-top)) {
  .pwa-splash {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

@media (max-width: 767px) {
  input,
  select,
  textarea,
  .input-field,
  .input-with-prefix,
  .login-field-input,
  .command-palette-input,
  .cart-qty,
  [data-format] {
    font-size: 16px !important;
    line-height: 1.35 !important;
  }
  /* Filter bar: tetap aman anti-zoom, tapi padding lebih compact */
  .filter-toolbar .input-field,
  .filter-toolbar select,
  .date-range-field .input-field {
    font-size: 16px !important;
    line-height: 1.25 !important;
    min-height: 2.35rem !important;
    padding-top: .4rem !important;
    padding-bottom: .4rem !important;
  }
}

@media (pointer: coarse) {
  html {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
  }
}
