/* =====================================================================
   SyncApp — tema UI mobile-first
   Palet resmi: Primary #1565C0 · Deep #0D47A1 · Sky #42A5F5 · Light #EAF4FF
   ===================================================================== */
:root {
  --c-primary: #1565C0;
  --c-deep: #0D47A1;
  --c-sky: #42A5F5;
  --c-light: #EAF4FF;
  --c-white: #FFFFFF;
  --c-bg: #F5F8FC;
  --c-success: #16A34A;
  --c-success-ink: #15803D;   /* teks hijau kontras >= 4.5:1 */
  --c-success-bg: #EAF8EF;
  --c-warning: #F59E0B;
  --c-warning-ink: #92400E;   /* teks kuning kontras >= 4.5:1 */
  --c-warning-bg: #FFF7E6;
  --c-error: #DC2626;
  --c-error-bg: #FDECEC;
  --c-text: #1E293B;
  --c-muted: #64748B;
  --c-border: #DCE6F2;
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(13, 71, 161, .06), 0 2px 8px rgba(13, 71, 161, .06);
  --shadow: 0 2px 6px rgba(13, 71, 161, .06), 0 10px 28px rgba(13, 71, 161, .09);
  --grad-header: linear-gradient(120deg, #0D47A1 0%, #1565C0 55%, #42A5F5 130%);
  --tap: 48px;
  --header-h: 104px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  /* Selaraskan variabel Bootstrap dengan palet */
  --bs-primary: #1565C0;
  --bs-primary-rgb: 21, 101, 192;
  --bs-success: #16A34A;
  --bs-success-rgb: 22, 163, 74;
  --bs-warning: #F59E0B;
  --bs-warning-rgb: 245, 158, 11;
  --bs-danger: #DC2626;
  --bs-danger-rgb: 220, 38, 38;
  --bs-body-bg: #F5F8FC;
  --bs-body-color: #1E293B;
  --bs-secondary-color: #64748B;
  --bs-border-color: #DCE6F2;
  --bs-link-color: #1565C0;
  --bs-link-color-rgb: 21, 101, 192;
  --bs-link-hover-color: #0D47A1;
  --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --bs-border-radius: 12px;
  --bs-border-radius-lg: 14px;
  --bs-focus-ring-color: rgba(21, 101, 192, .3);
}

[hidden] { display: none !important; }  /* atribut hidden harus menang atas display komponen */

html { -webkit-text-size-adjust: 100%; }
body.app {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: calc(24px + var(--safe-b));
}
body.app.has-bottom-nav { padding-bottom: calc(var(--nav-h) + 24px + var(--safe-b)); }
body.keyboard-open.has-bottom-nav { padding-bottom: calc(24px + var(--safe-b)); }
img { max-width: 100%; }
a { text-underline-offset: 2px; }
:focus-visible { outline: 3px solid rgba(21, 101, 192, .45); outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 2000;
  background: var(--c-deep); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none;
}
.skip-link:focus { top: calc(8px + var(--safe-t)); }

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

/* ------------------------------------------------------------- Tombol */
.btn { min-height: var(--tap); border-radius: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .55rem 1.1rem; }
.btn-sm { min-height: 38px; padding: .3rem .8rem; font-size: .9rem; }
.btn-lg { min-height: 54px; font-size: 1.05rem; border-radius: 14px; }
.btn-primary {
  --bs-btn-bg: var(--c-primary); --bs-btn-border-color: var(--c-primary);
  --bs-btn-hover-bg: var(--c-deep); --bs-btn-hover-border-color: var(--c-deep);
  --bs-btn-active-bg: #0A3A85; --bs-btn-active-border-color: #0A3A85;
  --bs-btn-disabled-bg: #9DB9DD; --bs-btn-disabled-border-color: #9DB9DD; --bs-btn-disabled-opacity: 1;
  box-shadow: 0 6px 16px rgba(21, 101, 192, .22);
}
.btn-primary:disabled { box-shadow: none; color: #fff; }
.btn-outline-primary {
  --bs-btn-color: var(--c-primary); --bs-btn-border-color: #B9D3F2;
  --bs-btn-hover-bg: var(--c-light); --bs-btn-hover-color: var(--c-deep); --bs-btn-hover-border-color: var(--c-primary);
  --bs-btn-active-bg: #D6E8FF; --bs-btn-active-color: var(--c-deep); --bs-btn-active-border-color: var(--c-primary);
  background: #fff;
}
.btn-success {
  --bs-btn-bg: var(--c-success); --bs-btn-border-color: var(--c-success);
  --bs-btn-hover-bg: var(--c-success-ink); --bs-btn-hover-border-color: var(--c-success-ink);
  --bs-btn-disabled-bg: #A7D7B8; --bs-btn-disabled-border-color: #A7D7B8; --bs-btn-disabled-opacity: 1;
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--c-border); --bs-btn-hover-bg: var(--c-light); --bs-btn-hover-border-color: #B9D3F2; }
.btn-link-plain { background: none; border: 0; padding: 0; min-height: 0; color: var(--c-primary); font-weight: 600; }
.btn-icon {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .14); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.btn-icon:hover { background: rgba(255, 255, 255, .24); }

/* ------------------------------------------------------------- Header */
.app-header {
  position: sticky; top: 0; z-index: 1030;
  background: var(--grad-header); color: #fff;
  padding-top: var(--safe-t);
  box-shadow: 0 4px 18px rgba(13, 71, 161, .25);
}
.app-header__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  max-width: 1180px; margin: 0 auto; padding: 10px 16px 6px;
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand__logo {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; background: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(0, 0, 0, .15);
}
.brand__logo img { width: 38px; height: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name { font-size: 1.2rem; letter-spacing: .01em; }
.brand__sub { font-size: .78rem; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-status { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.status-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px;
  border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); color: #fff;
}
.status-chip i { font-size: .95rem; }
.status-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #CBD5E1; flex: 0 0 8px; }
.status-chip[data-state="online"]::before, .status-chip[data-state="ok"]::before { background: #4ADE80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.status-chip[data-state="offline"], .status-chip[data-state="mati"], .status-chip[data-state="ditolak"] { background: #B91C1C; border-color: #FCA5A5; }
.status-chip[data-state="offline"]::before, .status-chip[data-state="mati"]::before, .status-chip[data-state="ditolak"]::before { background: #FECACA; }
.status-chip[data-state="mencari"]::before, .status-chip[data-state="lemah"]::before, .status-chip[data-state="lambat"]::before { background: #FCD34D; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.app-header__user {
  display: flex; align-items: center; gap: 8px; max-width: 1180px; margin: 0 auto;
  padding: 2px 16px 10px; font-size: .88rem; color: rgba(255, 255, 255, .95); min-width: 0;
}
.demo-pill { margin-left: auto; background: #FDE68A; color: #78350F; font-weight: 800; font-size: .72rem; letter-spacing: .08em; border-radius: 999px; padding: 2px 8px; }
.secure-warning { background: #FEF3C7; color: var(--c-warning-ink); font-size: .85rem; padding: 8px 16px; display: flex; gap: 8px; align-items: center; }

@media (max-width: 419.98px) {
  .status-chip { padding: 0 8px; }
  .status-chip__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .brand__sub { display: none; }
}
@media (max-width: 339.98px) {
  .status-chip i { display: none; }
}

/* ------------------------------------------------------------- Konten */
.app-main {
  max-width: 760px; margin: 0 auto; padding: 16px;
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
  outline: none;
}
.app-main--wide { max-width: 1180px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.page-title { font-size: 1.35rem; font-weight: 800; margin: 0; color: var(--c-deep); }
.page-sub { color: var(--c-muted); margin: 2px 0 0; font-size: .95rem; }

.card-soft {
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 16px;
}
.form-label { font-weight: 650; font-size: .95rem; margin-bottom: 6px; color: var(--c-text); }
.req { color: var(--c-error); margin-left: 2px; }
.form-control, .form-select {
  min-height: var(--tap); border-radius: 12px; border-color: #C9D8EA; font-size: 1rem; color: var(--c-text);
}
.form-control:focus, .form-select:focus { border-color: var(--c-primary); box-shadow: 0 0 0 .22rem rgba(21, 101, 192, .18); }
.form-control.is-valid { border-color: var(--c-success); }
.form-text { color: var(--c-muted); font-size: .86rem; }
.input-group > .btn { min-width: 56px; }
.input-icon { position: relative; }
.input-icon > .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--c-muted); pointer-events: none; }
.input-icon > .form-control { padding-left: 42px; }

.alert { border-radius: 14px; border-width: 1px; font-size: .95rem; }
.alert .bi { font-size: 1.15rem; line-height: 1.3; flex: 0 0 auto; }
.alert-danger { background: var(--c-error-bg); border-color: #F7C1C1; color: #991B1B; }
.alert-warning { background: var(--c-warning-bg); border-color: #FCD99A; color: var(--c-warning-ink); }
.alert-success { background: var(--c-success-bg); border-color: #B5E3C5; color: #14532D; }
.alert-info { background: var(--c-light); border-color: #C3DCF8; color: #0B3A82; }

/* ------------------------------------------------------------ Stepper */
.stepper {
  position: sticky; top: var(--header-h); z-index: 1020;
  margin: -16px -16px 14px; padding: 12px 16px 8px;
  background: rgba(245, 248, 252, .94); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--c-border);
}
.stepper__track { position: relative; --dot-half: 20px; }
.stepper__track::before {
  content: ""; position: absolute; left: calc(100% / 12); right: calc(100% / 12); top: 19px; height: 3px; background: #D5E2F1; border-radius: 3px;
}
.stepper__bar { position: absolute; left: calc(100% / 12); top: 19px; height: 3px; background: var(--c-success); border-radius: 3px; width: 0; transition: width .35s ease; z-index: 0; }
.stepper__list { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; position: relative; z-index: 1; }
.side-title { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); margin: 0 0 8px; }
.stepper__item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1 1 0; min-width: 0; }
.stepper__dot {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid #C7D6E8; background: #fff; color: var(--c-muted);
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem; padding: 0; position: relative; z-index: 1;
  transition: all .2s ease;
}
.stepper__dot:disabled { cursor: default; }
.stepper__check { display: none; }
.stepper__item.is-done .stepper__dot { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.stepper__item.is-done .stepper__icon { display: none; }
.stepper__item.is-done .stepper__check { display: inline; font-size: 1.3rem; }
.stepper__item.is-active .stepper__dot { background: var(--c-primary); border-color: var(--c-primary); color: #fff; box-shadow: 0 0 0 5px rgba(21, 101, 192, .18); }
.stepper__label { font-size: .74rem; font-weight: 600; color: var(--c-muted); text-align: center; line-height: 1.15; display: none; }
.stepper__item.is-active .stepper__label { color: var(--c-primary); }
.stepper__item.is-done .stepper__label { color: var(--c-success-ink); }
.stepper__caption { margin: 8px 0 0; text-align: center; font-size: .9rem; font-weight: 600; color: var(--c-deep); }
.stepper__caption span { color: var(--c-muted); font-weight: 500; }
@media (min-width: 576px) {
  .stepper__label { display: block; }
  .stepper__caption { display: none; }
}

/* --------------------------------------------------------- Kartu tahap */
.wizard-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.step-card {
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  overflow: hidden; scroll-margin-top: calc(var(--header-h) + 96px); transition: box-shadow .2s ease, border-color .2s ease;
}
.step-card + .step-card { margin-top: 16px; }
.step-card.is-current { border-color: #9CC2EE; box-shadow: var(--shadow); }
.step-card.is-done { border-color: #BFE5CC; }
.step-card__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.step-card.is-current .step-card__head { background: linear-gradient(90deg, var(--c-light), #fff 75%); }
.step-card__icon {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px; background: var(--c-light); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.step-card.is-done .step-card__icon { background: var(--c-success-bg); color: var(--c-success-ink); }
.step-card.is-locked .step-card__icon { background: #EEF2F7; color: #94A3B8; }
.step-card__titles { min-width: 0; flex: 1; }
.step-card__eyebrow { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); }
.step-card__title { margin: 0; font-size: 1.08rem; font-weight: 750; color: var(--c-text); outline: none; }
.step-card__body { padding: 4px 16px 18px; }
.step-card__lock { padding: 0 16px 14px 72px; margin-top: -6px; color: var(--c-muted); font-size: .88rem; display: flex; gap: 6px; align-items: center; }
.step-card.is-locked .step-card__title { color: #64748B; }
.hint { color: var(--c-muted); font-size: .9rem; margin: 0 0 12px; display: flex; gap: 8px; }
.hint .bi { color: var(--c-sky); flex: 0 0 auto; }

.step-badge {
  flex: 0 0 auto; font-size: .76rem; font-weight: 700; border-radius: 999px; padding: 4px 10px; display: inline-flex; gap: 4px; align-items: center;
  background: #FFF1F1; color: #B91C1C; border: 1px solid #F8CACA;
}
.step-badge[data-state="done"] { background: var(--c-success-bg); color: var(--c-success-ink); border-color: #B5E3C5; }
.step-badge[data-state="locked"] { background: #F1F5F9; color: #64748B; border-color: #E2E8F0; }
.step-badge[data-state="active"] { background: var(--c-light); color: var(--c-deep); border-color: #BBD6F6; }

/* ----------------------------------------------- Hasil pencarian pelanggan */
.customer-card { margin-top: 14px; border-radius: var(--radius); border: 1px solid #C3DCF8; background: linear-gradient(180deg, #F3F9FF, #fff); overflow: hidden; }
.customer-card__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--c-light); }
.customer-card__avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--c-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex: 0 0 40px; }
.customer-card__name { font-weight: 750; font-size: 1.02rem; margin: 0; line-height: 1.25; word-break: break-word; }
.customer-card__ns { font-size: .85rem; color: var(--c-muted); margin: 0; }
.data-list { margin: 0; padding: 4px 14px 10px; display: grid; grid-template-columns: minmax(0, 1fr); }
.data-list > div { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px dashed #DCE6F2; }
.data-list > div:last-child { border-bottom: 0; }
.data-list dt { font-weight: 600; color: var(--c-muted); font-size: .88rem; }
.data-list dd { margin: 0; font-weight: 600; word-break: break-word; }
.status-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.status-pill--ok { background: var(--c-success-bg); color: var(--c-success-ink); }
.status-pill--bad { background: var(--c-error-bg); color: #B91C1C; }
.status-pill--demo { background: #FEF3C7; color: #78350F; }
.source-note { font-size: .8rem; color: var(--c-muted); padding: 0 14px 12px; margin: 0; display: flex; gap: 6px; }
.demo-ribbon { background: repeating-linear-gradient(45deg, #FEF3C7, #FEF3C7 10px, #FDE68A 10px, #FDE68A 20px); color: #78350F; font-weight: 800; font-size: .78rem; letter-spacing: .06em; text-align: center; padding: 4px; }

.skeleton { position: relative; overflow: hidden; background: #E8EFF8; border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton-card { margin-top: 14px; padding: 14px; border: 1px solid var(--c-border); border-radius: var(--radius); display: grid; gap: 10px; }
.skeleton-line { height: 14px; }

/* ------------------------------------------------------------- Lokasi */
.coord-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 4px 0 12px; }
.coord-box { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.coord-box__label { font-size: .76rem; font-weight: 700; color: var(--c-muted); text-transform: uppercase; letter-spacing: .04em; }
.coord-box__value { font-size: 1rem; font-weight: 750; font-variant-numeric: tabular-nums; word-break: break-all; }
.coord-box--ok { background: var(--c-success-bg); border-color: #B5E3C5; }
.coord-box--warn { background: var(--c-warning-bg); border-color: #FCD99A; }
.map-box { position: relative; isolation: isolate; z-index: 0; height: 220px; border-radius: 14px; overflow: hidden; border: 1px solid var(--c-border); background: #E8EFF8; }
@media (min-width: 768px) { .map-box { height: 280px; } }
.gps-progress { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--c-light); border: 1px solid #C3DCF8; margin-bottom: 12px; }
.gps-progress__radar { width: 40px; height: 40px; border-radius: 50%; background: var(--c-primary); position: relative; flex: 0 0 40px; display: flex; align-items: center; justify-content: center; color: #fff; }
.gps-progress__radar::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid rgba(21, 101, 192, .35); animation: radar 1.4s ease-out infinite; }
@keyframes radar { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.gps-progress__text { font-size: .92rem; line-height: 1.35; }
.gps-progress__text strong { display: block; color: var(--c-deep); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn { flex: 1 1 180px; }
.link-external { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; text-decoration: none; padding: 10px 0; }

/* ------------------------------------------------------------- Kamera */
.camera__stage {
  --ratio: 4 / 3;
  position: relative; width: 100%; border-radius: 16px; overflow: hidden;
  background: #0B1B33; margin: 0 auto 12px;
}
.camera__stage.is-live, .camera__stage.has-photo {
  aspect-ratio: var(--ratio);
  width: min(100%, calc(64vh * var(--ratio-num, 1.333)));
  width: min(100%, calc(64dvh * var(--ratio-num, 1.333)));
}
.camera__placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px;
  padding: 26px 16px; min-height: 210px; color: var(--c-deep);
  background: radial-gradient(circle at 50% 35%, #fff 0, var(--c-light) 70%); border: 2px dashed #A9C9EE; border-radius: 16px;
}
.camera__placeholder-icon { width: 76px; height: 76px; border-radius: 22px; background: linear-gradient(140deg, var(--c-primary), var(--c-sky)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; box-shadow: 0 10px 22px rgba(21, 101, 192, .3); }
.camera__placeholder p { margin: 0; font-weight: 650; }
.camera__placeholder small { color: var(--c-muted); }
.camera__stage video, .camera__stage .camera__preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0B1B33; }
.camera__guide { position: absolute; inset: 0; pointer-events: none; }
.camera__frame { position: absolute; left: 14%; right: 14%; top: 8%; bottom: calc(var(--wm-h, 24%) + 5%); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(3, 12, 28, .28); }
.camera__frame::before, .camera__frame::after { content: ""; position: absolute; width: 34px; height: 34px; border: 4px solid #fff; }
.camera__frame::before { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 16px; }
.camera__frame::after { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 16px; }
.camera__guide-text { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: rgba(3, 12, 28, .62); color: #fff; font-size: .8rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.camera__wm-zone { position: absolute; left: 0; right: 0; bottom: 0; height: var(--wm-h, 24%); background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .08) 8px, rgba(255, 255, 255, .02) 8px, rgba(255, 255, 255, .02) 16px); border-top: 2px dashed rgba(255, 255, 255, .55); display: flex; align-items: center; justify-content: center; }
.camera__wm-zone span { color: #fff; font-size: .76rem; font-weight: 700; background: rgba(3, 12, 28, .55); padding: 3px 10px; border-radius: 999px; }
.camera__busy { position: absolute; inset: 0; background: rgba(6, 22, 48, .72); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 16px; z-index: 3; }
.camera__live-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 12px; }
.camera__live-controls .btn:last-child { justify-self: end; }
.camera__live-controls .btn:first-child { justify-self: start; }
.camera__shutter {
  width: 76px; height: 76px; border-radius: 50%; border: 5px solid var(--c-primary); background: #fff; position: relative;
  box-shadow: 0 6px 18px rgba(21, 101, 192, .35); padding: 0;
}
.camera__shutter::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: linear-gradient(140deg, var(--c-primary), var(--c-sky)); transition: transform .12s ease; }
.camera__shutter:active::after { transform: scale(.86); }
.camera__shutter:disabled { opacity: .5; }
.camera__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.meta-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--c-bg); border: 1px solid var(--c-border); font-size: .84rem; font-weight: 600; }
.meta-chip--ok { background: var(--c-success-bg); border-color: #B5E3C5; color: var(--c-success-ink); }
.meta-chip--warn { background: var(--c-warning-bg); border-color: #FCD99A; color: var(--c-warning-ink); }
.meta-chip--bad { background: var(--c-error-bg); border-color: #F7C1C1; color: #B91C1C; }
.camera__actions { display: grid; gap: 10px; }
.tips { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.tips li { display: flex; gap: 8px; align-items: flex-start; }
.tips .bi { color: var(--c-primary); margin-top: 2px; }

/* ----------------------------------------------------------- Ringkasan */
.summary-grid { display: grid; gap: 12px; }
.summary-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.summary-photo { border: 1px solid var(--c-border); border-radius: 12px; overflow: hidden; background: #fff; }
.summary-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #0B1B33; }
.summary-photo figcaption { padding: 8px 10px; font-size: .82rem; font-weight: 600; display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--c-bg); border: 1px solid var(--c-border); font-weight: 600; font-size: .93rem; }
.checklist li .bi { font-size: 1.2rem; color: #94A3B8; }
.checklist li.is-ok { background: var(--c-success-bg); border-color: #B5E3C5; color: #14532D; }
.checklist li.is-ok .bi { color: var(--c-success); }
.checklist li .checklist__state { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--c-muted); }
.checklist li.is-ok .checklist__state { color: var(--c-success-ink); }
.attest { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid #C3DCF8; background: var(--c-light); }
.attest .form-check-input { width: 1.5em; height: 1.5em; margin-top: 0; flex: 0 0 auto; }
.attest label { font-size: .92rem; font-weight: 600; }
.save-bar { position: sticky; bottom: calc(var(--nav-h) + 8px + var(--safe-b)); z-index: 5; padding-top: 6px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 30%); }
body.keyboard-open .save-bar { bottom: 8px; }

/* -------------------------------------------------------------- Sukses */
.success-panel { text-align: center; padding: 28px 18px; }
.success-icon { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; background: var(--c-success); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 3.2rem; box-shadow: 0 0 0 10px var(--c-success-bg), 0 14px 30px rgba(22, 163, 74, .35); animation: pop .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-title { font-size: 1.35rem; font-weight: 800; color: #14532D; margin: 0 0 6px; }
.success-time { color: var(--c-text); margin: 0 0 16px; font-weight: 600; }
.ref-box { display: inline-flex; flex-direction: column; gap: 2px; padding: 12px 18px; border-radius: 14px; background: var(--c-light); border: 1px dashed #8DB8EA; margin-bottom: 18px; }
.ref-box small { color: var(--c-muted); font-weight: 600; }
.ref-box strong { font-size: 1.25rem; letter-spacing: .06em; color: var(--c-deep); font-variant-numeric: tabular-nums; }
.success-actions { display: grid; gap: 10px; max-width: 420px; margin: 0 auto; }

/* ---------------------------------------------------------- Panel sisi */
.side-panel { display: none; }
@media (min-width: 992px) {
  .app-main--wizard { max-width: 1180px; }
  .wizard-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
  .side-panel { display: block; position: sticky; top: calc(var(--header-h) + 92px); }
  .stepper { margin-left: 0; margin-right: 0; border-radius: 0 0 16px 16px; }
}

/* --------------------------------------------------------- Bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  display: flex; justify-content: center; gap: 4px;
  background: #fff; border-top: 1px solid var(--c-border); box-shadow: 0 -6px 20px rgba(13, 71, 161, .08);
  padding: 6px 8px calc(6px + var(--safe-b));
}
.bottom-nav__item {
  flex: 1 1 0; max-width: 160px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--c-muted); font-size: .76rem; font-weight: 650; border-radius: 12px;
}
.bottom-nav__item .bi { font-size: 1.3rem; }
.bottom-nav__item.is-active { color: var(--c-primary); background: var(--c-light); }
body.keyboard-open .bottom-nav { display: none; }

/* -------------------------------------------------------------- Toast */
.toast-zone { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + var(--safe-b)); z-index: 1090; width: min(520px, calc(100% - 32px)); display: grid; gap: 8px; pointer-events: none; }
.app-toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: #0F2A55; color: #fff; box-shadow: var(--shadow); font-size: .93rem; animation: toastIn .25s ease; }
.app-toast--success { background: #14532D; }
.app-toast--warning { background: #78350F; }
.app-toast--danger { background: #7F1D1D; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-sm-plus { max-width: 420px; }
.modal-content { border-radius: 18px; border: 0; box-shadow: var(--shadow); }

/* --------------------------------------------------------------- Login */
.login-body { min-height: 100vh; min-height: 100dvh; background: var(--grad-header); display: flex; flex-direction: column; }
.login-hero { color: #fff; text-align: center; padding: calc(36px + var(--safe-t)) 20px 72px; position: relative; }
.login-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 48px; background: var(--c-bg); border-radius: 48px 48px 0 0; }
.login-logo { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 26px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 14px 32px rgba(0, 0, 0, .2); }
.login-logo img { width: 78px; height: auto; }
.login-hero h1 { font-size: 2rem; font-weight: 850; letter-spacing: .01em; margin: 0; }
.login-hero p { margin: 4px 0 0; opacity: .95; }
.login-main { flex: 1; background: var(--c-bg); padding: 0 16px calc(28px + var(--safe-b)); }
.login-card { max-width: 420px; margin: -40px auto 0; position: relative; z-index: 1; background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 22px 20px; border: 1px solid var(--c-border); }
.login-card h2 { font-size: 1.2rem; font-weight: 800; margin: 0 0 4px; }
.login-foot { text-align: center; color: var(--c-muted); font-size: .82rem; margin-top: 18px; }
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 52px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: var(--c-muted); border-radius: 10px; }
.pw-toggle:hover { color: var(--c-primary); background: var(--c-light); }

/* ------------------------------------------------------ Riwayat & detail */
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 999px; border: 1px solid #C9D8EA; background: #fff; color: var(--c-text); text-decoration: none; font-weight: 600; font-size: .9rem; }
.chip.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--c-border); border-radius: 14px; padding: 12px; box-shadow: var(--shadow-sm); }
.stat__num { font-size: 1.4rem; font-weight: 800; color: var(--c-deep); line-height: 1.1; }
.stat__label { font-size: .78rem; color: var(--c-muted); font-weight: 600; }
.update-list { display: grid; gap: 10px; }
.update-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; background: #fff; border: 1px solid var(--c-border); border-radius: 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease; }
.update-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); color: inherit; }
.update-item__thumb { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: #DCE6F2; }
.update-item__title { font-weight: 750; margin: 0; line-height: 1.25; word-break: break-word; }
.update-item__meta { font-size: .82rem; color: var(--c-muted); margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.update-item__chev { color: #94A3B8; font-size: 1.2rem; }
.empty-state { text-align: center; padding: 34px 16px; color: var(--c-muted); }
.empty-state .bi { font-size: 2.6rem; color: #A9C9EE; display: block; margin-bottom: 8px; }
.empty-state h2 { font-size: 1.05rem; color: var(--c-text); font-weight: 750; }
.detail-section + .detail-section { margin-top: 14px; }
.detail-section h2 { font-size: 1rem; font-weight: 800; color: var(--c-deep); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.photo-figure { margin: 0; }
.photo-figure img { width: 100%; border-radius: 12px; background: #0B1B33; display: block; }
.integrity { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; word-break: break-all; }
.detail-photos { display: grid; gap: 14px; }
@media (min-width: 768px) {
  .detail-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-list--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
}
.user-list { display: grid; gap: 10px; }
.user-item { display: flex; gap: 12px; align-items: center; padding: 12px; background: #fff; border: 1px solid var(--c-border); border-radius: 14px; }
.user-item__avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--c-light); color: var(--c-primary); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 42px; }
.user-item.is-inactive { opacity: .62; }
.table-wrap { overflow-x: auto; }

.min-w-0 { min-width: 0; }

/* Layar sempit: placeholder NS wajib tampil utuh ("Masukkan Nomor Sambungan pelanggan"). */
@media (max-width: 479.98px) {
  .step-card__body { padding-left: 14px; padding-right: 14px; }
  .step-card__lock { padding-left: 14px; }
  #nsInput { padding-left: 10px; padding-right: 10px; }
  #nsInput::placeholder { font-size: clamp(12px, 3.4vw, 16px); }
  .input-group > .btn { min-width: 48px; padding-left: .7rem; padding-right: .7rem; }
}

/* ------------------------------------------------ Kategori tunggakan */
/* Warna selalu disertai ikon + teks (tidak hanya mengandalkan warna). */
:root {
  --t-hijau: #16A34A; --t-hijau-bg: #EAF8EF; --t-hijau-ink: #14532D; --t-hijau-bd: #9AD8B0;
  --t-kuning: #F59E0B; --t-kuning-bg: #FFF7E0; --t-kuning-ink: #7A3E04; --t-kuning-bd: #F8CF73;
  --t-merah: #DC2626; --t-merah-bg: #FDECEC; --t-merah-ink: #8F1515; --t-merah-bd: #F3A9A9;
  --t-na: #64748B; --t-na-bg: #F1F5F9; --t-na-ink: #334155; --t-na-bd: #CBD5E1;
}
.tunggakan-banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-left: 6px solid var(--t-na); background: var(--t-na-bg); color: var(--t-na-ink); }
.tunggakan-banner__icon { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; color: #fff; background: var(--t-na); }
.tunggakan-banner__label { font-weight: 850; letter-spacing: .06em; font-size: .95rem; line-height: 1.2; }
.tunggakan-banner__detail { font-size: .88rem; font-weight: 600; line-height: 1.35; }
.tunggakan-banner[data-kat="hijau"] { border-color: var(--t-hijau); background: var(--t-hijau-bg); color: var(--t-hijau-ink); }
.tunggakan-banner[data-kat="hijau"] .tunggakan-banner__icon { background: var(--t-hijau); }
.tunggakan-banner[data-kat="kuning"] { border-color: var(--t-kuning); background: var(--t-kuning-bg); color: var(--t-kuning-ink); }
.tunggakan-banner[data-kat="kuning"] .tunggakan-banner__icon { background: var(--t-kuning); color: #3B1D02; }
.tunggakan-banner[data-kat="merah"] { border-color: var(--t-merah); background: var(--t-merah-bg); color: var(--t-merah-ink); }
.tunggakan-banner[data-kat="merah"] .tunggakan-banner__icon { background: var(--t-merah); }

.t-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; letter-spacing: .03em; border: 1px solid var(--t-na-bd); background: var(--t-na-bg); color: var(--t-na-ink); white-space: nowrap; }
.t-badge[data-kat="hijau"] { background: var(--t-hijau-bg); color: var(--t-hijau-ink); border-color: var(--t-hijau-bd); }
.t-badge[data-kat="kuning"] { background: var(--t-kuning-bg); color: var(--t-kuning-ink); border-color: var(--t-kuning-bd); }
.t-badge[data-kat="merah"] { background: var(--t-merah-bg); color: var(--t-merah-ink); border-color: var(--t-merah-bd); }
.update-item[data-kat] { border-left-width: 5px; }
.update-item[data-kat="hijau"] { border-left-color: var(--t-hijau); }
.update-item[data-kat="kuning"] { border-left-color: var(--t-kuning); }
.update-item[data-kat="merah"] { border-left-color: var(--t-merah); }
.chip--hijau.is-active { background: #15803D; border-color: #15803D; }  /* hijau lebih gelap: kontras teks putih >= 4.5:1 */
.chip--kuning.is-active { background: var(--t-kuning); border-color: var(--t-kuning); color: #3B1D02; }
.chip--merah.is-active { background: var(--t-merah); border-color: var(--t-merah); }
.chip__dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip--hijau .chip__dot { background: var(--t-hijau); }
.chip--kuning .chip__dot { background: var(--t-kuning); }
.chip--merah .chip__dot { background: var(--t-merah); }
.chip.is-active .chip__dot { background: #fff; }
.side-tunggakan { margin: 0 0 10px; }
.side-tunggakan .t-badge { font-size: .82rem; padding: 4px 12px; }
.filter-chips--wrap { flex-wrap: wrap; overflow: visible; }
