/* =========================================================
   MedicPro — tema putih / hijau / oranye / hitam
   Gaya Material 3 "filled" — soft, minim border, ikon berwarna
   ========================================================= */

:root {
  --hijau: #15803d;
  --hijau-tua: #14532d;
  --hijau-terang: #22a35d;
  --hijau-muda: #e3f6ea;
  --oranye: #f97316;
  --oranye-tua: #c2410c;
  --oranye-muda: #fff1e6;
  --putih: #ffffff;
  --abu-1: #f2f4f6;
  --abu-2: #e9edf0;
  --abu-3: #b7c0c6;
  --abu-teks: #5b6b73;
  --hitam: #191c1f;
  --sukses: #2e7d32;
  --bahaya: #d32f2f;
  --peringatan: #ef6c00;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --el-1: 0 1px 3px rgba(20,30,40,0.05), 0 2px 8px rgba(20,30,40,0.04);
  --el-2: 0 6px 20px rgba(15,30,45,0.09), 0 1px 4px rgba(15,30,45,0.05);
  --el-3: 0 14px 34px rgba(13,71,161,0.16);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--abu-1);
  color: var(--hitam);
  overscroll-behavior-y: none;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ripple effect — dipasang lewat JS ke elemen .ripple */
.ripple { position: relative; overflow: hidden; }
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-anim .55s ease-out;
  background: rgba(255,255,255,0.4);
  pointer-events: none;
}
.ripple-dark .ripple-wave { background: rgba(21,101,192,0.14); }
@keyframes ripple-anim {
  to { transform: scale(3.2); opacity: 0; }
}

/* =========================================================
   LOGIN — kartu terpusat, bersih, ala referensi desain
   ========================================================= */
body.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--hijau-tua);
  background-image:
    radial-gradient(circle at 12% 12%, rgba(255,255,255,0.14) 0%, transparent 38%),
    radial-gradient(circle at 88% 8%, rgba(249,115,22,0.45) 0%, transparent 42%),
    radial-gradient(circle at 15% 92%, rgba(249,115,22,0.25) 0%, transparent 40%),
    radial-gradient(circle at 92% 88%, rgba(255,255,255,0.10) 0%, transparent 36%),
    linear-gradient(155deg, var(--hijau-terang) 0%, var(--hijau) 48%, var(--hijau-tua) 100%);
  overflow-x: hidden;
  padding: calc(32px + env(safe-area-inset-top)) 20px calc(32px + env(safe-area-inset-bottom));
}

.login-wrap { width: 100%; max-width: 360px; }

.login-wordmark {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 22px;
}
.login-wordmark .wm-icon {
  width: 50px; height: 50px; border-radius: 16px;
  background: var(--hijau);
  border: 3px solid rgba(255,255,255,0.9);
  box-shadow: 0 8px 20px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(255,255,255,0.15);
  color: var(--putih);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.login-wordmark span { font-size: 19px; font-weight: 700; color: var(--putih); letter-spacing: -.2px; text-shadow: 0 1px 4px rgba(0,0,0,0.15); }

.install-cta {
  display: none;
  align-items: center; gap: 7px;
  margin: 18px auto 0;
  background: var(--oranye);
  border: none;
  color: var(--putih);
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 650;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.install-cta.show { display: flex; width: fit-content; margin-left: auto; margin-right: auto; }
.install-cta i { font-size: 13px; }

.login-card {
  background: var(--putih);
  border-radius: var(--radius-lg);
  padding: 30px 26px 26px;
  box-shadow: var(--el-2);
  animation: card-in .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes card-in {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.login-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(160deg, #eef1f3, #dde3e7);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--hijau);
  margin: 0 auto 16px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
.login-card h1 {
  text-align: center; font-size: 16.5px; font-weight: 700; margin: 0 0 5px; color: var(--hitam);
}
.login-card .login-sub {
  text-align: center; color: var(--abu-teks); font-size: 12.5px; margin: 0 0 24px;
}

.form-group { margin-bottom: 15px; }
.field-label {
  display: block; font-size: 12.5px; font-weight: 650; color: var(--hitam); margin-bottom: 6px;
}
.field-wrap { position: relative; }
.form-control {
  width: 100%;
  padding: 13px 14px 13px 40px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  background: var(--abu-1);
  color: var(--hitam);
  transition: background .15s ease, box-shadow .15s ease;
}
.form-control:focus {
  outline: none;
  background: var(--putih);
  box-shadow: 0 0 0 2px var(--hijau);
}
.form-control-feedback {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--abu-3); font-size: 14px;
}
.toggle-password {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--abu-3); font-size: 14.5px; background: none; border: none; padding: 4px;
}
.forgot-link {
  display: block; text-align: right; font-size: 12px; font-weight: 650;
  color: var(--hijau); margin: -4px 0 18px;
}
.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--hijau-terang), var(--hijau-tua));
  color: var(--putih);
  border: none;
  padding: 14px;
  border-radius: var(--radius-lg);
  font-weight: 650;
  font-size: 14.5px;
  transition: transform .08s ease, background .15s ease;
}
.btn-login:active { transform: scale(0.98); }
.alert-danger {
  background: #fdecea; color: var(--bahaya); border: none;
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.login-signup-note {
  text-align: center; font-size: 12.5px; color: var(--abu-teks); margin-top: 20px;
}
.login-signup-note b { color: var(--hijau); font-weight: 650; cursor: pointer; }
.login-footer-note {
  text-align: center; font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 22px; text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* iOS "Add to Home Screen" mini sheet */
.ios-sheet-overlay {
  position: fixed; inset: 0; background: rgba(10,20,30,0.5);
  display: none; align-items: flex-end; justify-content: center; z-index: 100;
}
.ios-sheet-overlay.show { display: flex; }
.ios-sheet {
  background: var(--putih); width: 100%; max-width: 420px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  animation: sheet-up .3s ease;
}
@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.ios-sheet h3 { margin: 0 0 12px; font-size: 15.5px; }
.ios-sheet ol { margin: 0 0 16px; padding-left: 18px; font-size: 13.5px; color: var(--abu-teks); line-height: 1.7; }
.ios-sheet ol b { color: var(--hitam); }
.ios-sheet button { width: 100%; background: var(--abu-1); border: none; padding: 12px; border-radius: var(--radius-sm); font-weight: 650; font-size: 14px; }

/* =========================================================
   APP SHELL
   ========================================================= */
.app-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--putih);
  color: var(--hitam);
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  box-shadow: none;
  transition: box-shadow .2s ease;
}
.app-topbar.elevated { box-shadow: var(--el-1); }
.app-topbar .app-title { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; letter-spacing: .1px; }
.app-topbar .app-title .wm-icon {
  width: 30px; height: 30px; border-radius: 10px; background: var(--hijau); color: var(--putih);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.app-topbar .app-title small { display:block; font-weight:500; font-size:10.5px; color: var(--abu-teks); margin-top:1px; }
.topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--hijau-muda);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: var(--hijau);
}

.app-content { padding: 16px 14px 96px; max-width: 1080px; margin: 0 auto; }

.page-heading { margin: 4px 0 18px; }
.page-heading h1 { font-size: 17px; margin: 0 0 3px; font-weight: 700; letter-spacing: -.1px; }
.page-heading p { margin: 0; color: var(--abu-teks); font-size: 13px; }

/* ---------------- CARDS ---------------- */
.card-md {
  background: var(--putih);
  border-radius: var(--radius);
  box-shadow: var(--el-1);
  padding: 16px;
  margin-bottom: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 6px;
}
.stat-card {
  background: var(--putih);
  border-radius: var(--radius);
  padding: 17px 15px;
  box-shadow: var(--el-1);
  position: relative;
  overflow: hidden;
  transition: box-shadow .15s ease, transform .1s ease;
}
.stat-card:active { transform: scale(.98); }
.stat-card .icon-badge {
  width: 42px; height: 42px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16.5px; margin-bottom: 12px;
}
.stat-card .stat-value { font-size: 21px; font-weight: 750; color: var(--hitam); line-height: 1; letter-spacing: -.3px; }
.stat-card .stat-label { font-size: 12.5px; color: var(--abu-teks); margin-top: 5px; font-weight: 550; }
.bg-igd { background: #fdecea; color: var(--bahaya); }
.bg-ralan { background: var(--hijau-muda); color: var(--hijau); }
.bg-ranap { background: #fff3e0; color: var(--peringatan); }
.bg-total { background: var(--abu-2); color: var(--hitam); }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0 8px;
}
.menu-item {
  background: var(--putih);
  border-radius: var(--radius);
  box-shadow: var(--el-1);
  padding: 14px 6px;
  text-align: center;
  transition: transform .08s ease, box-shadow .15s ease;
}
.menu-item:active { transform: scale(0.96); box-shadow: var(--el-1); }
.menu-item .menu-icon {
  width: 40px; height: 40px; border-radius: 14px;
  background: var(--hijau-muda); color: var(--hijau);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin: 0 auto 8px;
}
.menu-item .menu-label { font-size: 10.5px; font-weight: 650; color: var(--hitam); line-height: 1.25; }

.section-title { font-size: 13px; font-weight: 700; margin: 22px 0 11px; color: var(--hitam); letter-spacing: -.1px; }

/* ---------------- PATIENT DETAIL HEADER + FEATURE GRID ---------------- */
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 650; color: var(--abu-teks);
  margin-bottom: 12px;
}
.back-link i { font-size: 12px; }

.patient-hero {
  background: var(--putih);
  border-radius: var(--radius);
  box-shadow: var(--el-1);
  padding: 20px 18px;
  margin-bottom: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.patient-hero .patient-avatar { width: 56px; height: 56px; min-width: 56px; border-radius: 18px; font-size: 20px; }
.patient-hero .p-name { font-size: 15px; font-weight: 750; color: var(--hitam); }
.patient-hero .p-meta { font-size: 12.5px; color: var(--abu-teks); margin-top: 4px; }
.patient-hero .p-meta span { display: inline-block; margin-right: 12px; }
.patient-hero .p-meta i { width: 14px; text-align: center; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.feature-item {
  background: var(--putih);
  border-radius: var(--radius);
  box-shadow: var(--el-1);
  padding: 18px 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  transition: transform .08s ease;
  position: relative;
}
.feature-item:active { transform: scale(.97); }
.feature-badge-done {
  position: absolute; top: 8px; right: 8px;
  background: var(--hijau); color: var(--putih);
  font-size: 9px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  display: flex; align-items: center; gap: 3px;
  box-shadow: 0 2px 6px rgba(21,128,61,0.35);
}
.feature-badge-done i { font-size: 8px; }
.feature-item .feature-icon {
  width: 42px; height: 42px; min-width: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.feature-item .feature-label { font-size: 12px; font-weight: 700; color: var(--hitam); line-height: 1.25; }
.feature-item .feature-sub { font-size: 10.5px; color: var(--abu-teks); margin-top: 2px; font-weight: 500; }

.fi-soap { background: var(--hijau-muda); color: var(--hijau); }
.fi-tindakan { background: #fff3e0; color: var(--peringatan); }
.fi-diagnosa { background: #fdecea; color: var(--bahaya); }
.fi-resume { background: #ede7f6; color: #5e35b1; }
.fi-asesmen { background: #e0f2f1; color: #00796b; }
.fi-lab { background: #e8f5e9; color: var(--sukses); }
.fi-rad { background: #e3f2fd; color: #0277bd; }
.fi-resep { background: #fce4ec; color: #ad1457; }
.fi-triase { background: #ffebee; color: #c62828; }
.fi-keperawatan { background: #e0f2f1; color: #00695c; }
.fi-pews { background: #fce4ec; color: #c2185b; }
.fi-ews { background: #ffebee; color: #d32f2f; }
.fi-terminal { background: #eceff1; color: #455a64; }
.fi-meows { background: #f3e5f5; color: #8e24aa; }
.fi-operasi { background: #fce4ec; color: #c62828; }
.fi-rekon { background: #fff3e0; color: #ef6c00; }
.fi-catatan { background: #e8eaf6; color: #3949ab; }
.fi-riwayat { background: #eceff1; color: #455a64; }

/* Browser kategori Pemeriksaan Triase (klik untuk tampilkan kriteria skala) */
.triase-browser { display: flex; gap: 10px; margin-bottom: 10px; }
.triase-kategori-list {
  flex: 0 0 38%; max-width: 38%; max-height: 280px; overflow-y: auto;
  background: var(--abu-1); border-radius: var(--radius-sm); padding: 6px;
}
.triase-kategori-item {
  padding: 10px 10px; border-radius: 9px; font-size: 12px; font-weight: 600;
  color: var(--hitam); cursor: pointer; margin-bottom: 3px;
}
.triase-kategori-item:active { background: var(--abu-2); }
.triase-kategori-item.active { background: var(--hijau); color: var(--putih); }
.triase-item-panel { flex: 1; min-width: 0; }
.skala-items-list { max-height: 280px; overflow-y: auto; }
.daftar-terpilih-gabungan { display: flex; flex-direction: column; gap: 8px; }
.lokalis-canvas-wrap {
  border: 1px solid var(--abu-2); border-radius: var(--radius-sm); overflow: hidden;
  background: #fff; touch-action: none;
}
.lokalis-canvas-wrap canvas { width: 100%; height: auto; display: block; touch-action: none; }
@media (max-width: 560px) {
  .triase-browser { flex-direction: column; }
  .triase-kategori-list { flex: none; max-width: 100%; max-height: 160px; }
}
.fi-consent { background: #e0f7fa; color: #00838f; }
.fi-statement { background: #f1f8e9; color: #558b2f; }
.fi-data { background: #ede7f6; color: #5e35b1; }
.fi-bukti { background: #fff3e0; color: var(--peringatan); }
.fi-penolakan { background: #fdecea; color: var(--bahaya); }
.fi-kerohanian { background: #f1f8e9; color: #558b2f; }
.fi-pindahkelas { background: #ede7f6; color: #5e35b1; }
.fi-pendamping { background: #fce4ec; color: #ad1457; }
.fi-secondopinion { background: #e0f7fa; color: #00838f; }
.fi-ambulan { background: #fdecea; color: var(--bahaya); }
.fi-dnr { background: #ede7f6; color: #5e35b1; }
.fi-transfusi { background: #ffebee; color: #c62828; }
.fi-jenazah { background: #eceff1; color: #37474f; }

/* Surat resmi (Pernyataan Keaslian Data, dll) — gaya dokumen cetak */
.surat-doc {
  background: var(--putih); border-radius: var(--radius); box-shadow: var(--el-1);
  padding: 22px 20px; margin-bottom: 16px; font-size: 13px; color: var(--hitam); line-height: 1.7;
}
.surat-doc .surat-judul { text-align: center; font-weight: 750; font-size: 14px; margin-bottom: 2px; text-transform: uppercase; }
.surat-doc .surat-nomor { text-align: center; font-size: 12px; color: var(--abu-teks); margin-bottom: 18px; }
.surat-doc .surat-section-label { font-weight: 700; margin: 14px 0 6px; }
.surat-doc dl { margin: 0 0 4px; display: grid; grid-template-columns: 130px 1fr; gap: 3px 0; }
.surat-doc dt { color: var(--abu-teks); }
.surat-doc dt::after { content: ':'; float: right; padding-right: 6px; }
.surat-doc dd { margin: 0; font-weight: 600; }
.surat-doc .surat-ttd-wrap { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 26px; gap: 20px; }
.surat-doc .surat-ttd-left { flex: 1; }
.surat-doc .surat-ttd { flex: 0 0 250px; max-width: 250px; text-align: left; }
.surat-doc .surat-ttd .ttd-space { height: 64px; }

/* Kanvas tanda tangan digital — coret-coret ala aplikasi pinjol */
.ttd-pad-box {
  border: 1.5px dashed var(--abu-3); border-radius: var(--radius-sm);
  background: var(--abu-1); margin: 8px 0 6px; position: relative; overflow: hidden;
}
.ttd-pad-box canvas { display: block; width: 100%; height: 130px; touch-action: none; cursor: crosshair; }
.ttd-pad-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--abu-3); font-size: 11px; text-align: center; padding: 0 10px; pointer-events: none;
}
.ttd-clear-btn { font-size: 11px; color: var(--hijau); background: none; border: none; padding: 2px 0 10px; font-weight: 650; }
.ttd-signed-img { max-width: 100%; max-height: 100px; display: block; }

@media print {
  .app-topbar, .bottom-nav, .sidebar, .back-link, .btn-primary, .btn-outline, .snackbar, .install-banner, .ttd-pad-box, .ttd-clear-btn { display: none !important; }
  .app-content { padding: 0 !important; max-width: 100% !important; }
  .surat-doc { box-shadow: none !important; }
}
.surat-doc p { text-align: justify; }
@media (min-width: 480px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  .feature-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Halaman fitur (SOAP, Tindakan, dll) — context bar pasien di atas form */
.context-bar {
  background: var(--hitam);
  color: var(--putih);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.context-bar .cb-name { font-size: 13.5px; font-weight: 700; }
.context-bar .cb-meta { font-size: 11px; color: #b9c2c8; margin-top: 2px; }
.context-bar .cb-badge {
  background: rgba(255,255,255,0.14); padding: 4px 10px; border-radius: 20px;
  font-size: 10.5px; font-weight: 650; white-space: nowrap;
}

/* ---------------- SEARCH / LISTS ---------------- */
.search-bar { display: flex; gap: 8px; margin-bottom: 14px; }
.search-bar input[type=text], .search-bar input[type=date] {
  flex: 1;
  padding: 13px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--putih);
  box-shadow: var(--el-1);
}
.search-bar input:focus { outline: none; box-shadow: 0 0 0 2px var(--hijau); }
.search-bar button {
  background: var(--hijau);
  color: var(--putih); border: none;
  border-radius: var(--radius-sm); padding: 0 18px; font-size: 14px; font-weight: 650;
}

.patient-card {
  background: var(--putih);
  border-radius: var(--radius);
  box-shadow: var(--el-1);
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  gap: 13px;
  align-items: center;
  transition: transform .08s ease;
}
.patient-card:active { transform: scale(.99); }
.patient-card .p-chevron { color: var(--abu-3); font-size: 14px; margin-left: 2px; }
.patient-avatar {
  width: 44px; height: 44px; min-width: 44px; border-radius: 16px;
  background: var(--hijau-muda); color: var(--hijau);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.patient-info { flex: 1; min-width: 0; }
.patient-info .p-name { font-weight: 700; font-size: 13.5px; color: var(--hitam); }
.patient-info .p-meta { font-size: 12.5px; color: var(--abu-teks); margin-top: 3px; }
.patient-info .p-meta span { display: inline-block; margin-right: 11px; }
.badge {
  display: inline-block; padding: 3.5px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; margin-top: 7px; margin-right: 5px;
}
.badge-igd { background: #fdecea; color: var(--bahaya); }
.badge-ralan { background: var(--hijau-muda); color: var(--hijau); }
.badge-ranap { background: #fff3e0; color: var(--peringatan); }
.badge-baru { background: #e8f5e9; color: var(--sukses); }
.badge-lama { background: var(--abu-2); color: var(--abu-teks); }

.empty-state { text-align: center; padding: 46px 20px; color: var(--abu-teks); }
.empty-state .fa { font-size: 38px; color: var(--abu-3); margin-bottom: 12px; }

.warn-box {
  background: #fff8e1; color: #8a5d00;
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 12.5px; margin-bottom: 14px;
}
.info-box {
  background: var(--hijau-muda); color: var(--hijau-tua);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 12.5px; margin-bottom: 16px;
  display: flex; gap: 9px; align-items: flex-start;
}
.info-box i { margin-top: 1px; }

/* ---------------- Form generik (dipakai di halaman fitur) ---------------- */
textarea.form-control { padding-left: 14px; min-height: 92px; resize: vertical; font-family: inherit; }
select.form-control { padding-left: 14px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6b73' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .form-row { grid-template-columns: 1fr; } }
.btn-primary {
  width: 100%; background: var(--hijau); color: var(--putih); border: none;
  padding: 14px; border-radius: var(--radius-lg); font-weight: 650; font-size: 14px;
  transition: transform .08s ease, background .15s ease;
}
.btn-primary:active { transform: scale(.98); background: var(--hijau-tua); }
.btn-outline {
  width: 100%; background: var(--abu-1); border: none; color: var(--hitam);
  padding: 13px; border-radius: var(--radius-lg); font-weight: 650; font-size: 13.5px;
  transition: background .15s ease;
}
.btn-outline:active { background: var(--abu-2); }
.chip-check {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; background: var(--abu-1); border-radius: 20px; padding: 9px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--hitam); margin: 0 6px 8px 0; cursor: pointer;
  transition: background .15s ease;
}
.chip-check input { accent-color: var(--hijau); }

.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .form-row-3 { grid-template-columns: 1fr; } }
.vital-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 480px) { .vital-grid { grid-template-columns: repeat(2, 1fr); } }

.field-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.field-label-row .field-label { margin-bottom: 0; }
.mic-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--abu-1); border: none; color: var(--abu-teks);
  font-size: 11px; transition: background .15s ease, color .15s ease;
}
.mic-btn.listening { background: #fdecea; color: var(--bahaya); }

/* Snackbar notifikasi (pengganti modal AdminLTE) */
.snackbar {
  position: fixed; left: 14px; right: 14px; bottom: 90px; z-index: 80;
  max-width: 460px; margin: 0 auto;
  background: var(--hitam); color: var(--putih);
  border-radius: var(--radius); padding: 13px 15px;
  display: none; align-items: center; gap: 11px;
  box-shadow: var(--el-3);
  animation: sb-in .25s ease;
}
.snackbar.show { display: flex; }
@keyframes sb-in { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.snackbar .sb-icon { font-size: 19px; }
.snackbar .sb-text { font-size: 13px; font-weight: 600; line-height: 1.4; }
.snackbar.sb-success .sb-icon { color: #66bb6a; }
.snackbar.sb-warning .sb-icon { color: #ffca28; }
.snackbar.sb-danger .sb-icon { color: #ef5350; }

/* Select2 — disesuaikan ke tema MedicPro, gaya filled */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single {
  height: 46px; border: none; border-radius: var(--radius-sm);
  display: flex; align-items: center; padding: 0 4px; background: var(--abu-1);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 44px; padding-left: 10px; font-size: 14px; color: var(--hitam);
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--abu-3); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 44px; right: 8px; }
.select2-container--default.select2-container--open .select2-selection--single { box-shadow: 0 0 0 2px var(--hijau); background: var(--putih); }
.select2-dropdown { border: none; border-radius: 14px; overflow: hidden; box-shadow: var(--el-2); }
.select2-search--dropdown { padding: 8px; }
.select2-search--dropdown .select2-search__field {
  border-radius: 10px; border: none; background: var(--abu-1); padding: 9px 12px; font-size: 13.5px; outline: none;
}
.select2-results__option { font-size: 13.5px; padding: 9px 12px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--hijau); color: var(--putih); }
.select2-container--default .select2-results__option[aria-selected=true] { background: var(--hijau-muda); }

/* Chip hasil diagnosa/prosedur tersimpan */
.result-list { display: flex; flex-direction: column; gap: 8px; }
.result-item {
  background: var(--putih); border-radius: var(--radius-sm); box-shadow: var(--el-1);
  padding: 12px 14px; display: flex; align-items: flex-start; gap: 10px;
}
.result-item .ri-badge {
  width: 30px; height: 30px; min-width: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.result-item .ri-text { font-size: 13px; color: var(--hitam); line-height: 1.4; }
.result-item .ri-text b { font-weight: 700; }
.result-item .ri-sub { font-size: 11px; color: var(--abu-teks); margin-top: 2px; }
.result-item .ri-price { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--hijau); white-space: nowrap; padding-left: 8px; }
.ri-del-btn {
  background: none; border: none; color: var(--abu-3); font-size: 14px;
  padding: 6px 4px; margin-left: 4px; transition: color .15s ease;
}
.ri-del-btn:hover, .ri-del-btn:active { color: var(--bahaya); }

/* Detail sheet (modal) — untuk melihat isi lengkap satu entri riwayat */
.detail-sheet-overlay {
  position: fixed; inset: 0; background: rgba(10,20,30,0.5);
  display: none; align-items: flex-end; justify-content: center; z-index: 120;
}
.detail-sheet-overlay.show { display: flex; }
.detail-sheet {
  background: var(--putih); width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
  animation: sheet-up .3s cubic-bezier(.2,.8,.2,1);
}
.detail-sheet .ds-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--abu-2); margin: 0 auto 14px; }
.detail-sheet .ds-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.detail-sheet .ds-header h3 { margin: 0 0 3px; font-size: 16px; font-weight: 750; }
.detail-sheet .ds-header p { margin: 0; font-size: 12px; color: var(--abu-teks); }
.detail-sheet .ds-close { background: var(--abu-1); border: none; width: 30px; height: 30px; border-radius: 50%; color: var(--abu-teks); font-size: 13px; }
.detail-sheet .ds-section { margin-bottom: 16px; }
.detail-sheet .ds-label {
  font-size: 10.5px; font-weight: 700; color: var(--hijau); text-transform: uppercase;
  letter-spacing: .4px; margin-bottom: 5px; display: flex; align-items: center; gap: 6px;
}
.detail-sheet .ds-value { font-size: 13.5px; color: var(--hitam); line-height: 1.55; white-space: pre-wrap; }
.detail-sheet .ds-value.empty { color: var(--abu-3); font-style: italic; }
.detail-sheet .ds-vitals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.detail-sheet .ds-vital-item { background: var(--abu-1); border-radius: var(--radius-sm); padding: 9px 6px; text-align: center; }
.detail-sheet .ds-vital-item .v-label { font-size: 10px; color: var(--abu-teks); font-weight: 600; }
.detail-sheet .ds-vital-item .v-value { font-size: 14.5px; font-weight: 750; color: var(--hitam); margin-top: 3px; }
.detail-sheet .ds-footer { display: flex; gap: 10px; margin-top: 18px; }
.detail-sheet .ds-footer > * { flex: 1; text-align: center; }

.chip-search {
  position: relative; margin-bottom: 14px;
}
.chip-search input {
  width: 100%; padding: 12px 14px 12px 38px; border: none;
  border-radius: var(--radius-sm); font-size: 14px; background: var(--abu-1);
  transition: background .15s ease, box-shadow .15s ease;
}
.chip-search input:focus { outline: none; background: var(--putih); box-shadow: 0 0 0 2px var(--hijau); }
.chip-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--abu-3); font-size: 13px; }

.chip-check.price-chip {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  margin: 0 0 8px 0; padding: 12px 14px;
}
.chip-check.price-chip .cc-name { font-size: 13px; font-weight: 600; }
.chip-check.price-chip .cc-price { font-size: 12px; font-weight: 700; color: var(--hijau); white-space: nowrap; margin-left: 10px; }

/* Sub-parameter template lab (di dalam item Order Lab terpilih) */
.lab-item-wrap { margin-bottom: 10px; }
.tmpl-container { margin: 0 0 0 4px; }
.tmpl-list {
  border-left: 3px solid var(--hijau-muda); margin: 8px 0 4px 14px; padding: 10px 0 2px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.tmpl-row .tmpl-row-label { font-size: 12px; font-weight: 650; color: var(--hitam); margin-bottom: 5px; }
.tmpl-row .tmpl-rujukan { font-weight: 500; color: var(--abu-teks); }
.tmpl-row .tmpl-row-inputs { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.tmpl-row .tmpl-row-inputs input { padding: 10px 11px; border: none; background: var(--abu-1); border-radius: var(--radius-sm); font-size: 12.5px; transition: background .15s ease, box-shadow .15s ease; }
.tmpl-row .tmpl-row-inputs input:focus { outline: none; background: var(--putih); box-shadow: 0 0 0 2px var(--hijau); }

.tmpl-detail-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.tmpl-detail-item { background: var(--abu-1); border-radius: var(--radius-sm); padding: 9px 11px; }
.tmpl-detail-item .tdi-nama { font-size: 12.5px; font-weight: 650; color: var(--hitam); }
.tmpl-detail-item .tdi-val { font-size: 12px; color: var(--abu-teks); margin-top: 2px; }
.tmpl-detail-item .tdi-val b { color: var(--hitam); }

/* Tab kategori lab (Patologi Klinik / Patologi Anatomi / Mikrobiologi) */
.kategori-tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kategori-tab {
  flex: 1; min-width: 108px; text-align: center; padding: 11px 8px;
  border-radius: 14px; background: var(--abu-1); font-size: 11.5px; font-weight: 650;
  color: var(--abu-teks); white-space: nowrap; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.kategori-tab.active { background: var(--hijau); color: var(--putih); }

/* Sub-parameter terpilih (checkbox besar, gaya kartu lembut) */
.tmpl-preview-list { margin: 8px 0 4px 0; display: flex; flex-direction: column; }
.tmpl-chip {
  display: flex; align-items: flex-start; gap: 11px;
  width: 100%; padding: 12px 14px; margin: 0 0 8px 0;
  border-radius: var(--radius-sm); background: var(--abu-1);
  cursor: pointer; transition: background .15s ease;
}
.tmpl-chip:active { transform: scale(.99); }
.tmpl-chip input[type=checkbox] {
  margin-top: 2px; width: 19px; height: 19px; min-width: 19px;
  accent-color: var(--hijau); cursor: pointer;
}
.tmpl-chip-text { font-size: 12.5px; color: var(--hitam); line-height: 1.5; }
.tmpl-chip-ref { display: block; font-size: 11px; color: var(--abu-teks); margin-top: 2px; }
.tmpl-chip.tmpl-chip-active { background: var(--hijau-muda); }

/* ---------------- BOTTOM NAV (Android-style, pill indicator) ---------------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--putih);
  display: flex;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px rgba(15,30,45,0.07);
}
.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 7px 2px;
  color: var(--abu-3);
  font-size: 10.5px;
  font-weight: 650;
  border-radius: 16px;
  transition: color .15s ease, background .15s ease;
}
.bottom-nav a .fa { font-size: 18px; transition: transform .15s ease; }
.bottom-nav a.active { color: var(--hijau); background: var(--hijau-muda); }
.bottom-nav a.active .fa { transform: translateY(-1px); }

/* ---------------- SIDEBAR (desktop) ---------------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 234px; background: var(--hitam); color: var(--putih);
  display: none; flex-direction: column; padding: 20px 13px;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 24px; }
.sidebar .brand img { width: 36px; height: 36px; border-radius: 12px; }
.sidebar .brand b { font-size: 15px; }
.sidebar .brand small { display: block; font-size: 10.5px; color: #97a3ab; }
.sidebar a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 14px; color: #c7cfd4;
  font-size: 13.5px; font-weight: 550; margin-bottom: 3px;
  transition: background .15s ease, color .15s ease;
}
.sidebar a .fa { width: 18px; text-align: center; }
.sidebar a.active, .sidebar a:hover { background: var(--hijau); color: var(--putih); }
.sidebar .sidebar-footer { margin-top: auto; padding: 10px 8px; font-size: 12px; color: #7c8991; }
.main-area { flex: 1; min-width: 0; }

@media (min-width: 860px) {
  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  .app-content { padding: 24px 28px 40px; }
  .app-topbar { display: none; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .menu-grid { grid-template-columns: repeat(4, 1fr); max-width: 480px; }
}

/* Install App banner (dalam-aplikasi, setelah login) */
.install-banner {
  position: fixed; left: 14px; right: 14px; bottom: 82px; z-index: 60;
  background: var(--hitam); color: var(--putih);
  border-radius: var(--radius); padding: 13px 14px;
  display: none; align-items: center; gap: 12px;
  box-shadow: var(--el-3);
}
.install-banner.show { display: flex; }
.install-banner .txt { flex: 1; font-size: 12.5px; }
.install-banner .txt b { display: block; font-size: 13.5px; }
.install-banner button { border: none; border-radius: 20px; padding: 9px 13px; font-weight: 650; font-size: 12.5px; }
.install-banner .btn-yes { background: var(--hijau); color: var(--putih); margin-right: 6px; }
.install-banner .btn-no { background: transparent; color: #b9c2c8; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--abu-2); border-radius: 8px; }