@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/pjs-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/pjs-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/pjs-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/pjs-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/pjs-800.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0c0e13;
  --surface: #14171f;
  --surface-2: #1a1e28;
  --surface-3: #222735;
  --line: #2a3040;
  --line-2: #3a4152;
  --ink: #eef1f7;
  --ink-soft: #c2c9d6;
  --muted: #8b93a3;
  --faint: #68707e;
  --accent: #c0392b;
  --accent-2: #e05243;
  --accent-ink: #f0a89e;
  --accent-soft: #2a1512;
  --accent-line: #5a2620;
  --accent-glow: rgba(192, 57, 43, 0.32);
  --on-accent: #fff;
  --st-ok: #2fbf82;
  --st-ok-bg: rgba(47, 191, 130, 0.12);
  --st-ok-line: rgba(47, 191, 130, 0.36);
  --st-warn: #e0a52e;
  --st-warn-bg: rgba(224, 165, 46, 0.12);
  --st-warn-line: rgba(224, 165, 46, 0.38);
  --st-bad: #e0483c;
  --st-bad-bg: rgba(224, 72, 60, 0.1);
  --st-bad-line: rgba(224, 72, 60, 0.38);
  --st-info: #5b8cff;
  --st-info-bg: rgba(91, 140, 255, 0.1);
  --st-info-line: rgba(91, 140, 255, 0.32);
  --r: 14px;
  --r-sm: 10px;
  --r-xs: 6px;
  --shadow: 0 1px 2px rgba(9, 5, 6, 0.5), 0 12px 30px rgba(9, 5, 6, 0.42);
  --shadow-pop: 0 8px 28px rgba(6, 3, 4, 0.6);
  --sidebar-w: 220px;
  --z-dropdown: 30;
  --z-sticky: 40;
  --z-backdrop: 60;
  --z-modal: 70;
  --z-toast: 80;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(920px 440px at 88% -10%, rgba(192, 57, 43, 0.1), transparent 60%),
    radial-gradient(680px 360px at 6% 2%, rgba(192, 57, 43, 0.05), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.navopen {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

table {
  border-spacing: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

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

.skip-link {
  position: absolute;
  top: -200%;
  left: 8px;
  z-index: 200;
  padding: 8px 18px;
  border-radius: var(--r-xs);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 150ms ease;
}

.skip-link:focus {
  top: 8px;
}

.shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Mobile shell is the default; desktop progressively restores the fixed rail. */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: var(--z-modal);
  display: flex;
  width: 264px;
  height: 100vh;
  height: 100dvh;
  flex: none;
  flex-direction: column;
  padding: 14px 10px;
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  transform: translateX(-100%);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.navopen .sidebar {
  transform: translateX(0);
}

.sbrand {
  display: flex;
  min-height: 52px;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 14px;
}

.sbrand img {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(192, 57, 43, 0.28);
}

.logo-word {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.1;
}

.logo-word b {
  overflow: hidden;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-word small {
  color: var(--accent-ink);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.snav {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
  overflow-y: auto;
  scrollbar-width: none;
}

.snav::-webkit-scrollbar {
  display: none;
}

.snav a {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  transition: color 150ms ease, background-color 150ms ease;
}

.snav a svg {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.7;
}

.snav a:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.snav a.on {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.snav a.on svg {
  opacity: 1;
}

.sfoot {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.savatar {
  display: flex;
  width: 32px;
  height: 32px;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
}

.sname {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sname small {
  display: block;
  overflow: hidden;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.logout-form {
  display: flex;
  flex: none;
}

.sout {
  display: flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 7px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.sout svg {
  width: 17px;
  height: 17px;
}

.sout:hover {
  background: var(--surface-3);
  color: var(--st-bad);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  display: block;
  padding: 0;
  border: 0;
  background: rgba(6, 3, 4, 0.62);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

body.navopen .scrim {
  opacity: 1;
  pointer-events: auto;
}

.bnav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-sticky);
  display: flex;
  min-height: 44px;
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  /* Opaque fill + upward shadow so the bar reads as anchored to the screen
     edge, not floating over content, as it scrolls underneath. */
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -6px rgba(0, 0, 0, 0.55);
}

.bnav a,
.bnav button {
  display: flex;
  min-width: 0;
  min-height: 44px;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 4px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.bnav a svg,
.bnav button svg {
  width: 21px;
  height: 21px;
}

.bnav a.on {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.main {
  width: 100%;
  min-width: 0;
  max-width: 1440px;
  flex: 1;
  padding: 0 14px calc(74px + env(safe-area-inset-bottom));
}

.mhead {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line);
}

.dashboard-head {
  align-items: center;
}

.title-stack {
  display: flex;
  min-width: 0;
  flex: 1 1 220px;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mtitle {
  min-width: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.ctx {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 12.5px;
}

.ctx b {
  color: var(--ink-soft);
  font-weight: 700;
}

.wilayah-form {
  flex: 0 1 180px;
}

.compact-select {
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 12.5px;
  font-weight: 700;
}

.month-switcher {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ms-btn {
  display: flex;
  width: 34px;
  height: 34px;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.ms-btn svg {
  width: 16px;
  height: 16px;
}

.ms-btn:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.ms-btn.disabled {
  cursor: default;
  opacity: 0.32;
}

.ms-label {
  overflow: hidden;
  padding: 0 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading-line {
  position: relative;
  height: 2px;
  margin: -12px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.loading-line::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: var(--accent-2);
  content: "";
  transform: translateX(-120%);
}

.htmx-indicator {
  opacity: 0;
  transition: opacity 150ms ease;
}

.htmx-request.htmx-indicator,
.htmx-request .htmx-indicator {
  opacity: 1;
}

.htmx-request.loading-line::after {
  animation: loading-sweep 900ms ease-in-out infinite;
}

@keyframes loading-sweep {
  to {
    transform: translateX(370%);
  }
}

.panel {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.panel-head h2 {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.panel-head p {
  max-width: 72ch;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.panel h3 {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 16px;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.45;
}

.notice.error {
  border-color: var(--st-bad-line);
  background: var(--st-bad-bg);
  color: #f6b6ae;
}

.notice.success {
  border-color: var(--st-ok-line);
  background: var(--st-ok-bg);
  color: #88dfbb;
}

.notice.warning {
  border-color: var(--st-warn-line);
  background: var(--st-warn-bg);
  color: #f1c86e;
}

.info-box {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid var(--st-info-line);
  border-radius: var(--r-sm);
  background: var(--st-info-bg);
  color: #a8c4ff;
  font-size: 13px;
  line-height: 1.45;
}

.info-box code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(91, 140, 255, 0.1);
  color: #c6d8ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.info-box > span {
  flex-basis: 100%;
  color: var(--ink-soft);
  font-size: 12px;
}

.fld {
  margin-bottom: 16px;
}

.fld label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="month"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  appearance: none;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px; /* ≥16px prevents iOS Safari auto-zoom on focus */
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238b93a3' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

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

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

input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.fhelp {
  margin: 5px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.fgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 16px;
}

.settings-form {
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 16px var(--accent-glow);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 150ms ease, transform 80ms ease;
}

.btn svg {
  flex: none;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-busy="true"] {
  cursor: not-allowed;
  filter: none;
  opacity: 0.4;
}

.btn.ghost {
  border: 1px solid var(--line-2);
  background: var(--surface-3);
  color: var(--ink-soft);
  box-shadow: none;
}

.btn.ghost:hover {
  border-color: var(--accent-2);
  color: var(--accent-ink);
  filter: none;
}

.btn.slim {
  min-height: 36px;
  padding: 8px 14px;
  box-shadow: none;
  font-size: 12.5px;
}

.btn.danger {
  border: 1px solid var(--st-bad-line);
  background: var(--st-bad-bg);
  color: var(--st-bad);
  box-shadow: none;
}

.btn.success {
  border: 1px solid var(--st-ok-line);
  background: var(--st-ok-bg);
  color: var(--st-ok);
  box-shadow: none;
}

.btn-block {
  width: 100%;
  min-height: 48px;
  padding: 13px 18px;
  font-size: 15px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.form-actions form {
  display: contents;
}

.state-card {
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink-soft);
  text-align: center;
  box-shadow: var(--shadow);
}

.state-card h2 {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 17px;
}

.state-card p {
  max-width: 60ch;
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 13px;
}

.state-card.error-state {
  border-color: var(--st-bad-line);
  background: var(--st-bad-bg);
}

.state-page {
  display: flex;
  min-height: calc(100dvh - 80px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}

.state-code {
  margin-bottom: 4px;
  color: var(--accent-ink);
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
}

.state-page h1 {
  margin-bottom: 8px;
  font-size: 21px;
  letter-spacing: -0.4px;
}

.state-page p {
  max-width: 55ch;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13.5px;
}

/* Dashboard */
.kpi-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.kpi {
  --kpi-color: var(--st-info);
  position: relative;
  min-width: 0;
  flex: 1 1 210px;
  overflow: hidden;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi::after {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--kpi-color);
  content: "";
  opacity: 0.18;
  pointer-events: none;
}

.kpi.ok {
  --kpi-color: var(--st-ok);
}

.kpi.warn {
  --kpi-color: var(--st-warn);
}

.kpi.bad {
  --kpi-color: var(--st-bad);
}

.kpi.neutral {
  --kpi-color: var(--st-info);
}

.kpi-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.kpi-val {
  position: relative;
  z-index: 1;
  margin-bottom: 4px;
  color: var(--kpi-color);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1;
}

.kpi.neutral .kpi-val {
  color: var(--ink);
}

.kpi-sub {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.kpi-sub b {
  color: var(--ink-soft);
  font-weight: 700;
}

.positive {
  color: var(--st-ok);
}

.metric-sep {
  padding: 0 2px;
  color: var(--faint);
}

.status-text {
  font-weight: 700;
}

.ok,
.pct-label.ok,
.status-text.ok {
  color: var(--st-ok);
}

.warn,
.pct-label.warn,
.status-text.warn {
  color: var(--st-warn);
}

.bad,
.pct-label.bad,
.status-text.bad {
  color: var(--st-bad);
}

.kpi-prog {
  height: 3px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.kpi-prog-fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: currentColor;
  transition: width 250ms ease;
}

.kpi-prog-fill.ok {
  background: var(--st-ok);
}

.kpi-prog-fill.warn {
  background: var(--st-warn);
}

.kpi-prog-fill.bad {
  background: var(--st-bad);
}

.kpi-prog-fill.info {
  background: var(--st-info);
}

.kpi-prog-fill.full {
  width: 100%;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.section-head h2 {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.1px;
}

.sh-sub {
  color: var(--muted);
  font-size: 12px;
}

.scroll-x {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  /* Tanpa paint containment, scrollable-overflow isi tabel (min-width 760px)
     bocor ke dokumen: halaman bisa digeser horizontal & Chrome Android
     zoom-out ("navbar melebar"). Terbukti via bisect 2026-07-17. */
  contain: paint;
}

.table-shell {
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.gtable {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 13px;
}

.gtable th,
.ptable th,
.utable th,
.htable th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.gtable th {
  padding: 11px 14px;
  background: var(--surface);
}

.gtable td,
.ptable td,
.utable td,
.htable td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.gtable td {
  padding: 13px 14px;
}

.gtable tbody tr,
.ptable tbody tr,
.utable tbody tr,
.htable tbody tr {
  transition: background-color 120ms ease;
}

.gtable tbody tr:hover,
.ptable tbody tr:hover,
.utable tbody tr:hover,
.htable tbody tr:hover {
  background: var(--surface-2);
}

.gtable tbody tr:last-child td,
.ptable tbody tr:last-child td,
.utable tbody tr:last-child td,
.htable tbody tr:last-child td {
  border-bottom: 0;
}

.g-name {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
}

.g-code {
  margin-top: 1px;
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.g-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-xs);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  transition: filter 150ms ease;
}

.g-link:hover {
  filter: brightness(1.12);
}

.g-link svg {
  width: 12px;
  height: 12px;
}

.kpi-cell {
  min-width: 130px;
}

.kpi-nums {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.tgt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.prog {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.prog-fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
}

.prog-fill.ok {
  background: var(--st-ok);
}

.prog-fill.warn {
  background: var(--st-warn);
}

.prog-fill.bad {
  background: var(--st-bad);
}

.pct-label {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.sbadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.sbadge.ok {
  border-color: var(--st-ok-line);
  background: var(--st-ok-bg);
  color: var(--st-ok);
}

.sbadge.warn {
  border-color: var(--st-warn-line);
  background: var(--st-warn-bg);
  color: var(--st-warn);
}

.sbadge.bad {
  border-color: var(--st-bad-line);
  background: var(--st-bad-bg);
  color: var(--st-bad);
}

.dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.empty-row td {
  padding: 0 !important;
}

.empty-inline {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-inline b {
  color: var(--ink-soft);
  font-size: 13px;
}

.empty-inline span {
  font-size: 12px;
}

.lboard {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lboard h2 {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.lboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.litem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.lrank {
  display: flex;
  width: 26px;
  height: 26px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lrank.r1 {
  border: 1.5px solid rgba(224, 165, 46, 0.4);
  background: rgba(224, 165, 46, 0.18);
  color: var(--st-warn);
}

.lrank.r2 {
  border: 1.5px solid var(--line-2);
  background: var(--surface-3);
  color: var(--ink-soft);
}

.lrank.r3 {
  border: 1.5px solid rgba(201, 125, 62, 0.3);
  background: rgba(224, 165, 46, 0.08);
  color: #c97d3e;
}

.lrank.r0 {
  border: 1px solid var(--line);
  background: var(--surface);
}

.lname {
  min-width: 0;
  flex: 1;
}

.lname b {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lname span {
  color: var(--faint);
  font-size: 11px;
}

.lscore {
  flex: none;
  text-align: right;
}

.lscore .pct {
  display: block;
  color: var(--st-ok);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.lscore .label {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

/* Outlet detail */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 18px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.breadcrumb a {
  color: var(--ink-soft);
  font-weight: 600;
  transition: color 150ms ease;
}

.breadcrumb a:hover {
  color: var(--accent-ink);
}

.sep {
  color: var(--faint);
}

.gerai-head {
  align-items: flex-start;
  padding-top: 12px;
}

.mhead-info {
  min-width: 0;
  flex: 1 1 280px;
}

.mhead-info h1 {
  margin-bottom: 4px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.meta {
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta svg {
  width: 13px;
  height: 13px;
}

.outlet-state {
  font-weight: 700;
}

.outlet-state.active {
  color: var(--st-ok);
}

.outlet-state.inactive {
  color: var(--st-bad);
}

.mhead-kpi {
  display: flex;
  width: 100%;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-chip {
  --chip-color: var(--ink);
  display: flex;
  min-width: 110px;
  flex: 1 1 110px;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-chip.ok {
  --chip-color: var(--st-ok);
}

.kpi-chip.warn {
  --chip-color: var(--st-warn);
}

.kpi-chip.bad {
  --chip-color: var(--st-bad);
}

.kpi-chip .label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.kpi-chip .val {
  color: var(--chip-color);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.05;
}

.kpi-chip .val.info {
  color: var(--st-info);
}

.kpi-chip .sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.chart-wrap {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.chart-heading h2 {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 800;
}

.chart-heading span {
  color: var(--muted);
  font-size: 11.5px;
}

.chartbox {
  width: 100%;
  height: 260px;
}

.chart-empty {
  display: none;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.chart-empty.is-visible {
  display: flex;
}

.info-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--line);
  box-shadow: var(--shadow);
}

.info-metrics article {
  padding: 14px 16px;
  background: var(--surface);
}

.info-metrics article span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.info-metrics article b {
  color: var(--ink);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.info-metrics > p {
  grid-column: 1 / -1;
  padding: 8px 12px;
  background: var(--surface-2);
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.history-panel {
  padding: 0;
  overflow: hidden;
}

.history-panel .panel-head {
  margin: 0;
  padding: 18px 20px 8px;
}

.htable {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

.htable .num {
  color: var(--ink);
  font-weight: 700;
}

.htable .pct {
  font-size: 12.5px;
  font-weight: 700;
}

.htable .pct.ok {
  color: var(--st-ok);
}

.htable .pct.warn {
  color: var(--st-warn);
}

.htable .pct.bad {
  color: var(--st-bad);
}

.htable .cur {
  background: var(--surface-2);
}

.month-cell {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

/* Admin */
.admin-head {
  margin-bottom: 18px;
}

.admin-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  margin-bottom: -1px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

.tab svg {
  width: 15px;
  height: 15px;
}

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

.tab.on {
  border-bottom-color: var(--accent-2);
  color: var(--ink);
}

.tab-panel {
  animation: tab-reveal 180ms ease-out;
}

@keyframes tab-reveal {
  from {
    opacity: 0.7;
    transform: translateY(2px);
  }
}

.dropzone {
  display: block;
  padding: 32px 20px;
  border: 2px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent-2);
  background: var(--accent-soft);
}

.dropzone.has-file {
  border-color: var(--st-ok-line);
  background: var(--st-ok-bg);
}

.dropzone.has-error {
  border-color: var(--st-bad-line);
  background: var(--st-bad-bg);
}

.dropzone svg {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  color: var(--muted);
}

.dz-title {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.dz-sub {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

.dz-ext {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 700;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.preview-box {
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.ph-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.ph-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ptable {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ptable th {
  background: var(--surface-2);
  font-size: 10px;
}

.invalid-row {
  background: var(--st-bad-bg);
}

.validation-ok {
  color: var(--st-ok);
  font-size: 11.5px;
  font-weight: 700;
}

.validation-error {
  display: inline-block;
  max-width: 34ch;
  color: #f6b6ae;
  font-size: 11.5px;
  font-weight: 600;
}

.muted {
  color: var(--muted) !important;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.strong {
  color: var(--ink) !important;
  font-weight: 700;
}

.cred-box {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--st-ok-line);
  border-radius: var(--r);
  background: var(--st-ok-bg);
}

.cred-box h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--st-ok);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.cred-box h3 svg {
  width: 15px;
  height: 15px;
}

.credential-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.cred-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cred-label {
  width: 90px;
  flex: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cred-val {
  min-width: 0;
  flex: 1;
  padding: 5px 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
}

.cred-warn {
  margin-top: 12px;
  color: var(--st-warn);
  font-size: 12px;
  font-weight: 600;
}

.compact-cred {
  margin: 0 0 18px;
}

.utable {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.uname {
  color: var(--ink);
  font-weight: 700;
}

.ucode {
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
}

.role-badge-sm {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.role-admin {
  background: var(--accent);
  color: var(--on-accent);
}

.role-am {
  border-color: var(--st-info-line);
  background: var(--st-info-bg);
  color: var(--st-info);
}

.role-as {
  border-color: var(--line-2);
  background: var(--surface-3);
  color: var(--muted);
}

.status-active {
  color: var(--st-ok);
  font-size: 11px;
  font-weight: 700;
}

.status-inactive {
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
}

.inactive-row {
  opacity: 0.62;
}

.scope-cell {
  max-width: 250px;
  font-size: 12.5px;
}

.rowactions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.setting-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.sc-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sc-val {
  color: var(--ink);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.sc-sub {
  margin-top: 3px;
  color: var(--faint);
  font-size: 12px;
}

.sdivider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.override-heading {
  margin-bottom: 14px;
}

.override-list {
  margin-top: 24px;
}

.override-list > h3 {
  margin-bottom: 10px;
}

.table-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

/* Authentication */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
}

.login-wrap {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
}

.login-box {
  width: 100%;
  max-width: 384px;
}

.login-box.password-box {
  max-width: 430px;
}

.lhead {
  margin-bottom: 26px;
  text-align: center;
}

.lhead.compact {
  margin-bottom: 20px;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.login-logo img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 6px 28px rgba(192, 57, 43, 0.36);
}

.lhead h1 {
  margin-bottom: 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.lhead p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.badge-ultra,
.badge-program {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.badge-ultra {
  margin-top: 10px;
}

.login-panel {
  padding: 22px;
}

.login-panel .fld:last-of-type {
  margin-bottom: 22px;
}

.auth-info {
  display: block;
  margin-bottom: 18px;
}

.hint {
  margin-top: 14px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.foot {
  margin-top: 22px;
  color: var(--faint);
  font-size: 11.5px;
  text-align: center;
}

/* Kasir wireframe */
.kasir-page {
  background: var(--bg);
}

.wf-banner {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--st-warn-line);
  background: var(--st-warn-bg);
  color: var(--st-warn);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1px;
  text-align: center;
}

.wf-banner svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.kasir-wrap {
  display: flex;
  width: 100%;
  max-width: 460px;
  min-height: calc(100dvh - 44px);
  flex-direction: column;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
}

.kasir-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.kasir-header img {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(192, 57, 43, 0.28);
}

.kasir-header-info {
  min-width: 0;
  flex: 1;
}

.kasir-header-info .brand {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.1px;
}

.kasir-header-info .gerai {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kasir-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px 16px 0;
}

.demo-switch {
  display: flex;
  align-self: flex-end;
  gap: 3px;
  margin-bottom: 16px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.dtoggle {
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.dtoggle:hover {
  color: var(--ink-soft);
}

.dtoggle.on {
  border-color: var(--line-2);
  background: var(--surface-2);
  color: var(--ink);
}

.input-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.phone-display {
  position: relative;
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  transition: border-color 150ms ease;
}

.phone-display.has-input {
  padding-right: 66px;
  border-color: var(--accent-2);
}

.prefix {
  flex: none;
  color: var(--muted);
  font-size: 21px;
  font-weight: 700;
}

.number {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--ink);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.number.placeholder {
  color: var(--faint);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
}

.cursor {
  width: 2px;
  height: 30px;
  flex: none;
  border-radius: 1px;
  background: var(--accent-2);
  animation: cursor-blink 900ms step-end infinite;
}

@keyframes cursor-blink {
  50% {
    opacity: 0;
  }
}

.clear-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  display: none;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(-50%);
}

.phone-display.has-input .clear-btn {
  display: block;
}

.result-card {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: result-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result-card.found {
  border-color: var(--st-ok-line);
  background: rgba(47, 191, 130, 0.05);
}

.result-card.not-found {
  border-color: var(--st-warn-line);
  background: var(--st-warn-bg);
}

.member-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.member-avatar {
  display: flex;
  width: 52px;
  height: 52px;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent-line);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 20px;
  font-weight: 800;
}

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

.member-name {
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.member-masked {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: 0.5px;
}

.member-joined {
  margin-top: 3px;
  color: var(--faint);
  font-size: 11.5px;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 3px 12px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.tier-gold {
  border-color: var(--st-warn-line);
  background: rgba(224, 165, 46, 0.14);
  color: var(--st-warn);
}

.poin-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.poin-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.poin-val {
  color: var(--st-ok);
  font-size: 40px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1;
}

.poin-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.poin-sub {
  margin-top: 5px;
  color: var(--faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.not-found-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  text-align: center;
}

.nf-icon {
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border: 1px solid var(--st-warn-line);
  border-radius: 50%;
  background: var(--st-warn-bg);
  color: var(--st-warn);
}

.nf-icon svg {
  width: 22px;
  height: 22px;
}

.not-found-body h2 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.not-found-body p {
  max-width: 34ch;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.not-found-body .nf-help {
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.key {
  display: flex;
  min-height: 68px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation; /* eliminate 300ms tap delay on mobile */
  transition: background-color 100ms ease, border-color 100ms ease, transform 80ms ease;
}

.key:hover {
  border-color: var(--muted);
}

.key:active,
.key.pressed {
  border-color: var(--accent-2);
  background: var(--surface-3);
  transform: scale(0.96);
}

.knum {
  color: var(--ink);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
}

.kabc {
  min-height: 14px;
  margin-top: 2px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.key.back {
  border-color: var(--line);
  background: var(--surface-2);
}

.key.back svg {
  width: 24px;
  height: 24px;
  color: var(--ink-soft);
}

.key.zero .knum {
  font-size: 26px;
}

.key.search {
  border-color: transparent;
  background: var(--accent);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.key.search svg {
  width: 26px;
  height: 26px;
  color: var(--on-accent);
}

.kasir-note {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
}

.kasir-note code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
}

/* Kasir live lookup result */
.kasir-result-zone {
  min-height: 4px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.source-live {
  border: 1px solid var(--st-ok-line);
  background: rgba(47, 191, 130, 0.12);
  color: var(--st-ok);
}

.source-snapshot {
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--muted);
}

.source-not_found {
  display: none;
}

.member-id {
  margin-top: 2px;
  overflow: hidden;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-silver {
  border-color: var(--line-2);
  background: var(--surface-2);
  color: var(--ink-soft);
}

.tier-bronze {
  border-color: rgba(180, 120, 60, 0.4);
  background: rgba(180, 120, 60, 0.08);
  color: var(--st-warn);
}

.tier-no-tier {
  border-color: var(--line);
  background: transparent;
  color: var(--faint);
}

.nf-error {
  color: var(--st-bad);
  font-size: 13px;
  font-weight: 600;
}

.trx-list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.trx-heading {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.trx-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

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

.trx-date {
  flex: none;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trx-desc {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trx-point {
  flex: none;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.trx-add {
  color: var(--st-ok);
}

.trx-deduct {
  color: var(--st-bad);
}

.trx-type-add,
.trx-type-deduct,
.trx-type-unknown {
  /* Selectors for dynamic trx-type-* class; visual handled by trx-add/trx-deduct. */
}

/* Kasir result entrance */
@keyframes result-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Skeleton shimmer — shown via htmx-indicator while kasir lookup is in flight */
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.kasir-skeleton {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.skel-member {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.skel-avatar {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-3);
}

.skel-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
}

.skel-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--surface-2) 0%,
    var(--surface-3) 40%,
    var(--surface-2) 80%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skel-short {
  width: 50%;
}

.skel-tall {
  height: 20px;
  width: 55%;
  margin-bottom: 10px;
}

@media (min-width: 520px) {
  .panel {
    padding: 22px;
  }

  .tab {
    padding-right: 16px;
    padding-left: 16px;
    font-size: 13.5px;
  }

  .phone-display .number {
    font-size: 28px;
    letter-spacing: 2px;
  }
}

@media (min-width: 701px) {
  .fgrid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 761px) {
  body.navopen {
    overflow: auto;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    width: var(--sidebar-w);
    box-shadow: none;
    transform: none;
  }

  .scrim,
  .bnav {
    display: none;
  }

  .main {
    width: auto;
    padding: 0 24px 60px;
  }

  .mhead {
    padding-top: 22px;
    padding-bottom: 16px;
  }

  .ctx {
    padding-left: 14px;
    border-left: 1px solid var(--line-2);
  }

  .panel {
    padding: 22px;
  }

  .mhead-kpi {
    width: auto;
  }

  .kpi-chip {
    flex: 0 1 auto;
    padding-right: 16px;
    padding-left: 16px;
  }

  .chartbox {
    height: 290px;
  }
}

@media (min-width: 901px) {
  .chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 440px) {
  .month-switcher {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .ms-label {
    flex: 1;
    text-align: center;
  }

  .litem {
    gap: 9px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .lscore .pct {
    font-size: 14px;
  }

  .badge-program {
    max-width: 82px;
    justify-content: center;
    font-size: 8.5px;
    line-height: 1.2;
    text-align: center;
  }

  .dtoggle {
    padding-right: 8px;
    padding-left: 8px;
  }

  .number,
  .phone-display .number {
    font-size: 22px;
    letter-spacing: 0.5px;
  }

  .number.placeholder,
  .phone-display .number.placeholder {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Halaman TIDAK boleh bisa digeser horizontal — semua konten lebar
   (tabel gerai dll.) scroll di container .scroll-x masing-masing.
   `clip` dipakai agar tidak menciptakan scroll-container (sticky aman);
   `hidden` adalah fallback untuk browser lama. */
html {
  overflow-x: hidden;
  overflow-x: clip;
}

/* Kasir — detail profil member di kartu hasil */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 14px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pg-item dt {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pg-item dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.pg-break {
  overflow-wrap: anywhere;
}

.pg-wide {
  grid-column: 1 / -1;
}
