* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --biru: #4d9de8;
  --biru-tua: #2f7fd1;
  --biru-muda: #bcdcf5;
  --biru-pucat: #e8f3fd;
  --abu: #f4f4f6;
  --teks: #1f2937;
}
body {
  font-family: 'Segoe UI', 'Poppins', system-ui, sans-serif;
  background: #f4f4f6;
  color: var(--teks);
  min-height: 100vh;
}
.logo { font-size: 1.6rem; color: #fff; display: flex; align-items: center; gap: 10px; }
.logo b { font-weight: 800; }
.logo svg { width: 34px; height: 34px; flex-shrink: 0; }

/* ---- Landing ---- */
.landing {
  min-height: 100vh;
  background: #fff;
  position: relative;
}
.landing-mitra {
  position: absolute; top: 20px; right: 28px; z-index: 10;
  display: flex; align-items: center; gap: 16px;
}
.landing-mitra img { height: 110px; width: auto; display: block; }
.landing-geser {
  display: flex; min-height: 100vh; position: relative;
}
.landing-panel {
  background: linear-gradient(160deg, var(--biru) 0%, var(--biru-tua) 100%);
  width: 40vw; flex-shrink: 0;
  padding: 40px 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #fff;
  min-height: 100vh;
  transition: transform .5s cubic-bezier(.65,0,.35,1);
}
.landing-ilustrasi { width: 100%; max-width: 280px; margin-bottom: 20px; }
.landing-ilustrasi svg { width: 100%; height: auto; }
.landing-judul { font-size: 1.4rem; font-weight: 700; margin-bottom: 10px; line-height: 1.35; }
.landing-sub { font-size: .92rem; color: #eaf4fe; line-height: 1.5; max-width: 300px; }
.landing-form {
  background: #fff;
  width: 60vw; flex-shrink: 0;
  padding: 40px 36px; text-align: center;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
  transition: transform .5s cubic-bezier(.65,0,.35,1);
}
.landing-geser.terbalik .landing-panel { transform: translateX(60vw); }
.landing-geser.terbalik .landing-form { transform: translateX(-40vw); }
.landing .logo { font-size: 1.8rem; margin-bottom: 8px; justify-content: center; color: #1f2937; }
.landing .logo svg { width: 38px; height: 38px; }
.landing p.tagline { color: #4b5563; max-width: 420px; margin: 0 auto 24px; font-size: .92rem; }
.kartu {
  background: transparent; border-radius: 0; padding: 0;
  width: 100%; box-shadow: none;
  text-align: left;
}
.kartu h2 { margin-bottom: 12px; font-size: 1.15rem; }
.kartu + .kartu { margin-top: 16px; }
input, textarea, select {
  width: 100%; padding: 12px 14px; border: 1px solid #d5dbe3; border-radius: 12px;
  font: inherit; margin-bottom: 10px; background: #fff; color: var(--teks);
}
input:focus, textarea:focus { outline: 2px solid var(--biru); border-color: transparent; }
button {
  background: var(--biru); color: #fff; border: 0; border-radius: 12px;
  padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer;
}
button:hover { background: var(--biru-tua); }
button.sekunder { background: var(--biru-pucat); color: var(--biru-tua); }
button.kecil { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
button.bahaya { background: #e05555; }
.penuh { width: 100%; }
.error { color: #d33; font-size: .9rem; min-height: 1.2em; margin-bottom: 6px; }
.edukasi { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: 900px; }
.edukasi div {
  background: rgba(255,255,255,.14); color: #fff; padding: 12px 16px;
  border-radius: 14px; font-size: .85rem; max-width: 260px; text-align: left;
}

/* ---- Layout aplikasi (sidebar + isi) ---- */
.app {
  display: flex; height: 100vh; overflow: hidden;
  background: linear-gradient(160deg, var(--biru-pucat) 0%, #eef6fc 100%);
  padding: 22px; gap: 20px; box-sizing: border-box;
}
.sidebar {
  width: 260px; background: linear-gradient(180deg, var(--biru) 0%, var(--biru-tua) 100%); color: #fff;
  border-radius: 28px; padding: 26px 18px;
  display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
  height: 100%; overflow-y: auto; box-shadow: 0 12px 30px rgba(47,127,209,.25);
}
.sidebar .logo { margin-bottom: 10px; }
.sidebar h3 { font-size: .8rem; font-weight: 600; margin: 20px 4px 8px; color: #d9ecfb; text-transform: uppercase; letter-spacing: .04em; }
.sidebar .item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 14px; cursor: pointer; font-size: .92rem;
}
.sidebar .item:hover { background: rgba(255,255,255,.14); }
.sidebar .item.aktif { background: #fff; color: var(--biru-tua); font-weight: 700; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff; flex-shrink: 0; }
.avatar.abu { background: #ccc; }
.avatar-dokter {
  border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; letter-spacing: .02em;
}
.sidebar .bawah { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.18); }
.isi {
  flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: #fff; border-radius: 28px; box-shadow: 0 12px 34px rgba(20,40,70,.08);
}

/* ---- Chat ---- */
.chat-header {
  background: #fff; padding: 20px 28px; border-radius: 28px 28px 0 0;
  border-bottom: 1px solid #eef0f3;
  display: flex; align-items: center; gap: 14px; font-size: 1.05rem; font-weight: 700;
}
.chat-header .avatar { width: 46px; height: 46px; }
.chat-header-aksi { display: flex; gap: 10px; margin-left: auto; }
.chat-header-aksi span {
  width: 38px; height: 38px; border-radius: 12px; background: var(--biru-pucat); color: var(--biru-tua);
  display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0;
}
.chat-pesan { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 32px; display: flex; flex-direction: column; gap: 14px; background: #fbfdff; }
.gelembung {
  max-width: 62%; padding: 14px 18px; border-radius: 18px;
  background: #fff; border: 1.5px solid var(--biru-muda); color: var(--teks);
  white-space: pre-wrap; line-height: 1.45; font-size: .95rem;
}
.baris { display: flex; gap: 12px; align-items: flex-start; }
.baris.kanan { justify-content: flex-end; }
.baris.kanan .gelembung { background: var(--biru); border-color: var(--biru); color: #fff; border-bottom-right-radius: 4px; }
.baris:not(.kanan):not(.sistem) .gelembung { border-bottom-left-radius: 4px; }
.baris.sistem { justify-content: center; }
.baris.sistem .gelembung { background: #fff7e0; border-color: #ffe9a8; font-size: .85rem; max-width: 80%; text-align: center; }
.chat-input { display: flex; gap: 12px; padding: 18px 32px 26px; align-items: center; background: #fff; border-radius: 0 0 28px 28px; }
.chat-input input { flex: 1; border-radius: 999px; padding: 14px 20px; margin: 0; background: #f2f6fb; border: 1px solid #e5edf5; }
.chat-input button { border-radius: 50%; width: 52px; height: 52px; font-size: 1.2rem; flex-shrink: 0; background: var(--biru-tua); }
.chat-input button:hover { background: var(--biru); }

/* ---- Panel / dashboard ---- */
.panel { padding: 28px 32px; overflow-y: auto; flex: 1; min-height: 0; }
.panel h2 { margin-bottom: 16px; }
.kotak { background: #fff; border-radius: 16px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.kotak h3 { margin-bottom: 10px; font-size: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
th { color: #6b7280; font-weight: 600; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; background: var(--biru-pucat); color: var(--biru-tua); }
.badge.hijau { background: #e3f7e8; color: #1e8f42; }
.badge.merah { background: #fde8e8; color: #c53030; }
.badge.kuning { background: #fff4d6; color: #9a6b00; }
.riwayat-kartu {
  background: #fff; border: 1px solid #e8eaee; border-radius: 14px; padding: 14px;
  margin-bottom: 10px; cursor: pointer;
}
.riwayat-kartu:hover { border-color: var(--biru); }
.riwayat-kartu.aktif { border-color: var(--biru-tua); background: var(--biru-pucat); }
.riwayat-kartu-judul { font-weight: 700; margin-bottom: 6px; }
.riwayat-kartu-meta { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.riwayat-kartu-tanggal { font-size: .8rem; color: #6b7280; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 16px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.stat .angka { font-size: 1.9rem; font-weight: 700; color: var(--biru-tua); }
.stat .label { font-size: .85rem; color: #6b7280; }
.dua-kolom { display: grid; grid-template-columns: 1fr 380px; gap: 0; flex: 1; min-height: 0; overflow: hidden; }
.samping { border-left: 1px solid #e5e8ec; background: #fff; padding: 20px; overflow-y: auto; min-height: 0; font-size: .9rem; }
.samping h3 { margin: 14px 0 8px; font-size: .95rem; color: var(--biru-tua); }
.samping pre { white-space: pre-wrap; font: inherit; background: var(--biru-pucat); padding: 12px; border-radius: 10px; }
.samping ol { padding-left: 18px; }
.samping li { margin-bottom: 6px; }
textarea.diagnosis { min-height: 180px; font-size: .9rem; }
.tersembunyi { display: none !important; }

/* ---- Popup / modal ---- */
.modal-latar {
  position: fixed; inset: 0; background: rgba(20,30,45,.55);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal {
  background: #fff; border-radius: 18px; padding: 28px; max-width: 420px; width: 100%;
  text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal .ikon { font-size: 2.4rem; margin-bottom: 10px; }
.modal h3 { margin-bottom: 8px; }
.modal p { color: #6b7280; font-size: .92rem; margin-bottom: 18px; line-height: 1.5; }
.modal .aksi { display: flex; gap: 10px; flex-direction: column; }

/* ---- Chip rekomendasi pertanyaan di bawah kolom ketik ---- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 32px 16px; }
.chips .chip {
  background: var(--biru-pucat); color: var(--biru-tua);
  border-radius: 999px; padding: 6px 14px; font-size: .8rem; cursor: pointer;
  border: 1px solid transparent; max-width: 100%;
}
.chips .chip:hover { border-color: var(--biru); }

/* ---- Pemilihan dokter (ala marketplace) ---- */
.picker { padding: 20px 28px; overflow-y: auto; flex: 1; min-height: 0; }
.picker h2 { margin-bottom: 4px; }
.picker p.sub { color: #6b7280; font-size: .9rem; margin-bottom: 18px; }
.dokter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.dokter-kartu {
  background: #fff; border: 1px solid #e8eaee; border-radius: 16px; padding: 16px;
  display: flex; gap: 14px; align-items: flex-start; box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.dokter-kartu.offline { opacity: .55; }
.dokter-foto { flex-shrink: 0; }
.dokter-info { flex: 1; min-width: 0; }
.dokter-info .nama { font-weight: 700; margin-bottom: 2px; }
.dokter-info .spes { color: #6b7280; font-size: .85rem; margin-bottom: 6px; }
.dokter-info .bio { color: #9aa1ab; font-size: .78rem; margin-bottom: 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.titik { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.titik.online { background: #22b455; }
.titik.offline { background: #b8bec7; }
label.saklar { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; color: #fff; }
label.saklar input { width: auto; margin: 0; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; max-height: 45vh; border-radius: 0 0 20px 20px;
    padding: 14px 16px; z-index: 50;
  }
  .sidebar h3 { margin: 10px 0 6px; }
  .sidebar .bawah { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
  .chat-header { padding: 14px 16px; font-size: 1.05rem; }
  .chat-pesan { padding: 16px 14px; }
  .chat-input { padding: 12px 14px 18px; }
  .chat-input button { width: 46px; height: 46px; }
  .panel, .picker { padding: 18px 14px; }
  .kotak { padding: 14px; overflow-x: auto; }
  table { font-size: .82rem; }
  th, td { padding: 6px; }
  .dua-kolom { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.4fr) minmax(0, 1fr); overflow-y: auto; }
  .samping { border-left: 0; border-top: 1px solid #e5e8ec; }
  .gelembung { max-width: 85%; font-size: .9rem; }
  .dokter-grid { grid-template-columns: 1fr; }
  .landing .logo { font-size: 1.5rem; }
  .kartu { padding: 0; }
  input, textarea, button { font-size: .95rem; }
  .landing-geser { flex-direction: column; min-height: auto; }
  .landing-panel { width: 100%; min-height: auto; padding: 32px 24px; }
  .landing-form { width: 100%; min-height: auto; padding: 28px 20px; }
  .landing-geser.terbalik .landing-panel,
  .landing-geser.terbalik .landing-form { transform: none; }
  .landing-ilustrasi { max-width: 200px; }
  .landing-mitra { position: static; justify-content: center; padding: 14px 0; }
  .landing-mitra img { height: 50px; }
}
