:root {
  --accent: #1a5bc4;
  --navy: #0d2b5e;
  --accent-soft: #e8effb;
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #16213a;
  --muted: #5f6b80;
  --line: #e1e6ef;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 16px calc(12px) 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: #fff; color: var(--navy);
  border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 17px; margin: 0; font-weight: 650; }
.top .who { font-size: 12px; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 10px; }
.hdr-logo { height: 34px; width: auto; display: block; }
.chip-btn {
  border: 1px solid var(--line); background: var(--bg); color: var(--navy);
  border-radius: 999px; padding: 5px 12px; font-size: 13px;
}

main { padding: 14px 14px 100px; }

/* Month switcher */
.month {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.month strong { font-size: 16px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); font-size: 18px;
}

/* Cards */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.big { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.big small { font-size: 15px; font-weight: 500; color: var(--muted); }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat { background: var(--bg); border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 17px; }

.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.done > span { background: var(--ok); }
.bar.thin { height: 6px; margin: 6px 0 2px; }

/* Ranking */
.rank-item { padding: 12px 0; border-top: 1px solid var(--line); }
.rank-item:first-of-type { border-top: 0; padding-top: 0; }
.rank-no {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; margin-right: 8px;
}
.rank-no.gold { background: #fef3c7; color: #92400e; }

/* Sales list */
.sale {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 0; border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.sale .name { font-weight: 600; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.st-sub { background: #fef3c7; color: var(--warn); }
.st-ok { background: #dcfce7; color: var(--ok); }
.st-x { background: #fee2e2; color: var(--bad); }

.filter { width: 100%; margin-bottom: 12px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 4px; border-top: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; border-top: 0; }
td.num, th.num { text-align: right; }
tfoot td { font-weight: 700; }

/* Buttons */
.btn {
  display: inline-block; border: 0; border-radius: 10px; padding: 11px 16px;
  background: var(--accent); color: #fff; font-weight: 600;
}
.btn.block { display: block; width: 100%; }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: #fee2e2; color: var(--bad); }
.btn + .btn { margin-top: 8px; }
.fab {
  position: fixed; right: max(16px, calc(50vw - 264px)); bottom: 84px; z-index: 6;
  border: 0; border-radius: 999px; padding: 14px 20px;
  background: var(--accent); color: #fff; font-weight: 700;
  box-shadow: 0 6px 16px rgba(26,91,196,.35);
}

/* Bottom nav */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: center;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-inner { display: flex; width: 100%; max-width: 560px; }
.nav button {
  flex: 1; border: 0; background: none; padding: 10px 0 12px;
  font-size: 12px; color: var(--muted);
}
.nav button .ico { display: block; font-size: 20px; line-height: 1.2; }
.nav button.on { color: var(--accent); font-weight: 650; }

/* Forms */
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 16px;
}
textarea { min-height: 70px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preview { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 14px 0; font-size: 14px; }

.agent-edit { border-top: 1px solid var(--line); padding: 10px 0; }
.agent-edit:first-of-type { border-top: 0; }
.agent-edit .three { display: grid; grid-template-columns: 2fr 1.2fr 0.8fr auto; gap: 6px; align-items: end; }
.agent-edit label { margin-top: 0; }
.x-btn { border: 0; background: #fee2e2; color: var(--bad); border-radius: 10px; width: 42px; height: 44px; }

/* Modal */
.backdrop {
  position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.35);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--card); border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}
.sheet h3 { margin: 0 0 4px; font-size: 18px; }

/* Login */
.login { padding: 40px 18px; }
.login h1 { font-size: 24px; margin: 0 0 4px; }
.login-logo { display: block; width: 100%; max-width: 340px; margin: 0 auto 18px; border-radius: 12px; }
.login .sub { text-align: center; color: var(--muted); font-size: 14px; }
.user-btn {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-top: 8px; text-align: left;
}
.note { background: #fef3c7; color: #78350f; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 14px 0; }

/* ---- v2: jenis kes, ranking, 3-lajur ---- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.grid3 .stat b { font-size: 15px; }
.stat b small { font-size: 12px; font-weight: 500; color: var(--muted); }

.tchip { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; margin: 2px 0; }
.t-medikal { background: #e0f2fe; color: #075985; }
.t-nyawa { background: #ede9fe; color: #5b21b6; }
.t-kritikal { background: #ffe4e6; color: #9f1239; }
.t-simpanan { background: #dcfce7; color: #166534; }

.types { display: grid; gap: 8px; }
.type-row { display: flex; justify-content: space-between; align-items: center; }
.type-row b { font-size: 17px; }

.seg { display: flex; background: var(--line); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.medal { display: inline-block; width: 24px; margin-right: 8px; font-size: 18px; text-align: center; }
.rank-item.me { background: var(--accent-soft); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; }

.rank-teaser { display: flex; width: 100%; justify-content: space-between; align-items: center; border: 0; text-align: left; }
.rank-teaser strong { font-size: 20px; color: var(--accent); }
.rank-teaser small { font-size: 13px; color: var(--muted); font-weight: 500; }

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 0; flex: none; }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.sale.is-batal { opacity: .6; }
.rank-item .row.muted span:first-child { white-space: nowrap; }
.rank-item .row.muted span:last-child { text-align: right; }
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 30;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 6px 16px rgba(0,0,0,.2); max-width: 90vw; text-align: center;
}

/* ---- v3: log masuk awan & jemputan ---- */
.link-btn { display: block; width: 100%; border: 0; background: none; padding: 10px; color: var(--accent); font-size: 14px; text-align: center; }
.link-btn strong { color: var(--navy); }
.ok-note { background: #dcfce7; color: #14532d; }
.err-note { background: #fee2e2; color: #7f1d1d; }
.small { font-size: 12px; }
.mini-btn { border: 1px solid var(--line); background: var(--bg); color: var(--accent); border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 600; margin-left: 4px; }
.agent-edit .row.small { flex-wrap: wrap; gap: 4px; }
.btn:disabled { opacity: .6; }

/* ============================================================
   v4: TEMA NAVY & EMAS (menggantikan rupa biru-putih)
   ============================================================ */
:root {
  --accent: #1f4f9e;
  --accent-soft: #eaf0fa;
  --navy: #0d2b5e;
  --ink: #0a1631;
  --gold: #c9a24a;
  --gold-hi: #e9cd82;
  --gold-soft: #fbf4e2;
  --bg: #f2f3f7;
  --line: #e3e6ee;
  --grad-navy: linear-gradient(160deg, #0a1631 0%, #12306a 60%, #0a1631 100%);
  --grad-gold: linear-gradient(135deg, #f0d78f 0%, #c9a24a 55%, #a7802c 100%);
}

/* Header gelap dengan garis emas */
.top {
  background: var(--grad-navy); color: #fff; border-bottom: 0;
  box-shadow: inset 0 -2px 0 var(--gold), 0 4px 14px rgba(10,22,49,.18);
}
.top h1 { color: #fff; letter-spacing: .01em; }
.top .who { color: rgba(255,255,255,.7); }
.hdr-logo { height: 32px; background: #fff; border-radius: 9px; padding: 3px 6px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.chip-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); color: #fff; }

/* Kad & angka */
.card { border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(10,22,49,.05); }
.card h2 { color: var(--navy); letter-spacing: .08em; }
.card h2::before { content: ""; display: inline-block; width: 14px; height: 2px; background: var(--gold); vertical-align: middle; margin-right: 8px; }
.big { color: var(--ink); }
.stat { background: #f6f7fb; border: 1px solid #eef0f5; }

/* Bar kemajuan: navy, emas bila sasaran tercapai */
.bar > span { background: linear-gradient(90deg, #12306a, #2c63c0); }
.bar.done > span { background: var(--grad-gold); }

/* Butang utama emas */
.btn { background: var(--grad-gold); color: var(--ink); font-weight: 700; box-shadow: 0 4px 12px rgba(201,162,74,.28); }
.btn.ghost { background: var(--accent-soft); color: var(--navy); box-shadow: none; }
.btn.danger { background: #fde8e8; color: var(--bad); box-shadow: none; }
.fab { background: var(--grad-gold); color: var(--ink); box-shadow: 0 8px 20px rgba(167,128,44,.4); }

/* Navigasi bawah: aktif = navy dengan penanda emas */
.nav { background: #fff; box-shadow: 0 -4px 16px rgba(10,22,49,.06); }
.nav button { position: relative; }
.nav button.on { color: var(--navy); }
.nav button.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }

/* Segmen, ranking, pilihan */
.seg { background: #e7e9f0; }
.seg button.on { color: var(--navy); box-shadow: inset 0 -2px 0 var(--gold), 0 1px 3px rgba(0,0,0,.08); }
.rank-no { background: var(--accent-soft); color: var(--navy); }
.rank-item.me { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
.rank-teaser strong { color: var(--navy); }
.check:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.check input { accent-color: var(--navy); }
.preview { background: var(--gold-soft); border: 1px solid #f0e2bd; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,74,.2); }
.mini-btn { color: var(--navy); }
.toast { background: var(--ink); border: 1px solid rgba(201,162,74,.5); }

/* ---------- Skrin masuk: latar navy penuh ---------- */
body.auth {
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(44,99,192,.45) 0%, rgba(44,99,192,0) 60%),
    radial-gradient(80% 50% at 100% 110%, rgba(201,162,74,.18) 0%, rgba(201,162,74,0) 60%),
    var(--ink);
  min-height: 100vh;
}
body.auth .login { padding: max(44px, env(safe-area-inset-top)) 22px 40px; color: #fff; }
body.auth .login-logo {
  background: #fff; padding: 14px 18px; border-radius: 22px; max-width: 300px;
  box-shadow: 0 18px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(201,162,74,.35);
}
body.auth .login .sub {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--gold-hi); font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  margin: 6px 0 22px;
}
body.auth .login .sub::before, body.auth .login .sub::after { content: ""; width: 28px; height: 1px; background: rgba(233,205,130,.6); }
body.auth .login .card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.25); border-radius: 20px; padding: 20px 18px;
}
body.auth .login .card .muted, body.auth .login label { color: rgba(255,255,255,.72); }
body.auth .login input {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: #fff;
  border-radius: 12px; padding: 13px 14px;
}
body.auth .login input::placeholder { color: rgba(255,255,255,.4); }
body.auth .login input:focus { border-color: var(--gold-hi); box-shadow: 0 0 0 3px rgba(233,205,130,.18); }
body.auth .login .btn { border-radius: 12px; padding: 14px 16px; font-size: 16px; letter-spacing: .02em; }
body.auth .link-btn { color: rgba(255,255,255,.7); }
body.auth .link-btn strong { color: var(--gold-hi); }
body.auth .note { background: rgba(254,243,199,.12); color: #fde9b0; border: 1px solid rgba(253,233,176,.25); }
body.auth .ok-note { background: rgba(34,197,94,.14); color: #bbf7d0; border-color: rgba(187,247,208,.3); }
body.auth .err-note { background: rgba(239,68,68,.16); color: #fecaca; border-color: rgba(254,202,202,.3); }
body.auth .user-btn {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: #fff;
}
body.auth .user-btn .muted { color: rgba(255,255,255,.6); }
body.auth .btn.block[data-action="logout"] { margin-top: 8px; }
/* Tiada tajuk kecil di bawah logo: beri ruang terus ke borang */
body.auth .login-logo { margin-bottom: 28px; }

/* ============================================================
   v5: KEHADIRAN (skrin Masa)
   ============================================================ */
.center { text-align: center; }
.seg-top { margin-bottom: 14px; }

/* Kad jam besar */
.clock { text-align: left; }
.clock .clock-time { font-size: 46px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); margin: 14px 0 2px; font-variant-numeric: tabular-nums; }
.clock .clock-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.clock .clock-date { font-size: 12px; color: var(--muted); }
.clock.is-on { background: var(--grad-navy); border: 0; color: #fff; box-shadow: 0 10px 28px rgba(10,22,49,.28), inset 0 -3px 0 var(--gold); }
.clock.is-on .clock-time { color: #fff; }
.clock.is-on .clock-sub { color: rgba(255,255,255,.75); }
.clock.is-on .note { margin: 0 0 12px; }
.clock-btn { padding: 16px; font-size: 18px; letter-spacing: .03em; border-radius: 14px; }
.btn-out { background: #fff; color: var(--ink); box-shadow: 0 4px 14px rgba(0,0,0,.25); }

.badge.live { background: rgba(34,197,94,.18); color: #16a34a; }
.clock.is-on .badge.live { background: rgba(134,239,172,.18); color: #86efac; }
.badge.idle { background: #eef0f5; color: var(--muted); }
.badge.pl-office { background: #e6eefc; color: #1e3a8a; }
.badge.pl-field { background: var(--gold-soft); color: #8a6516; }
.clock.is-on .badge.pl-office { background: rgba(255,255,255,.15); color: #fff; }
.clock.is-on .badge.pl-field { background: rgba(233,205,130,.2); color: var(--gold-hi); }

/* Kad kecil di Utama */
.clock-teaser span { display: inline-flex; align-items: center; gap: 8px; }
.clock-teaser strong { font-size: 15px !important; }
.clock-teaser.is-on { background: var(--grad-navy); color: #fff; border: 0; }
.clock-teaser.is-on strong { color: var(--gold-hi) !important; }
.dot-live { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.25); }

/* Kehadiran pasukan hari ini */
.team-sum { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.team-sum b { color: var(--ink); font-size: 15px; }
.team-row { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; border: 0; border-top: 1px solid var(--line); background: none; padding: 11px 0; text-align: left; }
.team-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.team-name .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-st { font-weight: 700; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.team-st.in { color: #16a34a; }
.team-st.done { color: var(--navy); }
.team-st.none { color: #c2c7d2; }

/* Senarai sesi */
.day-group + .day-group { margin-top: 14px; }
.day-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--navy); font-weight: 700; padding-bottom: 6px; border-bottom: 2px solid var(--gold-soft); }
.sess { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sess:last-child { border-bottom: 0; }
.sess-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.sess-meta { margin-top: 4px; color: var(--muted); }
.sess-meta a, .office-box a { color: var(--accent); }
.sess.is-long { background: #fff7ed; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 8px; }
.warn-t { color: #c2410c; font-weight: 600; }

/* Jadual laporan */
.att-table tr.tap { cursor: pointer; }
.att-table tr.tap:active td { background: var(--gold-soft); }
.att-table td:first-child { color: var(--navy); font-weight: 600; }
.link-back { border: 0; background: none; color: var(--navy); font-weight: 700; padding: 4px 0 10px; font-size: 14px; }

/* Tetapan pejabat & kalendar */
.office-box { background: #f6f7fb; border: 1px dashed #cfd5e2; border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }

/* Kalendar */
.cal-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 10px rgba(10,22,49,.05); }
.cal-frame { display: block; width: 100%; height: 68vh; min-height: 420px; border: 0; }

/* Nav 5 butang untuk ketua */
.nav button { font-size: 11.5px; }
.team-st.warn { color: #c2410c; }

/* ============================================================
   v6: Pelan baru & Close di mana
   ============================================================ */
.t-warisan_gold { background: #fbf1d6; color: #7a5a12; }
.t-anugerah_max { background: #e6eefc; color: #1e3a8a; }
.t-asas_link    { background: #e0f2f1; color: #115e59; }
.t-aspirasi     { background: #f3e8ff; color: #6b21a8; }
.t-anggun       { background: #fde7f0; color: #9d174d; }
.vchip { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; margin: 2px 0; }
.v-booth { background: var(--ink); color: var(--gold-hi); }
.v-lain { background: #eef0f5; color: var(--muted); }
.venue-split { display: flex; gap: 18px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; }
.venue-split b { font-size: 16px; color: var(--ink); margin-left: 2px; }
.checks.plans { grid-template-columns: 1fr 1fr; }
.check input[type=radio] { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--navy); }
.check small { font-size: 11px; }

/* ============================================================
   v7: WAKTU SOLAT & KIBLAT
   ============================================================ */
.seg-top button { font-size: 13px; padding: 9px 4px; }
.solat-teaser span { display: inline-flex; align-items: center; gap: 6px; }
.solat-teaser strong { font-size: 14px !important; }

.solat-head { background: var(--grad-navy); color: #fff; border: 0; box-shadow: 0 10px 28px rgba(10,22,49,.25), inset 0 -3px 0 var(--gold); }
.solat-head .muted { color: rgba(255,255,255,.7); }
.solat-next { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 10px; margin-top: 14px; }
.solat-next > span:first-child { grid-column: 1 / -1; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-hi); }
.solat-next b { font-size: 34px; font-weight: 800; letter-spacing: -.01em; }
.solat-next b small { font-size: 14px; font-weight: 500; opacity: .7; }
.solat-next .solat-time { font-size: 24px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.solat-next .solat-cd { grid-column: 1 / -1; color: rgba(255,255,255,.8); font-size: 14px; }

.solat-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; margin: 0 -12px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.solat-row:first-of-type { border-top: 0; }
.solat-row.fard span { font-weight: 600; color: var(--ink); }
.solat-row.sunat span, .solat-row.sunat b { color: var(--muted); font-weight: 500; font-size: 14px; }
.solat-row b { font-size: 17px; }
.solat-row.past:not(.is-now) { opacity: .55; }
.solat-row.is-next { background: var(--gold-soft); border-radius: 10px; box-shadow: inset 3px 0 0 var(--gold); }
.solat-row.is-now { background: #e9f8ef; border-radius: 10px; box-shadow: inset 3px 0 0 #16a34a; }
.solat-row em { font-style: normal; font-size: 11px; font-weight: 700; color: #16a34a; background: #fff; border-radius: 999px; padding: 2px 7px; margin-left: 6px; }

/* Kompas kiblat */
.qibla-deg { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.qibla-deg b { font-size: 34px; font-weight: 800; color: var(--ink); }
.qibla-deg span { color: var(--muted); }
.compass { position: relative; width: 240px; height: 240px; margin: 18px auto 6px; }
.compass-dial {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fff 0 56%, #f3f5f9 57% 100%);
  border: 2px solid var(--line); box-shadow: inset 0 0 0 10px #fff, 0 6px 18px rgba(10,22,49,.12);
  transition: transform .15s linear;
}
.compass .cd { position: absolute; font-weight: 800; font-size: 15px; color: var(--muted); transform: translate(-50%, -50%); }
.cd-n { left: 50%; top: 9%; color: #b91c1c !important; }
.cd-e { left: 91%; top: 50%; }
.cd-s { left: 50%; top: 91%; }
.cd-w { left: 9%; top: 50%; }
.qibla-needle { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.qibla-needle i { position: absolute; left: -3px; bottom: 0; width: 6px; height: 84px; border-radius: 3px; background: var(--grad-gold); box-shadow: 0 0 0 1px rgba(167,128,44,.3); }
.qibla-needle span { position: absolute; left: -16px; top: -116px; font-size: 26px; line-height: 32px; width: 32px; text-align: center; }
.qibla-needle::after { content: ""; position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; }
.compass-mark { position: absolute; left: 50%; top: -12px; width: 0; height: 0; transform: translateX(-50%); border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 14px solid var(--ink); z-index: 2; }
.compass.aligned .compass-dial { border-color: #16a34a; box-shadow: inset 0 0 0 10px #e9f8ef, 0 0 0 6px rgba(22,163,74,.18); }
.compass.aligned .compass-mark { border-top-color: #16a34a; }
.compass-hint { font-weight: 600; color: var(--navy); min-height: 20px; }
.compass.aligned + .compass-hint { color: #16a34a; }

/* ============================================================
   v8: AKAUN EJENSI (duit masuk / keluar) — ketua sahaja
   Warna masuk/keluar disahkan selamat untuk rabun warna; setiap angka
   juga berlabel teks (+ / −), jadi warna bukan satu-satunya petunjuk.
   ============================================================ */
:root { --c-masuk: #0f8a6d; --c-keluar: #d9480f; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.sw-masuk, .fill-masuk { background: var(--c-masuk); }
.sw-keluar, .fill-keluar { background: var(--c-keluar); }
.nav button { font-size: 11px; }

/* Kad baki */
.akaun-teaser strong { font-size: 16px !important; font-variant-numeric: tabular-nums; }
.akaun-hero { background: var(--grad-navy); color: #fff; border: 0; box-shadow: 0 10px 28px rgba(10,22,49,.25), inset 0 -3px 0 var(--gold); }
.hero-lbl { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-hi); }
.hero-amt { font-size: 38px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.hero-wallets { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 13px; color: rgba(255,255,255,.75); }
.hero-wallets b { color: #fff; margin-left: 4px; font-variant-numeric: tabular-nums; }
.hero-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.hero-btns .btn { padding: 13px 8px; }
.hero-btns .btn + .btn { margin-top: 0; background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.25); }

/* Masuk vs keluar */
.flow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flow-box { background: #f6f7fb; border: 1px solid #eef0f5; border-radius: 10px; padding: 10px; min-width: 0; }
.flow-box b { display: block; font-size: 18px; color: var(--ink); margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.hbar { height: 8px; background: #eceef4; border-radius: 4px; overflow: hidden; }
.hbar > span { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.verdict { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #e9f6f1; color: var(--ink); font-size: 14px; }
.verdict.neg { background: #fdeee6; }
.verdict b { font-variant-numeric: tabular-nums; }

/* Pecahan ikut kategori */
.flow-row { display: block; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; padding: 10px 0; }
.flow-row:first-of-type { border-top: 0; padding-top: 0; }
.flow-row:active { background: var(--gold-soft); }
.flow-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); min-width: 0; }
.flow-ico { flex: none; width: 26px; text-align: center; font-size: 17px; }
.flow-amt { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }
.flow-amt small { display: inline-block; min-width: 38px; text-align: right; color: var(--muted); font-size: 12px; }
.flow-row .hbar { margin-top: 7px; }
.total-row { border-top: 2px solid var(--gold-soft); padding: 10px 0 6px; font-weight: 600; color: var(--navy); }
.total-row b { font-variant-numeric: tabular-nums; }
.empty.tight { padding: 14px 10px; }

/* Carta bulan demi bulan */
.legend { font-size: 12px; color: var(--muted); }
.legend .sw-keluar { margin-left: 14px; }
.trend { position: relative; margin-top: 8px; padding-top: 18px; }
.trend-max { position: absolute; top: 0; left: 0; right: 0; height: 18px; font-size: 11px; color: var(--muted); border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.trend-cols { display: flex; gap: 4px; }
.tr-col { flex: 1; min-width: 0; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; border-radius: 0 0 8px 8px; }
.tr-bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; width: 100%; height: 120px; border-bottom: 1px solid #cfd5e2; }
.tr-bars i { display: block; flex: 1; max-width: 14px; border-radius: 4px 4px 0 0; }
.tr-lbl { font-size: 11px; color: var(--muted); padding: 5px 0 4px; }
.tr-col.on { background: var(--gold-soft); }
.tr-col.on .tr-lbl { color: var(--ink); font-weight: 700; }
.tr-table { margin-top: 10px; }
.tr-table summary { color: var(--navy); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 0; }
.tr-table table { font-size: 13px; font-variant-numeric: tabular-nums; }

/* Senarai rekod */
.tx { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; padding: 10px 0; }
.day-group .tx:last-child { border-bottom: 0; }
.tx:active { background: var(--gold-soft); }
.tx-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; background: #f6f7fb; display: grid; place-items: center; font-size: 18px; }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tx-main strong, .tx-main .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { flex: none; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx-amt.mv { color: var(--muted); font-weight: 600; }

/* Borang rekod duit */
.kind-pick { grid-template-columns: repeat(3, 1fr); margin: 10px 0 2px; }
.kind-pick .check { justify-content: center; font-weight: 700; padding: 12px 4px; }
.kind-pick .check input { position: absolute; opacity: 0; width: 0; height: 0; }
.kind-pick .check:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(201,162,74,.35); }
#ledgerForm:has(input[name=kind][value=masuk]:checked) :is(.only-keluar, .only-pindah),
#ledgerForm:has(input[name=kind][value=keluar]:checked) :is(.only-masuk, .only-pindah),
#ledgerForm:has(input[name=kind][value=pindah]:checked) :is(.only-masuk, .only-keluar, .not-pindah) { display: none; }
#ledgerForm .only-pindah.preview { margin: 10px 0 0; font-size: 13px; }
.tr-table td:first-child { white-space: nowrap; }
a.rank-teaser { color: inherit; text-decoration: none; }

/* ============================================================
   v8: BORANG PROSPEK (awam) & menu Prospek
   ============================================================ */
.prospek-page { padding-bottom: 60px; }
.pf-hello { text-align: center; color: #fff; margin: 4px 0 18px; }
.pf-hello h1 { font-size: 21px; line-height: 1.3; margin: 0 0 8px; }
.pf-hello h1 span { color: var(--gold-hi); }
.pf-hello p { color: rgba(255,255,255,.78); font-size: 14px; margin: 0 0 12px; }
.pf-ejen { display: inline-block; background: rgba(255,255,255,.08); border: 1px solid rgba(233,205,130,.4); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.pf-ejen strong { color: var(--gold-hi); }
.opt { font-size: 11px; opacity: .65; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip { margin: 0; }
.pf-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pf-chip span { display: inline-block; padding: 9px 13px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22); color: #fff; font-size: 14px; background: rgba(255,255,255,.05); }
.pf-chip input:checked + span { background: var(--grad-gold); color: var(--ink); border-color: transparent; font-weight: 700; }
.pf-chip input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.pf-consent { display: flex !important; gap: 10px; align-items: flex-start; margin: 18px 0 16px !important; font-size: 13px; line-height: 1.45; }
.pf-consent input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--gold); }
.pf-secure { text-align: center; color: rgba(255,255,255,.6); font-size: 12px; margin-top: 14px; }
.pf-done { text-align: center; color: #fff; }
.pf-done h2 { margin: 6px 0 8px; font-size: 22px; }
.pf-done p { color: rgba(255,255,255,.8); font-size: 15px; margin: 0; }
.pf-tick { width: 64px; height: 64px; margin: 4px auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 800; background: var(--grad-gold); color: var(--ink); box-shadow: 0 8px 22px rgba(201,162,74,.35); }

/* ---- Menu Prospek (dalam app) ---- */
.seg-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: #c2410c; color: #fff; font-size: 11px; font-weight: 700; }
.qr-teaser { display: flex; width: 100%; justify-content: space-between; align-items: center; text-align: left; background: var(--grad-navy); color: #fff; border: 0; box-shadow: 0 8px 22px rgba(10,22,49,.22), inset 0 -3px 0 var(--gold); }
.qr-teaser span { display: flex; flex-direction: column; gap: 2px; }
.qr-teaser b { font-size: 16px; }
.qr-teaser small { color: rgba(255,255,255,.72); font-size: 12px; }
.qr-teaser strong { color: var(--gold-hi); white-space: nowrap; }
.prosp-teaser span { display: inline-flex; align-items: center; gap: 6px; }
.prosp-teaser strong { font-size: 14px !important; color: #c2410c !important; }

.ps-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -2px; scrollbar-width: none; }
.ps-chips::-webkit-scrollbar { display: none; }
.ps-chip { flex: none; border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; }
.ps-chip b { margin-left: 3px; color: var(--muted); font-weight: 700; }
.ps-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.ps-chip.on b { color: var(--gold-hi); }
.ps-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.ps-filters input[type=search] { grid-column: 1 / -1; }
.ps-filters select, .ps-filters input { padding: 9px 10px; font-size: 15px; }

.pros { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; box-shadow: 0 2px 10px rgba(10,22,49,.04); overflow: hidden; }
.pros.baru { box-shadow: inset 4px 0 0 #c2410c, 0 2px 10px rgba(10,22,49,.04); }
.pros.tak_berminat { opacity: .62; }
.pros-main { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 12px 14px 8px; }
.pros-main .name { font-weight: 700; color: var(--ink); }
.pros-chips { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.pros-note { margin-top: 6px; }
.pros-acts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.pa { display: block; text-align: center; padding: 10px 0; font-weight: 700; font-size: 14px; text-decoration: none; }
.pa-wa { color: #128c4b; border-right: 1px solid var(--line); }
.pa-tel { color: var(--navy); }
.pa:active { background: var(--gold-soft); }
.v-qr { background: #e6eefc; color: #1e3a8a; }

.badge.ps-baru { background: #ffedd5; color: #c2410c; }
.badge.ps-dihubungi { background: #e6eefc; color: #1e3a8a; }
.badge.ps-temujanji { background: var(--gold-soft); color: #7a5a12; }
.badge.ps-close { background: #dcfce7; color: #15803d; }
.badge.ps-tak { background: #eef0f5; color: var(--muted); }

.ps-status { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-opt { margin: 0; }
.ps-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ps-opt span { display: inline-block; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); background: #fff; }
.ps-opt input:checked + .ps-baru { background: #ffedd5; color: #c2410c; border-color: #fdba74; }
.ps-opt input:checked + .ps-dihubungi { background: #e6eefc; color: #1e3a8a; border-color: #93b4f0; }
.ps-opt input:checked + .ps-temujanji { background: var(--gold-soft); color: #7a5a12; border-color: var(--gold); }
.ps-opt input:checked + .ps-close { background: #dcfce7; color: #15803d; border-color: #86efac; }
.ps-opt input:checked + .ps-tak { background: #eef0f5; color: var(--ink); border-color: #c2c7d2; }
.ps-opt input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.pros-meta { background: #f6f7fb; border-radius: 10px; padding: 10px 12px; margin: 12px 0; line-height: 1.6; }

.booth-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.booth-row:first-of-type { border-top: 0; }
.booth-row > span:last-child { display: flex; gap: 6px; align-items: center; flex: none; }
.x-btn.sm { width: 34px; height: 30px; font-size: 13px; }

.qr-sheet { text-align: left; }
.qr-box { width: min(78vw, 320px); aspect-ratio: 1; margin: 16px auto 6px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 8px; box-shadow: 0 6px 20px rgba(10,22,49,.08); }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-cap { text-align: center; font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.pf-done h2 { color: #fff; text-transform: none; letter-spacing: 0; font-size: 22px; }
.pf-done h2::before { display: none; }

/* ---- Kiraan nombor ---- */
.seg-top button { padding-left: 2px; padding-right: 2px; }
.tally-form:has(input[name=place][value=lain]:checked) .tally-booth { display: none; }
.stepper { display: grid; grid-template-columns: 44px 1fr 44px; gap: 6px; }
.stepper button { border: 1px solid var(--line); background: #fff; border-radius: 10px; font-size: 22px; font-weight: 700; color: var(--navy); }
.stepper button:active { background: var(--gold-soft); }
.stepper input { text-align: center; font-size: 20px; font-weight: 700; padding: 9px 4px; }
.tally-row { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 10px 0; text-align: left; }
.tally-row:last-child { border-bottom: 0; }
.tally-row b { font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
.phones-input { font-variant-numeric: tabular-nums; line-height: 1.5; }
.phone-summary { margin-top: 6px; font-size: 14px; color: var(--navy); }
.phone-summary b { font-size: 18px; color: var(--ink); }
.tally-phones { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 2px 10px; margin-top: 8px; }
.tp-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; font-weight: 600; }
.tp-row:last-child { border-bottom: 0; }
.tp-row a { text-decoration: none; }
.tp-wa { color: #128c4b !important; }

/* ---- Status Seated & Presentation ---- */
.badge.ps-seated { background: #ede9fe; color: #5b21b6; }
.badge.ps-presentation { background: #e0f2f1; color: #115e59; }
.ps-opt input:checked + .ps-seated { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.ps-opt input:checked + .ps-presentation { background: #e0f2f1; color: #115e59; border-color: #5eead4; }
.att-table.compact th, .att-table.compact td { padding-left: 3px; padding-right: 3px; font-size: 13px; }
.att-table.compact th { font-size: 11px; }
.funnel { margin-top: 14px; display: grid; gap: 6px; }
.fn-row { display: grid; grid-template-columns: 92px 1fr 36px; align-items: center; gap: 8px; font-size: 13px; color: var(--navy); }
.fn-row b { text-align: right; font-variant-numeric: tabular-nums; }
.fn-bar { height: 10px; background: #eef0f5; border-radius: 999px; overflow: hidden; }
.fn-bar i { display: block; height: 100%; background: linear-gradient(90deg, #12306a, #2c63c0); border-radius: 999px; }
.fn-row:last-child .fn-bar i { background: var(--grad-gold); }

/* ---- Kiraan v3: 1 nombor 1 rekod + tick ---- */
.tick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.tick { display: flex !important; align-items: center; gap: 10px; margin: 0 !important; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink) !important; font-size: 15px !important; font-weight: 600; background: #fff; }
.tick input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--navy); }
.tick:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.tally-today { margin: 2px 2px 10px; }
.tally-today b { color: var(--ink); }
.tally-tiles .stat b { font-size: 22px; }
.tn-row { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tn-row:last-child { border-bottom: 0; }
.tn-main { border: 0; background: none; text-align: left; padding: 0; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tn-main b { font-variant-numeric: tabular-nums; color: var(--ink); }
.tn-tick { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tn-tick.on { background: var(--ink); color: var(--gold-hi); border-color: var(--ink); }
.tn-legacy { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.tn-phone { font-size: 13px; color: var(--navy); font-variant-numeric: tabular-nums; }
