/* WANA — base styles (Fiori DNA)
 * Flat, elevation 0. TIDAK ADA box-shadow di file ini.
 * Shadow HANYA boleh di: dialog, menu, bottom sheet, FAB (tidak ada di file ini).
 * Radius: var(--radius-sm)=8px atau var(--radius-pill)=999px. TIDAK ADA nilai lain. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: 76px; /* ruang untuk tabbar */
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--border);
  background: var(--canvas);
  position: sticky;
  top: 0;
  z-index: 10;
  /* flat: tanpa shadow */
}
.topbar .brand { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
.topbar-right { display: flex; align-items: center; gap: var(--sp-sm); }

.client-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  min-height: var(--touch-min);
  padding: 0 var(--sp-sm);
  cursor: pointer;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  background: none;
  border: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.icon-btn:active { background: var(--surface-alt); }

/* ---------- App container ---------- */
#app { padding: 0 var(--sp-lg) 40px; }

/* ---------- Tipografi ---------- */
.page-title { font-size: var(--fs-title); font-weight: 600; padding: var(--sp-lg) 0 var(--sp-md); }
.sec-label {
  font-size: var(--fs-label);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: var(--sp-xl) 0 var(--sp-sm);
  font-weight: 500;
}
.hero-num {
  font-size: var(--fs-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin: var(--sp-xs) 0;
}
.hero-sub { font-size: 13px; color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  min-height: var(--touch-min);
  padding: var(--sp-md) var(--sp-xl);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  /* flat: tanpa shadow */
}
.btn:active { background: var(--surface-alt); }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:active { background: var(--brand-pressed); }

.btn-sm { min-height: 36px; padding: var(--sp-sm) var(--sp-lg); font-size: 13px; }

.btn-block { width: 100%; }

/* Link sebagai aksi sekunder */
.link-action {
  display: block;
  text-align: center;
  color: var(--brand);
  font-weight: 600;
  font-size: 14px;
  padding: var(--sp-lg);
  text-decoration: none;
  min-height: var(--touch-min);
}

/* ---------- Field ---------- */
.field { margin-bottom: var(--sp-lg); }
.field > label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--sp-md);
  font-family: inherit;
  font-size: 16px; /* cegah zoom iOS */
  color: var(--ink);
  background: var(--canvas);
  /* flat: tanpa shadow */
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
}
.field .hint { font-size: var(--fs-label); color: var(--muted); margin-top: 4px; }

/* ---------- Segmented control ---------- */
.segmented {
  display: flex;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: var(--sp-xl);
}
.segmented button {
  flex: 1;
  border: none;
  background: none;
  padding: 10px var(--sp-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  min-height: var(--touch-min);
}
.segmented button.active {
  background: var(--canvas);
  color: var(--ink);
  /* flat: tanpa shadow — knob dibedakan lewat background putih */
}

/* ---------- Chip (pill filter) ---------- */
.chips { display: flex; gap: var(--sp-sm); flex-wrap: wrap; margin-bottom: var(--sp-xl); }
.chip {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--canvas);
  padding: var(--sp-sm) var(--sp-lg);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  min-height: 36px;
  /* flat: tanpa shadow */
}
.chip.active { border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* ---------- List row (flat) ---------- */
.row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  /* tanpa radius, tanpa margin antar baris, tanpa shadow */
}
.row .row-icon { width: 20px; height: 20px; flex-shrink: 0; }
.row .row-txt { flex: 1; min-width: 0; }
.row .row-txt b { display: block; font-size: 14px; font-weight: 600; }
.row .row-txt span { font-size: var(--fs-label); color: var(--muted); }
.row .row-chev { color: var(--muted); flex-shrink: 0; }

/* ---------- Status: ikon + teks (BUKAN badge pill) ---------- */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.st .dot { width: 8px; height: 8px; border-radius: var(--radius-pill); flex-shrink: 0; }
.st.ok { color: var(--success); }
.st.ok .dot { background: var(--success); }
.st.warn { color: var(--warning); }
.st.warn .dot { background: var(--warning); }
.st.bad { color: var(--danger); }
.st.bad .dot { background: var(--danger); }
.st.info { color: var(--info); }
.st.info .dot { background: var(--info); }
.st.muted { color: var(--muted); }
.st.muted .dot { background: var(--muted); }

/* ---------- Tabel flat ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 600;
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* tanpa border vertikal, tanpa shadow, tanpa radius per baris */

/* ---------- Section accordion ---------- */
.sec { border-bottom: 1px solid var(--border); }
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: var(--sp-lg) 0;
  font-family: inherit;
  font-size: var(--fs-section);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  min-height: var(--touch-min);
  text-align: left;
}
.sec-head .sec-count { font-size: var(--fs-label); font-weight: 400; color: var(--muted); margin-left: var(--sp-sm); }
.sec-head .chev { color: var(--muted); transition: transform 0.2s; flex-shrink: 0; }
.sec.open .sec-head .chev { transform: rotate(180deg); }
.sec-body { display: none; padding-bottom: var(--sp-lg); }
.sec.open .sec-body { display: block; }

/* ---------- Bottom tabbar ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--canvas);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 10;
  padding-bottom: env(safe-area-inset-bottom);
  /* flat: tanpa shadow */
}
.tabbar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  min-height: 60px;
}
.tabbar .tab svg { width: 22px; height: 22px; }
.tabbar .tab.active { color: var(--brand); }
.tabbar .tab.hidden { display: none; } /* untuk mode personal: tab Klien disembunyikan */

/* ---------- Utilitas ---------- */
.divider { border: none; border-top: 1px solid var(--border); margin: var(--sp-xl) 0; }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 60px var(--sp-xl); }
.empty p { color: var(--muted); margin: var(--sp-lg) 0; }

/* Upload zone: dashed, bukan kartu berwarna */
.upload-zone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--sp-3xl) var(--sp-xl);
  text-align: center;
  margin-bottom: var(--sp-lg);
}

/* Catatan: file ini TIDAK mengandung box-shadow sama sekali.
 * Shadow HANYA boleh di elemen floating (dialog, menu, bottom sheet, FAB)
 * yang akan didefinisikan di modul masing-masing saat dibutuhkan.
 * Jangan tambahkan shadow ke .row, .btn, table, input, .tabbar, atau .segmented. */

/* ---------- Share screen (link + PIN) ---------- */
.share-linkrow { display: flex; gap: var(--sp-sm); align-items: stretch; margin-bottom: var(--sp-sm); }
.share-url {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--sp-md); font-size: var(--fs-body);
  background: var(--surface-alt);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pin-display { display: flex; gap: var(--sp-md); justify-content: center; margin: var(--sp-lg) 0 var(--sp-sm); }
.pin-digit {
  width: 56px; height: 64px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pin-actions { display: flex; justify-content: center; margin-bottom: var(--sp-sm); }
.linklike {
  background: none; border: none; color: var(--brand);
  font-size: 13px; font-weight: 600; cursor: pointer; padding: var(--sp-sm);
  min-height: var(--touch-min);
}
.toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.toggle {
  width: 48px; height: 28px; border-radius: var(--radius-pill);
  background: var(--border); border: none; position: relative; cursor: pointer;
  flex-shrink: 0;
}
.toggle.on { background: var(--brand); }
.toggle::after {
  content: ''; position: absolute;
  width: 24px; height: 24px; border-radius: var(--radius-pill);
  background: #fff; top: 2px; left: 2px; transition: left .2s;
}
.toggle.on::after { left: 22px; }
.share-actions { display: flex; gap: var(--sp-sm); margin-top: var(--sp-sm); }
.share-actions .btn { flex: 1; }
.wa-preview {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--sp-md); margin-top: var(--sp-lg);
  background: var(--surface-alt); font-size: 13px;
}
.wa-preview .wa-label { font-size: var(--fs-label); color: var(--muted); margin-bottom: 6px; }
.wa-preview .wa-text { line-height: 1.6; }

/* Riwayat snapshots */
.snap{border:1px solid var(--border);border-radius:8px;padding:14px 16px;margin-bottom:12px;cursor:pointer;background:#fff}
.snap:active{background:var(--surface-alt)}
.snap-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.snap-date{font-weight:600;font-size:14px}
.snap-check input{width:20px;height:20px;accent-color:var(--brand)}
.snap-client{font-size:12px;color:var(--muted);margin-bottom:8px}
.snap-metrics{display:flex;gap:12px;font-size:14px;margin-bottom:8px}
.snap-metrics b{font-weight:700}
.snap-status{display:flex;align-items:center;gap:6px;font-size:13px}
.snap-status .dot{width:8px;height:8px;border-radius:999px;display:inline-block}
.snap-status .dot.ok{background:var(--success)}
.snap-status .dot.warn{background:var(--warning)}
.snap-status .dot.bad{background:var(--danger)}
.compare-bar{position:sticky;bottom:80px;background:var(--ink);color:#fff;border-radius:8px;padding:12px 16px;display:flex;justify-content:space-between;align-items:center;margin-top:16px}
