/* ==========================================================================
   Azhar Shop PWA — design system
   Tema: hijau segar, kartu membulat, gaya "super app" mobile-first.
   ========================================================================== */

:root {
  --brand: #00A651;
  --brand-600: #00924A;
  --brand-700: #007A3E;
  --brand-50: #E9F9F0;
  --brand-100: #CDF2DD;
  --brand-ink: #053A1F;
  --accent: #E5262E;

  --bg: #F2F5F4;
  --card: #FFFFFF;
  --ink: #0F1A14;
  --ink-2: #39463F;
  --muted: #6A7871;
  --faint: #9AA6A0;
  --line: #E3E9E6;
  --line-2: #EDF1EF;
  --field: #F6F8F7;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --sh-1: 0 1px 2px rgba(15, 26, 20, .05), 0 2px 10px rgba(15, 26, 20, .04);
  --sh-2: 0 10px 30px rgba(15, 26, 20, .10);
  --sh-brand: 0 8px 20px rgba(0, 166, 81, .28);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 66px;
  --maxw: 760px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
html.has-sheet { overflow: hidden; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-700); }
button { font-family: inherit; }
h1, h2, h3, h4 { letter-spacing: -.015em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 11.5px; }
.text-green { color: #04803F !important; }
.text-red { color: #D02525 !important; }
.text-amber { color: #B45309 !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.gap-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.print-only { display: none; }

/* Ikon ----------------------------------------------------------------- */
.i {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Warna nada (ikon pastel) --------------------------------------------- */
.tone-green  { background: #E3F7EC; color: #00964A; }
.tone-blue   { background: #E7EFFE; color: #2563EB; }
.tone-orange { background: #FFEFE2; color: #E8620A; }
.tone-red    { background: #FDEBEB; color: #DC2626; }
.tone-purple { background: #F0EAFE; color: #7C3AED; }
.tone-teal   { background: #E1F5F2; color: #0D9488; }
.tone-amber  { background: #FEF4D9; color: #B7791F; }
.tone-sky    { background: #E0F2FC; color: #0284C7; }
.tone-pink   { background: #FDE7F2; color: #DB2777; }
.tone-gray   { background: #ECF0EE; color: #5B6862; }

/* Kerangka ------------------------------------------------------------- */
.app { min-height: 100dvh; }
.sidebar { display: none; }
.main { min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px); }
body.no-tabbar .main { padding-bottom: calc(120px + var(--safe-bottom)); }
.page { max-width: var(--maxw); margin: 0 auto; padding: 16px 16px 8px; }
.page-flush { padding-top: 0; }

/* App bar ---------------------------------------------------------------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(135deg, #00B157 0%, var(--brand) 45%, var(--brand-600) 100%);
  color: #fff;
  padding-top: var(--safe-top);
  box-shadow: 0 2px 14px rgba(0, 110, 55, .20);
}
.appbar-inner {
  display: flex; align-items: center; gap: 4px;
  min-height: 60px; max-width: var(--maxw); margin: 0 auto;
  padding: 0 8px 0 16px;
}
.appbar-back { margin-left: -8px; }
.appbar-title { flex: 1; min-width: 0; padding: 0 4px; }
.appbar-title h1 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-title p { margin: 1px 0 0; font-size: 12.5px; opacity: .86; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-actions { display: flex; align-items: center; gap: 2px; }
.appbar .icon-btn { color: #fff; }
.appbar .icon-btn:hover { background: rgba(255, 255, 255, .14); }
.appbar .icon-btn:active { background: rgba(255, 255, 255, .22); }
.appbar-tools { max-width: var(--maxw); margin: 0 auto; padding: 0 16px 12px; display: flex; gap: 8px; }
.appbar-tools .search-box { border-color: transparent; box-shadow: 0 2px 8px rgba(0, 60, 30, .12); }
.appbar-tools .icon-btn { background: rgba(255, 255, 255, .18); width: 46px; height: 46px; border-radius: 14px; }

/* Tab bar bawah ---------------------------------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 4px 6px calc(4px + var(--safe-bottom));
  background: rgba(255, 255, 255, .97);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(15, 26, 20, .05);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; padding: 4px 0;
  color: var(--faint); text-decoration: none; background: none; border: 0; cursor: pointer;
  font-size: 11px; font-weight: 600; position: relative;
}
.tab .i { width: 24px; height: 24px; transition: transform .15s; }
.tab:active .i { transform: scale(.88); }
.tab.is-active { color: var(--brand); }
.tab.is-active .i { stroke-width: 2.3; }
.tab.is-active::before {
  content: ""; position: absolute; top: -5px; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand);
}
.tab-fab { color: var(--ink-2); }
.fab-circle {
  width: 54px; height: 54px; margin-top: -28px; border-radius: 19px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #00BA5C, var(--brand-600));
  box-shadow: var(--sh-brand), 0 0 0 5px #fff;
  transition: transform .15s;
}
.fab-circle .i { width: 28px; height: 28px; stroke-width: 2.4; }
.tab-fab:active .fab-circle { transform: scale(.92) rotate(45deg); }

/* Tombol ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border: 0; border-radius: var(--r);
  font: 600 15px/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .12s, background .2s, box-shadow .2s, opacity .2s; user-select: none;
}
.btn .i { width: 20px; height: 20px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
.btn-primary:hover { background: var(--brand-600); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); }
.btn-soft:hover { background: var(--brand-100); }
.btn-light { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-danger { background: #FDECEC; color: #C81E1E; }
.btn-danger-solid { background: #DC2626; color: #fff; box-shadow: 0 8px 18px rgba(220, 38, 38, .25); }
.btn-white { background: #fff; color: var(--brand-700); }
.btn-lg { height: 54px; font-size: 16px; border-radius: 16px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn-sm .i { width: 17px; height: 17px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; box-shadow: none; }
.btn.is-busy::before {
  content: ""; width: 17px; height: 17px; flex: none;
  border: 2.4px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn.is-busy .i { display: none; }

.icon-btn {
  width: 42px; height: 42px; flex: none;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 13px; background: transparent; color: var(--ink-2);
  cursor: pointer; text-decoration: none; transition: background .15s, transform .12s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn-soft { background: var(--brand-50); color: var(--brand-700); }
.icon-btn-brand { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
.icon-btn-light { background: #fff; box-shadow: var(--sh-1); }

/* Kartu & seksi ----------------------------------------------------------- */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-pad { padding: 16px; }
.section { margin-top: 24px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 10px; }
.section-head h2 { margin: 0; font-size: 16.5px; font-weight: 700; }
.section-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.link { color: var(--brand); font-size: 13.5px; font-weight: 700; text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; font-family: inherit; }

/* Daftar (list) ----------------------------------------------------------- */
.list { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.list-flat { border-radius: 0; box-shadow: none; }
.list + .list { margin-top: 12px; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px;
  background: none; border: 0; color: inherit; text-decoration: none; text-align: left; font: inherit;
}
a.row, button.row { cursor: pointer; transition: background .12s; }
a.row:hover, button.row:hover { background: #FAFCFB; }
a.row:active, button.row:active { background: #F1F6F3; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 68px; right: 0; height: 1px; background: var(--line-2); }
.row-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; }
.row-icon .i { width: 21px; height: 21px; }
.row-avatar { font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.date-block { display: flex; flex-direction: column; gap: 1px; line-height: 1; background: var(--brand-50); color: var(--brand-700); }
.date-block b { font-size: 16px; font-weight: 800; }
.date-block small { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub2 { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; white-space: normal; overflow: visible; }
.row-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.row-amount { font-size: 15px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-meta { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.row-chev { flex: none; margin-right: -4px; color: #C2CCC7; }
.row-chev .i { width: 18px; height: 18px; }
.row.is-muted .row-title { color: var(--muted); }
.row.is-static { cursor: default; }
.row-action {
  flex: none; width: 36px; height: 36px; margin-right: -6px; display: grid; place-items: center;
  border: 0; border-radius: 11px; background: transparent; color: #D35B5B; cursor: pointer;
}
.row-action:hover { background: #FDECEC; }
.row-action .i { width: 19px; height: 19px; }
.row.is-done .row-icon { background: var(--brand); color: #fff; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot-green { background: #16A34A; }
.dot-red { background: #DC2626; }
.dot-amber { background: #F59E0B; }
.dot-gray { background: #A3ADA8; }

/* Badge ---------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.b-green { background: #E1F5E9; color: #04803F; }
.b-red { background: #FDE6E6; color: #C81E1E; }
.b-amber { background: #FEF1D3; color: #A15C07; }
.b-gray { background: #ECF0EE; color: #56635D; }
.b-blue { background: #E4ECFE; color: #1D4ED8; }
.b-purple { background: #EFE8FE; color: #6D28D9; }

/* Form ------------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 14px; }
.field > label, .field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .opt { color: var(--faint); font-weight: 500; }
.field-hint { font-size: 12px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row > .field { margin-bottom: 14px; }
.input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--field);
  font: 500 16px var(--font); color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: #A9B4AE; }
.input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(0, 166, 81, .13); }
.input[readonly] { background: #EDF1EF; color: var(--muted); }
.input[type="date"] { min-width: 0; }
.input[type="date"]::-webkit-date-and-time-value { text-align: left; }
select.input {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236A7871' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input-static { display: flex; align-items: center; gap: 8px; color: var(--muted); background: #EDF1EF; font-size: 14px; }
.input-static .i { width: 18px; height: 18px; }
.input-money { position: relative; }
.input-money > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; font-weight: 600; pointer-events: none; }
.input-money .input { padding-left: 42px; font-weight: 600; font-variant-numeric: tabular-nums; }
.input-money-lg .input { height: 60px; font-size: 24px; font-weight: 800; padding-left: 50px; }
.input-money-lg > span { font-size: 18px; left: 16px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.input-group .icon-btn { width: 48px; height: 48px; border-radius: 14px; }

.stepper { display: flex; align-items: center; height: 48px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--field); overflow: hidden; }
.stepper:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(0, 166, 81, .13); }
.stepper button { width: 46px; height: 100%; flex: none; display: grid; place-items: center; border: 0; background: transparent; color: var(--brand-700); cursor: pointer; }
.stepper button:active { background: var(--brand-50); }
.stepper .input { height: 100%; padding: 0; border: 0; background: transparent; box-shadow: none !important; text-align: center; font-weight: 800; font-size: 17px; min-width: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.seg { display: flex; gap: 4px; padding: 4px; background: #EAEFEC; border-radius: 15px; }
.seg > label, .seg > button { flex: 1; position: relative; margin: 0; cursor: pointer; border: 0; background: none; padding: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .seg > button {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; border-radius: 11px; font-size: 14px; font-weight: 600; color: var(--muted);
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg span .i, .seg > button .i { width: 18px; height: 18px; }
.seg input:checked + span, .seg > button.is-active { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }
.seg-tones .seg-in input:checked + span { color: #04803F; }
.seg-tones .seg-out input:checked + span { color: #C81E1E; }
.seg-sm span, .seg-sm > button { height: 34px; font-size: 13px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 14px; background: var(--field); border: 1.5px solid var(--line); cursor: pointer; }
.switch b { display: block; font-size: 14.5px; font-weight: 600; }
.switch small { color: var(--muted); font-size: 12.5px; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 48px; height: 28px; flex: none; border-radius: 99px; background: #CBD5D0; position: relative; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* Chip & pencarian -------------------------------------------------------- */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2);
  font: 600 13px var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; transition: .15s;
}
.chip .i { width: 16px; height: 16px; }
.chip.is-active { background: var(--brand-50); border-color: var(--brand); color: var(--brand-700); }
.chip-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--line-2); font-size: 11px; display: inline-grid; place-items: center; }
.chip.is-active .chip-count { background: var(--brand); color: #fff; }

.search-box {
  flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0;
  height: 46px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--muted);
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0, 166, 81, .12); }
.search-box .i { width: 20px; height: 20px; }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: 500 16px var(--font); color: var(--ink); }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }

/* Ringkasan angka --------------------------------------------------------- */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary-2 { grid-template-columns: repeat(2, 1fr); }
.summary-4 { grid-template-columns: repeat(2, 1fr); }
.sum { min-width: 0; padding: 12px; border-radius: 16px; background: #fff; box-shadow: var(--sh-1); }
.sum small { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.sum small .i { width: 14px; height: 14px; }
.sum b { display: block; margin-top: 4px; font-size: 15.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.sum { border: 0; text-align: left; font-family: inherit; cursor: pointer; color: inherit; }
.sum.is-active { box-shadow: 0 0 0 2px var(--brand), var(--sh-1); }

.panel-brand {
  position: relative; overflow: hidden; padding: 18px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, #00B65A 0%, var(--brand-600) 60%, #00733A 100%);
  box-shadow: 0 10px 24px rgba(0, 120, 60, .22);
}
.panel-brand::after { content: ""; position: absolute; right: -40px; top: -50px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255, 255, 255, .10); }
.panel-brand::before { content: ""; position: absolute; right: 40px; bottom: -70px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.panel-brand > * { position: relative; z-index: 1; }
.panel-label { font-size: 12.5px; font-weight: 600; opacity: .88; display: flex; align-items: center; gap: 6px; }
.panel-label .i { width: 16px; height: 16px; }
.panel-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.panel-sub { font-size: 13px; opacity: .9; }
.panel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .2); }
.panel-stats small { display: block; font-size: 11px; opacity: .8; font-weight: 600; }
.panel-stats b { font-size: 14px; font-weight: 700; white-space: nowrap; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.kv .kv-total { padding-top: 10px; border-top: 1px dashed var(--line); font-size: 15.5px; }
.kv dt.kv-total { color: var(--ink); font-weight: 700; }

/* Banner peringatan -------------------------------------------------------- */
.alert {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  border: 0; border-radius: 18px; background: #FFF3E3; color: #8A4B08;
  font: 500 13px/1.35 var(--font); text-align: left; text-decoration: none; cursor: pointer;
}
.alert b { display: block; font-size: 14px; color: #5C3105; }
.alert-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 13px; background: #FFE1BC; color: #D9480F; }
.alert .row-chev { color: #D9A169; }
.alert-green { background: var(--brand-50); color: var(--brand-700); }
.alert-green b { color: var(--brand-ink); }
.alert-green .alert-ic { background: var(--brand-100); color: var(--brand-700); }

/* Beranda --------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  padding: calc(var(--safe-top) + 14px) 16px 84px;
  background:
    radial-gradient(circle at 85% -10%, rgba(255, 255, 255, .22) 0, rgba(255, 255, 255, 0) 45%),
    linear-gradient(160deg, #00B85C 0%, #00A04F 50%, #008441 100%);
  border-radius: 0 0 30px 30px;
}
.hero::after { content: ""; position: absolute; left: -60px; bottom: -90px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.hero-inner { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; }
.hero-top { display: flex; align-items: center; gap: 12px; }
.hero-logo { width: 46px; height: 46px; border-radius: 15px; background: #fff; padding: 3px; box-shadow: 0 4px 12px rgba(0, 60, 30, .2); }
.hero-hello { flex: 1; min-width: 0; }
.hero-hello small { display: block; font-size: 12.5px; opacity: .86; }
.hero-hello b { display: block; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .icon-btn { color: #fff; background: rgba(255, 255, 255, .16); }
.hero-search {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; margin-top: 16px; padding: 0 8px 0 14px;
  border: 0; border-radius: 15px; background: #fff; color: var(--muted);
  font: 500 14.5px var(--font); text-align: left; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 60, 30, .18);
}
.hero-search .i { width: 20px; height: 20px; }
.hero-search span { flex: 1; }
.hero-search em { font-style: normal; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--brand-50); color: var(--brand); }

.wallet { position: relative; z-index: 2; max-width: var(--maxw); margin: -66px auto 0; padding: 0 16px; }
.wallet-card { padding: 16px; border-radius: 24px; background: #fff; box-shadow: var(--sh-2); }
.wallet-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.wallet-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.wallet-label .i { width: 16px; height: 16px; color: var(--brand); }
.wallet-amount { margin-top: 3px; font-size: 27px; font-weight: 800; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.wallet-pill { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 4px 10px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-size: 12px; font-weight: 700; }
.wallet-pill .i { width: 14px; height: 14px; }
.wallet-side { text-align: right; font-size: 12px; color: var(--muted); }
.wallet-side b { display: block; color: var(--ink); font-size: 14px; }
.wallet-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.wallet-action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--ink-2); font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer; }
.wallet-action .ic { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(145deg, #00BA5C, var(--brand-600)); box-shadow: 0 6px 14px rgba(0, 166, 81, .25); transition: transform .15s; }
.wallet-action:active .ic { transform: scale(.9); }

.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 6px; padding: 20px 4px 2px; }
.service { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0; border: 0; background: none; color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.25; text-align: center; text-decoration: none; cursor: pointer; }
.service-ic { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 19px; transition: transform .15s; }
.service-ic .i { width: 27px; height: 27px; }
.service:active .service-ic { transform: scale(.9); }

.kpis { display: flex; gap: 12px; margin: 0 -16px; padding: 4px 16px 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.kpis::-webkit-scrollbar { display: none; }
.kpi {
  position: relative; overflow: hidden; flex: 0 0 min(76%, 270px); scroll-snap-align: start;
  display: flex; flex-direction: column; justify-content: space-between; min-height: 122px; padding: 16px;
  border: 0; border-radius: 22px; color: #fff; text-align: left; font-family: inherit; cursor: pointer;
  transition: transform .15s;
}
.kpi:active { transform: scale(.98); }
.kpi::after { content: ""; position: absolute; right: -34px; top: -34px; width: 124px; height: 124px; border-radius: 50%; background: rgba(255, 255, 255, .13); }
.kpi::before { content: ""; position: absolute; right: 30px; bottom: -46px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.kpi > * { position: relative; z-index: 1; }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; opacity: .95; }
.kpi-label .i { width: 18px; height: 18px; padding: 0; }
.kpi-value { margin: 10px 0 2px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; opacity: .85; }
.g-green { background: linear-gradient(135deg, #10C468, #00894A); }
.g-blue { background: linear-gradient(135deg, #4F8DF7, #1D4ED8); }
.g-orange { background: linear-gradient(135deg, #FFA053, #EA580C); }
.g-purple { background: linear-gradient(135deg, #9B6CF8, #6D28D9); }
.g-teal { background: linear-gradient(135deg, #22C7B4, #0F766E); }
.g-red { background: linear-gradient(135deg, #F87171, #D12A2A); }
.g-amber { background: linear-gradient(135deg, #FBBF24, #D97706); }
.g-sky { background: linear-gradient(135deg, #3CC2F8, #0369A1); }
.g-ink { background: linear-gradient(135deg, #3E4C5E, #111827); }
.g-pink { background: linear-gradient(135deg, #F472B6, #C0266D); }

.tabs-inline { margin-bottom: 10px; }

/* Bottom sheet (dialog) -------------------------------------------------------- */
dialog.sheet {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; color: inherit;
}
dialog.sheet[open] { display: flex; flex-direction: column; justify-content: flex-end; }
dialog.sheet::backdrop, dialog.confirm::backdrop { background: rgba(8, 20, 14, .48); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.sheet-panel {
  display: flex; flex-direction: column; width: 100%; max-width: 640px; max-height: min(92dvh, 920px); margin: 0 auto;
  padding-bottom: var(--safe-bottom);
  border-radius: 26px 26px 0 0; background: #fff; box-shadow: 0 -12px 40px rgba(0, 0, 0, .14);
  animation: sheet-up .34s cubic-bezier(.2, .9, .25, 1);
  will-change: transform;
}
.sheet-tall .sheet-panel { height: min(92dvh, 920px); }
dialog.sheet.is-closing .sheet-panel { animation: sheet-down .22s ease-in forwards; }
dialog.sheet.is-closing::backdrop { opacity: 0; transition: opacity .22s; }
.sheet-handle { display: flex; justify-content: center; padding: 9px 0 3px; touch-action: none; cursor: grab; }
.sheet-handle span { width: 42px; height: 5px; border-radius: 9px; background: #D7DFDB; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 4px 10px 8px 20px; }
.sheet-head h3 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 20px 16px; overscroll-behavior: contain; }
.sheet-body-flush { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--line-2); background: #fff; }
.sheet-foot .btn { flex: 1; }
.sheet-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sheet-section-title { margin: 14px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sheet-body .list { box-shadow: none; border: 1px solid var(--line-2); }
.sheet .toasts { bottom: calc(24px + var(--safe-bottom)); }

dialog.confirm { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 24px; border: 0; background: transparent; }
dialog.confirm[open] { display: grid; place-items: center; }
.confirm-panel { width: 100%; max-width: 360px; padding: 24px 20px 18px; border-radius: 26px; background: #fff; text-align: center; box-shadow: var(--sh-2); animation: pop .2s ease-out; }
.confirm-panel h3 { margin: 0; font-size: 18px; }
.confirm-panel p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.confirm-icon { width: 58px; height: 58px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 19px; background: var(--brand-50); color: var(--brand); }
.confirm-icon .i { width: 28px; height: 28px; }
.confirm.is-danger .confirm-icon { background: #FDECEC; color: #DC2626; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px;
  border: 1.5px solid var(--line-2); border-radius: 19px; background: #F8FAF9; color: var(--ink);
  font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: transform .12s, border-color .15s;
}
.quick:hover { border-color: var(--brand-100); }
.quick:active { transform: scale(.98); }
.quick-icon { width: 44px; height: 44px; margin-bottom: 8px; display: grid; place-items: center; border-radius: 14px; }
.quick b { font-size: 14.5px; }
.quick small { color: var(--muted); font-size: 12px; }

/* Pemilih barang ------------------------------------------------------------- */
.picker-search { display: flex; gap: 10px; padding: 2px 16px 10px; }
.picker-search .icon-btn { width: 46px; height: 46px; border-radius: 14px; }
.picker-hint { margin: 4px 20px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
[data-picker-list] { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 12px; overscroll-behavior: contain; }
.pick-field { display: flex; align-items: stretch; gap: 8px; }
.pick-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 8px 12px 8px 8px;
  border: 1.5px solid var(--line); border-radius: 15px; background: var(--field); color: var(--ink);
  font: inherit; text-align: left; cursor: pointer;
}
.pick-main .row-icon { width: 44px; height: 44px; }
.pick-main > .i { color: var(--muted); width: 18px; }
.pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-text small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-field .icon-btn { width: 62px; height: auto; border-radius: 15px; }
.pick-field.is-picked .pick-main { border-color: var(--brand); background: #fff; }
.pick-field.is-locked .pick-main { cursor: default; }
.calc-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 15px; background: var(--brand-50); color: var(--brand-ink); font-size: 14px; }
.calc-box b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.calc-box small { display: block; font-size: 12px; color: var(--brand-700); font-weight: 600; }
.calc-box.is-warn { background: #FDECEC; color: #7F1D1D; }
.calc-box.is-warn small { color: #C81E1E; }
.stock-pill { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }

/* Dock bawah (aksi utama halaman fokus) ------------------------------------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 10px 12px calc(10px + var(--safe-bottom)); background: linear-gradient(to top, var(--bg) 62%, rgba(242, 245, 244, 0)); pointer-events: none; }
.dock-inner { pointer-events: auto; max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 22px; background: #fff; box-shadow: 0 10px 34px rgba(15, 26, 20, .16); }
.dock-total { flex: 1; min-width: 0; }
.dock-total small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.dock-total b { display: block; font-size: 19px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.dock .icon-btn { width: 50px; height: 50px; border-radius: 16px; }
.dock .btn { height: 50px; border-radius: 16px; }

.fab {
  position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px); z-index: 36;
  display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 20px 0 16px;
  border: 0; border-radius: 19px; background: var(--brand); color: #fff;
  font: 700 15px var(--font); text-decoration: none; cursor: pointer;
  box-shadow: var(--sh-brand), 0 12px 26px rgba(0, 0, 0, .12); transition: transform .15s;
}
.fab .i { width: 22px; height: 22px; stroke-width: 2.4; }
.fab:active { transform: scale(.95); }

/* Feed / infinite scroll ------------------------------------------------------- */
.feed-more { display: flex; justify-content: center; padding: 18px; }
.feed-end { padding: 16px; text-align: center; font-size: 12px; color: var(--faint); }
.spinner { width: 24px; height: 24px; border: 2.6px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
.skel { border-radius: 8px; background: linear-gradient(90deg, #ECF0EE 25%, #F6F8F7 50%, #ECF0EE 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skel-row { display: flex; align-items: center; gap: 12px; padding: 14px; }
.skel-row .skel-ic { width: 44px; height: 44px; border-radius: 14px; }
.skel-row .skel-lines { flex: 1; display: grid; gap: 7px; }
.skel-row .skel-l1 { height: 12px; width: 60%; }
.skel-row .skel-l2 { height: 10px; width: 38%; }

/* Kosong ---------------------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; padding: 38px 24px; color: var(--muted); text-align: center; }
.empty-icon { width: 76px; height: 76px; margin-bottom: 14px; display: grid; place-items: center; border-radius: 26px; background: var(--brand-50); color: var(--brand); }
.empty-icon .i { width: 34px; height: 34px; }
.empty strong { color: var(--ink); font-size: 16px; }
.empty p { max-width: 300px; margin: 4px 0 16px; font-size: 13.5px; }

/* Tabel (laporan) ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border-radius: 18px; background: #fff; box-shadow: var(--sh-1); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { padding: 10px 12px; background: #F6F9F7; color: var(--muted); font-size: 11.5px; font-weight: 700; text-align: left; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.table td { padding: 10px 12px; border-top: 1px solid var(--line-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .r { text-align: right; }
.table tr.is-clickable { cursor: pointer; }
.table tr.is-clickable:hover td { background: #FAFCFB; }

/* Grafik ---------------------------------------------------------------------- */
.chart-card { padding: 14px 12px 10px; }
.chart-box { position: relative; height: 240px; }
.legend { display: flex; gap: 14px; justify-content: center; margin-top: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.meter { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #22C55E, var(--brand)); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mini-card { display: block; padding: 14px; border: 0; border-radius: 18px; background: #fff; box-shadow: var(--sh-1); color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.mini-card:active { transform: scale(.99); }
.mini-card-top { display: flex; align-items: center; gap: 10px; }
.mini-card-top .row-icon { width: 40px; height: 40px; border-radius: 13px; }
.mini-card-name { flex: 1; min-width: 0; }
.mini-card-name b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-card-name small { color: var(--muted); font-size: 12px; }
.mini-card-vals { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.mini-card-vals b { display: block; color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }

/* STO -------------------------------------------------------------------------- */
.sto-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; position: relative; }
.sto-row + .sto-row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line-2); }
.sto-row .row-body { gap: 1px; }
.sto-input { width: 92px; flex: none; }
.sto-input .input { height: 44px; text-align: center; font-weight: 700; padding: 0 8px; }
.sto-diff { width: 52px; flex: none; text-align: right; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--faint); }
.sto-row.is-filled { background: #F7FCF9; }
.sto-row.is-filled .input { border-color: var(--brand); background: #fff; }

/* Toast ------------------------------------------------------------------------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
body.no-tabbar .toasts { bottom: calc(100px + var(--safe-bottom)); }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 460px; padding: 12px 16px 12px 12px;
  border-radius: 16px; background: #15211B; color: #fff; font-size: 14px; font-weight: 500; line-height: 1.35;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25); pointer-events: auto; animation: toast-in .28s cubic-bezier(.2, .9, .25, 1);
}
.toast.is-out { animation: toast-out .22s ease-in forwards; }
.toast-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 9px; background: rgba(74, 222, 128, .16); color: #4ADE80; }
.toast-ic .i { width: 18px; height: 18px; stroke-width: 2.6; }
.toast-err .toast-ic { background: rgba(248, 113, 113, .18); color: #F87171; }
.toast-info .toast-ic { background: rgba(96, 165, 250, .18); color: #60A5FA; }
.toast button { margin-left: 4px; padding: 6px 10px; border: 0; border-radius: 9px; background: rgba(255, 255, 255, .14); color: #fff; font: 700 13px var(--font); cursor: pointer; }

/* Indikator ---------------------------------------------------------------------- */
.progress { position: fixed; top: 0; left: 0; z-index: 400; height: 3px; width: 0; background: #FFE14D; box-shadow: 0 0 8px rgba(255, 225, 77, .7); opacity: 0; transition: width .3s, opacity .3s; }
.progress.is-on { opacity: 1; width: 75%; transition: width 4s cubic-bezier(.1, .6, .2, 1); }
.ptr { position: fixed; top: calc(var(--safe-top) + 10px); left: 50%; z-index: 60; width: 42px; height: 42px; margin-left: -21px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--brand); box-shadow: var(--sh-2); transform: translateY(-80px); pointer-events: none; }
.ptr.is-loading .i { animation: spin .8s linear infinite; }
.netbar { position: fixed; top: calc(var(--safe-top) + 10px); left: 50%; z-index: 350; display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: #15211B; color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--sh-2); transform: translateX(-50%); }
.netbar .i { width: 18px; height: 18px; color: #FBBF24; }

/* Login ----------------------------------------------------------------------------- */
body.login { background: #fff; }
.login-hero {
  position: relative; overflow: hidden; color: #fff; padding: calc(var(--safe-top) + 34px) 24px 96px; text-align: center;
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, .22) 0, rgba(255, 255, 255, 0) 48%),
    linear-gradient(160deg, #00BA5C 0%, #00A04F 50%, #007F3F 100%);
}
.login-hero::after { content: ""; position: absolute; left: -70px; bottom: -110px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.login-logo { position: relative; z-index: 1; width: 96px; height: 96px; margin: 0 auto 14px; padding: 6px; border-radius: 30px; background: #fff; box-shadow: 0 12px 30px rgba(0, 60, 30, .3); }
.login-hero h1 { position: relative; z-index: 1; margin: 0; font-size: 24px; font-weight: 800; }
.login-hero p { position: relative; z-index: 1; margin: 6px auto 0; max-width: 300px; font-size: 14px; opacity: .9; }
.login-card { position: relative; z-index: 2; max-width: 420px; margin: -64px auto 0; padding: 24px 20px; border-radius: 28px; background: #fff; box-shadow: var(--sh-2); }
.login-wrap { padding: 0 16px 32px; }
.login-card h2 { margin: 0 0 4px; font-size: 20px; }
.login-card > p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.input-icon { position: relative; }
.input-icon > .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 20px; height: 20px; pointer-events: none; }
.input-icon .input { padding-left: 44px; }
.input-icon .pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.form-alert { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; padding: 12px 14px; border-radius: 14px; background: #FDECEC; color: #991B1B; font-size: 13.5px; font-weight: 500; }
.form-alert .i { width: 20px; height: 20px; color: #DC2626; }
.form-alert.is-info { background: #FFF5E1; color: #8A4B08; }
.form-alert.is-info .i { color: #D97706; }
/* Captcha login */
.captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-row .captcha-input { flex: 1; min-width: 0; text-align: center; font-size: 19px; font-weight: 800; letter-spacing: .32em; padding: 0 6px 0 calc(6px + .32em); }
.captcha-row .captcha-input::placeholder { font-size: 15px; font-weight: 500; letter-spacing: normal; }
.captcha-img { flex: none; width: 120px; height: 48px; padding: 0; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; background: #ECF8F1; cursor: pointer; transition: transform .12s; }
.captcha-img:active { transform: scale(.97); }
.captcha-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.captcha-row .captcha-refresh { width: 48px; height: 48px; border-radius: 14px; }
.captcha-refresh.is-spinning .i { animation: spin .7s linear infinite; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; color: var(--muted); font-size: 12.5px; }
.login-foot .i { width: 16px; height: 16px; color: var(--brand); }

/* Animasi ---------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes sheet-down { to { transform: translateY(105%); } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
.shake { animation: shake .4s; }
.fade-in { animation: fade-in .25s ease-out; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Tablet ------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .summary-4 { grid-template-columns: repeat(4, 1fr); }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); overflow: visible; margin: 0; padding: 0; }
  .kpi { flex: auto; }
}

@media (min-width: 768px) {
  dialog.sheet[open] { justify-content: center; align-items: center; padding: 24px; }
  .sheet-panel { max-width: 560px; max-height: 88vh; border-radius: 26px; padding-bottom: 0; animation: pop .22s ease-out; }
  .sheet-tall .sheet-panel { height: min(84vh, 760px); }
  dialog.sheet.is-closing .sheet-panel { animation: none; opacity: 0; transition: opacity .15s; }
  .sheet-handle { display: none; }
  .sheet-head { padding-top: 16px; }
  .chart-box { height: 280px; }
}

/* Desktop ------------------------------------------------------------------------ */
@media (min-width: 1024px) {
  :root { --maxw: 1120px; }
  .app { display: grid; grid-template-columns: 268px minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 18px 14px 14px;
    background: #fff; border-right: 1px solid var(--line); overflow-y: auto;
  }
  .side-brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 16px; color: var(--ink); text-decoration: none; }
  .side-brand img { width: 46px; height: 46px; border-radius: 14px; }
  .side-brand b { display: block; font-size: 16px; }
  .side-brand small { color: var(--muted); font-size: 12px; }
  .side-cta { margin-bottom: 8px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-group { margin: 16px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; transition: background .12s; }
  .side-link .i { width: 20px; height: 20px; }
  .side-link:hover { background: #F2F6F4; }
  .side-link.is-active { background: var(--brand-50); color: var(--brand-700); }
  .side-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 4px 0; border-top: 1px solid var(--line); }
  .side-user-name { flex: 1; min-width: 0; }
  .side-user-name b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-user-name small { color: var(--muted); font-size: 12px; }
  .avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 13px; background: var(--brand-50); color: var(--brand-700); font-weight: 800; font-size: 14px; }
  .tabbar { display: none; }
  .main { padding-bottom: 40px; min-width: 0; }
  body.no-tabbar .main { padding-bottom: 130px; }
  .page { padding: 24px 32px 16px; }
  .appbar-inner { min-height: 66px; padding: 0 24px 0 32px; }
  .appbar-tools { padding: 0 32px 14px; }
  .appbar-title h1 { font-size: 20px; }
  .fab { right: 32px; bottom: 28px; }
  .toasts, body.no-tabbar .toasts { bottom: 28px; padding-left: 268px; }
  .dock { left: 268px; padding-left: 32px; padding-right: 32px; }
  .hero { border-radius: 0 0 32px 32px; padding: 26px 32px 90px; }
  .wallet { padding: 0 32px; }
  .services { grid-template-columns: repeat(8, 1fr); }
  .home-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .home-grid > .section { margin-top: 24px; }
  .desk-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .desk-2 > .section { margin-top: 0; }
  .chips { margin: 0; padding: 2px 0; flex-wrap: wrap; overflow: visible; }
}

/* Cetak -------------------------------------------------------------------------- */
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body { background: #fff !important; font-size: 10pt; }
  .appbar, .tabbar, .sidebar, .fab, .dock, .toasts, .no-print, .netbar, .ptr, .progress, dialog { display: none !important; }
  .app { display: block; }
  .main { padding: 0 !important; }
  .page { max-width: none; padding: 0; }
  .print-only { display: block !important; }
}

/* ==========================================================================
   Komponen halaman (tambahan)
   ========================================================================== */
.mb-1 { margin-bottom: 8px; }
.page-home { max-width: none; padding: 0; }
.page-body { max-width: var(--maxw); margin: 0 auto; padding: 0 16px 8px; }
.row-compact { padding-top: 10px; padding-bottom: 10px; }
.row-compact .row-icon { width: 38px; height: 38px; border-radius: 12px; }
.row-compact .row-icon .i { width: 19px; height: 19px; }
.row-compact + .row-compact::before { left: 64px; }
.row-amount small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.row.is-today { background: #FFF7FB; }
.row-wrap { position: relative; display: flex; align-items: center; }
.row-wrap > .row { flex: 1; min-width: 0; }
.row-wrap > .row-action { margin-right: 10px; }
.row-wrap + .row-wrap::before { content: ""; position: absolute; top: 0; left: 68px; right: 0; height: 1px; background: var(--line-2); }
.row-action-green { color: var(--brand-700); background: var(--brand-50); }
.row-action-green:hover { background: var(--brand-100); }
h4 { margin: 0; font-size: 14.5px; font-weight: 700; }

/* Avatar & profil */
.avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 13px; background: var(--brand-50); color: var(--brand-700); font-weight: 800; font-size: 14px; }
.avatar-lg { width: 52px; height: 52px; border-radius: 17px; font-size: 18px; }
.profile-card { display: flex; align-items: center; gap: 14px; }
.profile-card b { display: block; font-size: 16px; }
.profile-card small { display: block; color: var(--muted); font-size: 12.5px; white-space: normal; }
.install-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 1.5px dashed var(--brand); border-radius: 20px; background: var(--brand-50); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.install-card b { display: block; font-size: 15px; color: var(--brand-ink); }
.install-card small { display: block; color: var(--brand-700); font-size: 12.5px; white-space: normal; }

/* Layanan varian */
.services-4 { grid-template-columns: repeat(4, 1fr); padding-top: 18px; }
.services-card { padding: 18px 6px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--sh-1); }

/* Panel warna lain */
.panel-red { background: linear-gradient(135deg, #F0524F 0%, #D7263D 60%, #B4122B 100%); box-shadow: 0 10px 24px rgba(200, 30, 50, .22); }
.panel-amber { background: linear-gradient(135deg, #F7B32B 0%, #EE8B12 60%, #D46B08 100%); box-shadow: 0 10px 24px rgba(220, 120, 10, .22); }
.panel-blue { background: linear-gradient(135deg, #3B82F6 0%, #2563EB 60%, #1E4FD1 100%); box-shadow: 0 10px 24px rgba(37, 99, 235, .22); }
.panel-sky { background: linear-gradient(135deg, #22B5EE 0%, #0896D6 60%, #0477B5 100%); box-shadow: 0 10px 24px rgba(8, 150, 214, .22); }
.panel-pink { background: linear-gradient(135deg, #F0599C 0%, #DB2777 60%, #B5175F 100%); box-shadow: 0 10px 24px rgba(219, 39, 119, .22); }
.panel-gray { background: linear-gradient(135deg, #8A9690 0%, #6B7771 60%, #535E58 100%); box-shadow: 0 10px 24px rgba(60, 70, 65, .2); }
.meter-light { background: rgba(255, 255, 255, .25); height: 8px; }
.meter-light > span { background: #fff; }

/* Strip aksi (chip tombol horizontal) */
.action-strip { display: flex; gap: 8px; margin: 12px -16px 0; padding: 2px 16px; overflow-x: auto; scrollbar-width: none; }
.action-strip::-webkit-scrollbar { display: none; }
.action-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px;
  border: 0; border-radius: 13px; background: #fff; color: var(--ink-2); box-shadow: var(--sh-1);
  font: 600 13.5px var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.action-chip .i { width: 18px; height: 18px; color: var(--brand); }
.action-chip:active { transform: scale(.97); }
.action-chip-green { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
.action-chip-green .i { color: #fff; }

/* Navigasi tanggal */
.day-nav { display: flex; align-items: center; gap: 8px; }
.day-nav .icon-btn { width: 44px; height: 44px; border-radius: 14px; }
.day-nav .icon-btn.is-disabled { visibility: hidden; }
.day-nav-label {
  position: relative; flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 14px; background: #fff; box-shadow: var(--sh-1); font-size: 14px; font-weight: 700; cursor: pointer;
}
.day-nav-label .i { width: 18px; height: 18px; color: var(--brand); }
.day-nav-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-nav-label input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.day-nav-label input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }

/* Filter rentang tanggal di app bar */
.range-form .input { height: 46px; border-color: transparent; background: #fff; box-shadow: 0 2px 8px rgba(0, 60, 30, .12); }
.range-form > .input { flex: 1; min-width: 0; padding: 0 10px; font-size: 14px; }
.range-form .search-box { flex: 1; min-width: 0; }
.range-form .input-date-sm { flex: 0 0 150px; }
.range-form .icon-btn { flex: none; color: #fff; }

/* Ringkasan sebagai tombol filter */
.sum-btn { border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.sum-btn:active { transform: scale(.98); }

/* Kontrol stok */
.row-stock .row-end { gap: 4px; }
.stock-moves { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.stock-moves b { font-weight: 700; }

/* Grafik laporan */
.chart-head { display: flex; justify-content: center; margin-bottom: 12px; }
.chart-head .seg { width: 100%; max-width: 360px; }
.chart-hint { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 0; font-size: 12px; color: var(--faint); }
.chart-hint .i { width: 15px; height: 15px; }
.mini-card[hidden] { display: none; }

/* STO */
.sto-row.flash { animation: row-flash 1.4s ease-out; }
@keyframes row-flash { 0%, 30% { background: #FFF3C4; } 100% { background: transparent; } }

/* Cetak checklist pembelian (A4) */
.print-sheet h2 { margin: 0 0 8px; font-size: 16pt; }
.print-head { width: 100%; margin-bottom: 10px; font-size: 10pt; border-collapse: collapse; }
.print-head td { padding: 2px 6px 2px 0; }
.print-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.print-table th, .print-table td { padding: 5px 6px; border: 1px solid #555; text-align: left; }
.print-table th { background: #EEE; }
.print-table .r { text-align: right; }
.print-table .check { width: 34px; text-align: center; font-size: 13pt; }
.print-foot { margin-top: 10px; font-size: 8.5pt; color: #555; }

@media (min-width: 1024px) {
  .page-home { padding: 0; }
  .page-body { padding: 0 32px 16px; }
  .action-strip { margin: 12px 0 0; padding: 2px 0; flex-wrap: wrap; overflow: visible; }
  .services-4 { grid-template-columns: repeat(4, 1fr); }
}
.kpi-value, .kpi-sub { display: block; }
.kpis { scroll-padding-inline: 16px; }
@media (min-width: 640px) { .kpis { scroll-padding-inline: 0; } }
.dock-total small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock .btn { padding: 0 18px; }
.sheet-foot .btn-danger { flex: 0 0 56px; padding: 0; }
.field-hint .i { width: 15px; height: 15px; vertical-align: -3px; margin-right: 2px; }
p.muted .i { width: 15px; height: 15px; vertical-align: -3px; }
