/* =====================================================================
   GoPijat — Dashboard Admin
   Palet: #028090 (primer) · #043B42 (gelap) · #02C39A (mint) · #EAF6F6 (tint)
   Layout: sidebar navigasi kiri + konten; SPA satu halaman dengan tab.
   ===================================================================== */
:root {
  --gp-primer: #028090;
  --gp-gelap: #043B42;
  --gp-mint: #02C39A;
  --gp-tint: #EAF6F6;
  --gp-tint-2: #f6fbfb;
  --gp-ink: #10282c;
  --gp-ink-soft: #47646a;
  --gp-ink-mute: #7b969b;
  --gp-line: #d5e6e8;
  --gp-putih: #ffffff;
  --gp-merah: #d64550;
  --gp-oranye: #f2994a;
  --gp-biru: #2f80ed;
  --gp-abu: #94a3ad;
  --gp-radius: 12px;
  --gp-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gp-shadow: 0 8px 24px -12px rgba(4, 59, 66, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--gp-font); color: var(--gp-ink); background: var(--gp-tint); }
.hidden { display: none !important; }
.muted { color: var(--gp-ink-mute); }
.error { color: var(--gp-merah); font-size: 13px; min-height: 18px; margin-top: 10px; }
small { font-size: 12px; }
button { font-family: inherit; cursor: pointer; }
em.unver { color: var(--gp-oranye); font-size: 11px; font-style: normal; }

/* ============================ BANNER CONFIG ============================ */
.config-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 3000;
  background: #fff4e0;
  color: #7a4a00;
  border-bottom: 2px solid var(--gp-oranye);
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.5;
}
.config-banner code { background: rgba(0, 0, 0, 0.07); padding: 1px 5px; border-radius: 4px; }

/* ============================ LOGIN ============================ */
.login-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(2, 195, 154, 0.18) 0%, transparent 60%),
    radial-gradient(700px 500px at 0% 110%, rgba(2, 128, 144, 0.16) 0%, transparent 60%),
    var(--gp-tint);
}
.login-card {
  width: 380px;
  max-width: 100%;
  padding: 36px 32px 26px;
  border-radius: 20px;
  background: var(--gp-putih);
  border: 1px solid var(--gp-line);
  box-shadow: var(--gp-shadow);
}
.lc-emblem {
  width: 62px; height: 62px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: var(--gp-tint);
  border: 1px solid var(--gp-line);
  margin-bottom: 16px;
}
.lc-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gp-primer);
  margin-bottom: 4px;
}
.login-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--gp-gelap); }
.login-card .muted { margin: 6px 0 22px; font-size: 14px; }

.lc-field { margin-bottom: 14px; }
.lc-field label { display: block; font-size: 13px; font-weight: 600; color: var(--gp-ink-soft); margin-bottom: 6px; }
.lc-field input {
  width: 100%;
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--gp-ink);
  background: var(--gp-tint-2);
  border: 1px solid var(--gp-line);
  border-radius: 10px;
  outline: none;
}
.lc-field input:focus { border-color: var(--gp-primer); box-shadow: 0 0 0 3px rgba(2, 128, 144, 0.15); }
.lc-pass { position: relative; }
.lc-pass input { padding-right: 42px; }
.lc-eye {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 42px;
  background: none; border: none;
  color: var(--gp-ink-mute);
  display: flex; align-items: center; justify-content: center;
}
.lc-eye:hover { color: var(--gp-primer); }
.lc-remember {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--gp-ink-soft);
  margin: 4px 0 18px;
  cursor: pointer;
  user-select: none;
}
#login-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--gp-mint), var(--gp-primer));
  border: none; border-radius: 10px;
}
#login-btn:hover { filter: brightness(1.05); }
#login-btn:disabled { opacity: 0.6; cursor: wait; }
#login-btn.is-loading .lc-btn-label::after { content: '…'; }

/* ============================ APP LAYOUT ============================ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Sidebar navigasi ---- */
.nav {
  width: 220px;
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  background: var(--gp-gelap);
  color: #d9ecee;
  padding: 18px 14px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.nav-logo {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--gp-mint), var(--gp-primer));
}
.nav-brand strong { display: block; font-size: 16px; color: #fff; }
.nav-brand small { display: block; font-size: 11px; color: #8fb6ba; }

.nav-menu { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  text-align: left;
  padding: 10px 12px;
  font-size: 14px; font-weight: 600;
  color: #b9d6d9;
  background: none;
  border: none;
  border-radius: 9px;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.active { background: var(--gp-primer); color: #fff; }

.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: #8fb6ba; }
.rt-line { display: flex; align-items: center; gap: 7px; }
.rt-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gp-abu); display: inline-block; }
.rt-dot.ok { background: var(--gp-mint); box-shadow: 0 0 6px var(--gp-mint); }
.rt-dot.down { background: var(--gp-merah); }
.admin-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Konten ---- */
.content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 24px 32px;
}
.tab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.tab-head h2 { font-size: 20px; font-weight: 800; color: var(--gp-gelap); }
.tab-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.summary { font-size: 13px; color: var(--gp-ink-soft); }
.sub-title { font-size: 15px; font-weight: 700; color: var(--gp-gelap); margin: 20px 0 10px; }
.hint { font-size: 12px; color: var(--gp-ink-mute); margin-top: 8px; }
.filter-label { font-size: 13px; color: var(--gp-ink-soft); }
select {
  padding: 7px 10px;
  font-size: 13px; font-family: inherit;
  color: var(--gp-ink);
  background: var(--gp-putih);
  border: 1px solid var(--gp-line);
  border-radius: 8px;
}

/* ---- Tombol ---- */
.btn {
  padding: 8px 14px;
  font-size: 13px; font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--gp-line);
  background: var(--gp-putih);
  color: var(--gp-ink-soft);
}
.btn:hover { border-color: var(--gp-primer); color: var(--gp-primer); }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; }
.nav .btn.ghost { border-color: rgba(255, 255, 255, 0.2); color: #b9d6d9; }
.nav .btn.ghost:hover { border-color: var(--gp-mint); color: #fff; }
.range-group { display: inline-flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--gp-line); }
.btn.range { border: none; border-radius: 0; background: var(--gp-putih); }
.btn.range + .btn.range { border-left: 1px solid var(--gp-line); }
.btn.range.active { background: var(--gp-primer); color: #fff; }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px; font-weight: 600;
  border-radius: 7px;
  border: 1px solid var(--gp-line);
  background: var(--gp-putih);
  color: var(--gp-ink-soft);
  white-space: nowrap;
}
.btn-sm:hover { border-color: var(--gp-primer); color: var(--gp-primer); }
.btn-sm.primary { background: var(--gp-primer); border-color: var(--gp-primer); color: #fff; }
.btn-sm.primary:hover { filter: brightness(1.1); color: #fff; }
.btn-sm.danger { color: var(--gp-merah); border-color: #f0c8cb; }
.btn-sm.danger:hover { background: #fdf1f2; border-color: var(--gp-merah); }
.btn-sm:disabled { opacity: 0.5; cursor: wait; }
.group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================ PETA ============================ */
.peta-layout {
  display: flex;
  gap: 12px;
  height: calc(100vh - 175px);
  min-height: 380px;
}
.peta-sidebar {
  width: 280px;
  flex: 0 0 280px;
  overflow-y: auto;
  background: var(--gp-putih);
  border: 1px solid var(--gp-line);
  border-radius: var(--gp-radius);
  padding: 8px;
}
.map {
  flex: 1;
  min-width: 0;
  border-radius: var(--gp-radius);
  border: 1px solid var(--gp-line);
  z-index: 0; /* di bawah modal */
}
.p-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 8px;
  border-radius: 9px;
  cursor: pointer;
}
.p-row:hover { background: var(--gp-tint); }
.p-info { flex: 1; min-width: 0; }
.p-nama { font-size: 13px; font-weight: 700; color: var(--gp-gelap); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-sub { font-size: 11.5px; color: var(--gp-ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 10px; }
.dot.tersedia { background: var(--gp-mint); }
.dot.order { background: var(--gp-biru); }
.dot.offline { background: var(--gp-abu); }
.dot.rumah { background: var(--gp-oranye); }

/* ---------- Marker foto terapis (pm- = peta marker) ---------- */
.pm-icon { background: transparent; border: none; }
.pm-wrap { position: relative; width: 44px; height: 52px; }
.pm-foto {
  display: block;
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  box-sizing: border-box;
  border: 3px solid var(--gp-abu); /* warna cincin di-set inline per status */
  background: var(--gp-putih);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.pm-inisial {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 17px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.pm-panah {
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid var(--gp-abu); /* warna di-set inline per status */
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}
.pm-thumb {
  width: 28px; height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  object-fit: cover;
  box-sizing: border-box;
  border: 2px solid var(--gp-line); /* warna cincin di-set inline per status */
  background: var(--gp-putih);
}
.pm-thumb.pm-inisial { font-size: 12.5px; }
.pm-popup { display: flex; align-items: center; gap: 10px; }
.pm-popup-foto {
  width: 56px; height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  object-fit: cover;
  box-sizing: border-box;
  border: 3px solid var(--gp-line); /* warna cincin di-set inline per status */
  background: var(--gp-putih);
}
.pm-popup-foto.pm-inisial { font-size: 22px; }

.legend {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px; color: var(--gp-ink-soft);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 9px; height: 9px; flex-basis: 9px; }

/* ============================ TABEL ============================ */
.table-wrap {
  overflow-x: auto;
  background: var(--gp-putih);
  border: 1px solid var(--gp-line);
  border-radius: var(--gp-radius);
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--gp-ink-mute);
  background: var(--gp-tint-2);
  border-bottom: 1px solid var(--gp-line);
  white-space: nowrap;
}
.table td { padding: 9px 12px; border-bottom: 1px solid var(--gp-tint); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--gp-tint-2); }
.table tr.klik { cursor: pointer; }
.table td.kode { font-weight: 700; color: var(--gp-primer); white-space: nowrap; }
.table td.nama { font-weight: 600; color: var(--gp-gelap); }
.table td.uang { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table td.alamat { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table td.aksi { white-space: nowrap; }
.table .empty, .table .table-err { text-align: center; color: var(--gp-ink-mute); padding: 22px; }
.table .table-err { color: var(--gp-merah); }
.table.mini th, .table.mini td { padding: 7px 10px; }

/* ---- Badge status ---- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  font-size: 11px; font-weight: 700;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.on { background: rgba(2, 195, 154, 0.14); color: #017a61; }
.badge.off { background: rgba(148, 163, 173, 0.18); color: #5c6f77; }
.badge.warn { background: rgba(242, 153, 74, 0.16); color: #a95c14; }

.badge.st-mencari { background: rgba(242, 153, 74, 0.16); color: #a95c14; }
.badge.st-ditugaskan { background: rgba(47, 128, 237, 0.13); color: #1b5cb8; }
.badge.st-menuju { background: rgba(2, 128, 144, 0.13); color: var(--gp-primer); }
.badge.st-berlangsung { background: rgba(2, 195, 154, 0.16); color: #017a61; }
.badge.st-selesai { background: rgba(2, 195, 154, 0.24); color: #01654f; }
.badge.st-dibatalkan_pelanggan, .badge.st-dibatalkan_terapis { background: rgba(214, 69, 80, 0.12); color: var(--gp-merah); }
.badge.st-tidak_terlayani { background: rgba(148, 163, 173, 0.2); color: #5c6f77; }

.badge.p-tersedia { background: rgba(2, 195, 154, 0.14); color: #017a61; }
.badge.p-order { background: rgba(47, 128, 237, 0.13); color: #1b5cb8; }
.badge.p-offline { background: rgba(148, 163, 173, 0.18); color: #5c6f77; }

.badge.rsp-diterima { background: rgba(2, 195, 154, 0.16); color: #017a61; }
.badge.rsp-ditolak { background: rgba(214, 69, 80, 0.12); color: var(--gp-merah); }
.badge.rsp-timeout { background: rgba(148, 163, 173, 0.2); color: #5c6f77; }
.badge.rsp-menunggu { background: rgba(242, 153, 74, 0.16); color: #a95c14; }

/* Terapis andalan: sudah menyelesaikan >= 5 order */
.badge.emas { background: rgba(201, 162, 39, 0.18); color: #8A6A10; border: 1px solid rgba(201, 162, 39, 0.45); }

/* Pelanggan diblokir + penanda pembatalan setelah terapis ditugaskan */
.badge.blokir { background: rgba(214, 69, 80, 0.16); color: var(--gp-merah); }
.table tr.baris-blokir { background: rgba(214, 69, 80, 0.05); }
.table td.risiko { font-weight: 800; color: var(--gp-merah); }

/* ============================ KARTU REKAP ============================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 6px;
}
.card {
  background: var(--gp-putih);
  border: 1px solid var(--gp-line);
  border-radius: var(--gp-radius);
  padding: 14px 16px;
}
.card small { display: block; font-size: 12px; color: var(--gp-ink-mute); margin-bottom: 6px; }
.card strong { font-size: 20px; font-weight: 800; color: var(--gp-gelap); letter-spacing: -0.01em; }

/* ============================ MODAL ============================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(4, 59, 66, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  width: 560px;
  max-width: 100%;
  max-height: 85vh;
  display: flex; flex-direction: column;
  background: var(--gp-putih);
  border-radius: 14px;
  box-shadow: 0 24px 60px -12px rgba(4, 59, 66, 0.45);
  overflow: hidden;
}
.modal-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--gp-tint); }
.modal-head h3 { font-size: 16px; font-weight: 800; color: var(--gp-gelap); }
.modal-sub { font-size: 12.5px; color: var(--gp-ink-soft); margin-top: 4px; }
.modal-body { padding: 14px 18px; overflow-y: auto; }
.modal-body .empty { color: var(--gp-ink-mute); font-size: 13px; text-align: center; padding: 14px 0; }
.modal-body .table-err { color: var(--gp-merah); font-size: 13px; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--gp-tint);
}
.modal-msg { margin-right: auto; font-size: 12.5px; color: var(--gp-merah); }
.pilih-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--gp-tint);
  font-size: 13px;
}
.pilih-row:last-child { border-bottom: none; }

/* ============================ RESPONSIVE (laptop kecil) ============================ */
@media (max-width: 1100px) {
  .nav { width: 190px; flex-basis: 190px; }
  .peta-sidebar { width: 230px; flex-basis: 230px; }
}
@media (max-width: 860px) {
  .app { flex-direction: column; height: auto; }
  .nav { width: 100%; flex: none; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .nav-brand { padding: 0; }
  /* Menu tab di HP: baris PENUH yang bisa DIGESER ke samping. Tanpa
     overflow-x, tombol ke-5 dst terpotong dan tidak terjangkau sama sekali. */
  .nav-menu {
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    order: 5;               /* turun ke baris sendiri di bawah brand */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }
  .nav-item { flex: 0 0 auto; white-space: nowrap; }
  .nav-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .nav .btn.wide { width: auto; }
  .content { overflow: visible; }
  .peta-layout { flex-direction: column; height: auto; }
  .peta-sidebar { width: 100%; flex: none; max-height: 220px; }
  .map { height: 420px; }
}

/* ============================ FOTO TERAPIS ============================ */
/* Kolom thumbnail di tabel Terapis */
.table td.foto { width: 52px; padding-top: 6px; padding-bottom: 6px; }
.foto-btn {
  display: block;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
}
.foto-btn:hover .foto-thumb,
.foto-btn:focus-visible .foto-thumb { box-shadow: 0 0 0 2px var(--gp-primer, #028090); }
.foto-thumb {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gp-line);
  background: rgba(148, 163, 173, 0.18);
  transition: box-shadow 0.15s ease;
}
.foto-inisial {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: #5c6f77;
}

/* Modal foto besar */
.foto-modal { display: flex; flex-direction: column; gap: 14px; }
.foto-besar {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--gp-line);
  background: rgba(148, 163, 173, 0.14);
}
.foto-kosong {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  color: var(--gp-ink-mute);
  font-size: 13px;
}
.foto-kosong-inisial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(2, 128, 144, 0.1);
  color: #028090;
  font-size: 28px;
  font-weight: 800;
}
.foto-info {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px 12px;
  font-size: 13.5px;
  align-items: center;
}
.foto-label { color: var(--gp-ink-mute); font-size: 12.5px; }
.foto-nilai { color: var(--gp-gelap, #043B42); font-weight: 600; }
.foto-nilai a { color: #028090; font-weight: 700; text-decoration: none; }
.foto-nilai a:hover { text-decoration: underline; }
.foto-pengingat {
  padding: 10px 12px;
  border: 1px solid rgba(2, 128, 144, 0.28);
  border-left: 4px solid #028090;
  border-radius: 8px;
  background: rgba(2, 128, 144, 0.08);
  color: #043B42;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

/* ============================ SOS DARURAT ============================ */
/* Palet merah tegas untuk alarm darurat terapis. */
:root {
  --sos-merah: #DC2626;
  --sos-merah-tua: #B91C1C;
}

/* ---- Badge di sidebar (muncul & menyala bila ada SOS aktif) ---- */
.sos-nav {
  margin-top: 12px;
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px; font-weight: 800;
  color: #fff;
  background: var(--sos-merah-tua);
  border: 1px solid #fca5a5;
  border-radius: 9px;
  animation: sos-badge-pulse 1s ease-in-out infinite;
}
.sos-nav:hover { filter: brightness(1.08); }
.sos-nav-ic { font-size: 16px; line-height: 1; }
.sos-nav-txt { flex: 1; text-align: left; }
.sos-nav-count {
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: #fff; color: var(--sos-merah-tua);
  font-size: 12px; font-weight: 800;
}
@keyframes sos-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.65); }
  50% { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0); }
}

/* ---- Overlay alarm menutup layar ---- */
.sos-overlay {
  position: fixed; inset: 0;
  z-index: 5000; /* di atas modal (2000) & banner config (3000) */
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(70, 0, 0, 0.74);
  animation: sos-bg-flash 1.1s steps(1, end) infinite;
  overflow-y: auto;
}
@keyframes sos-bg-flash {
  0%, 49% { background: rgba(85, 0, 0, 0.8); }
  50%, 100% { background: rgba(25, 0, 0, 0.66); }
}
.sos-card {
  width: 520px; max-width: 100%;
  max-height: 92vh; overflow-y: auto;
  background: #fff;
  border: 4px solid var(--sos-merah);
  border-radius: 16px;
  box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.35), 0 30px 70px -10px rgba(0, 0, 0, 0.6);
  padding: 18px;
}
.sos-flash {
  text-align: center;
  font-size: 26px; font-weight: 900; letter-spacing: 0.02em;
  color: #fff;
  background: var(--sos-merah);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  animation: sos-flash 0.7s steps(1, end) infinite;
}
@keyframes sos-flash {
  0%, 49% { background: var(--sos-merah); color: #fff; }
  50%, 100% { background: #7f1d1d; color: #fee2e2; }
}
.sos-antre {
  text-align: center; font-size: 13px; font-weight: 800;
  color: var(--sos-merah-tua);
  margin-bottom: 10px;
}
.sos-terapis {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 0 12px;
  border-bottom: 1px solid #fee2e2;
}
.sos-foto {
  width: 72px; height: 72px; flex: 0 0 72px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid var(--sos-merah);
  background: #fef2f2;
}
.sos-foto-kosong {
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: var(--sos-merah-tua);
}
.sos-terapis-info { min-width: 0; }
.sos-nama { font-size: 20px; font-weight: 900; color: #111; line-height: 1.2; }
.sos-meta { font-size: 13px; color: #444; margin-top: 3px; }
.sos-waktu { font-size: 12.5px; color: var(--sos-merah-tua); font-weight: 700; margin-top: 4px; }
.sos-catatan {
  margin-top: 12px; padding: 10px 12px;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px;
  font-size: 14px; color: #7f1d1d; font-weight: 600; line-height: 1.4;
}
.sos-order {
  margin-top: 12px; padding: 12px;
  border: 1px solid #fecaca; border-radius: 10px; background: #fff7f7;
}
.sos-order-h {
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--sos-merah-tua); margin-bottom: 8px;
}
.sos-row { display: grid; grid-template-columns: 84px 1fr; gap: 3px 10px; font-size: 13.5px; padding: 2px 0; }
.sos-k { color: #9b1c1c; font-weight: 600; }
.sos-v { color: #111; font-weight: 600; overflow-wrap: anywhere; }
.sos-tombol { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.sos-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 10px;
  font-size: 14px; font-weight: 800;
  border-radius: 10px; text-decoration: none;
  border: 2px solid transparent;
  text-align: center;
}
.sos-btn.call { background: var(--sos-merah); color: #fff; }
.sos-btn.wa { background: #16a34a; color: #fff; }
.sos-btn.loc { background: #1d4ed8; color: #fff; }
.sos-btn.disabled { background: #f3f4f6; color: #9ca3af; border-color: #e5e7eb; cursor: not-allowed; }
.sos-btn:not(.disabled):hover { filter: brightness(1.08); }
.sos-aksi { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sos-act {
  flex: 1; min-width: 132px;
  padding: 12px 10px;
  font-size: 14px; font-weight: 800;
  border-radius: 10px; border: 2px solid;
}
.sos-act.stop { background: #fff; color: #92400e; border-color: #fbbf24; }
.sos-act.stop.done { opacity: 0.55; }
.sos-act.ok { background: #16a34a; color: #fff; border-color: #16a34a; }
.sos-act.palsu { background: #fff; color: #6b7280; border-color: #d1d5db; }
.sos-act:hover { filter: brightness(1.05); }
.sos-act:disabled { opacity: 0.55; cursor: wait; }
.sos-tutup {
  display: block; width: 100%; margin-top: 12px;
  padding: 8px;
  background: none; border: none;
  color: #6b7280; font-size: 12.5px; font-weight: 600;
  text-decoration: underline;
}
.sos-tutup:hover { color: #111; }

@media (max-width: 860px) {
  /* Sidebar jadi baris horizontal — badge ikut menyesuaikan. */
  .sos-nav { width: auto; margin-top: 0; }
}
@media (max-width: 560px) {
  .sos-tombol { grid-template-columns: 1fr; }
}

/* ===== Tab Pelacakan (GTM + Pixel) ===== */
.track-wrap { max-width: 560px; }
.track-intro { color: #4a5f63; line-height: 1.6; margin: 0 0 22px; }
.track-field { margin-bottom: 18px; }
.track-field label { display: block; font-weight: 700; color: #043B42; margin-bottom: 6px; }
.track-field input {
  width: 100%; padding: 11px 13px; font-size: 15px; border: 1.5px solid #d8e5e4;
  border-radius: 9px; background: #fbfdfd; outline: none;
}
.track-field input:focus { border-color: #028090; }
.track-field small { display: block; color: #6b8287; font-size: 12.5px; margin-top: 5px; }
.track-field code { background: #eef4f4; padding: 1px 5px; border-radius: 4px; }
.track-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.track-msg { font-size: 13.5px; }
.track-msg.ok { color: #128C4A; font-weight: 600; }
.track-msg.err { color: #b3261e; font-weight: 600; }

/* ---- CRM Terapis ---- */
.crm-broadcast {
  background: #fff;
  border: 1px solid #d8ecea;
  border-radius: 12px;
  padding: 16px 20px 18px;
  margin-bottom: 6px;
}
.crm-broadcast .sub-title { margin-top: 2px; }
.crm-broadcast .track-intro { margin-bottom: 14px; }
.crm-target { display: flex; flex-wrap: wrap; gap: 20px; margin: 4px 0 12px; }
.crm-target label { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: #043B42; cursor: pointer; }
.crm-textarea {
  width: 100%;
  border: 1px solid #cfe0de;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 74px;
  box-sizing: border-box;
}
.crm-textarea:focus { border-color: #028090; outline: none; }
td.tengah, th.tengah { text-align: center; }

.kons-select {
  border: 1px solid #cfe0de;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  color: #043B42;
  background: #fff;
  min-width: 260px;
}
.kons-select:focus { border-color: #028090; outline: none; }
.track-note { color: #6b8287; font-size: 13px; margin-top: 22px; line-height: 1.6; }
.track-note a { color: #028090; font-weight: 600; }
