/* =========================================================
   Beranda RSUD - bagian "Layanan" (jadwal dokter & ketersediaan kamar), desain sama dengan portal PPID.
   Semua selector berawalan .bm- agar tidak memengaruhi gaya situs lama.
   ========================================================= */

.bm-section {
  --bm-navy: var(--ui-navy, #234974);
  --bm-navy-d: #183556;
  --bm-teal: var(--ui-teal, #47a88e);
  --bm-teal-d: var(--ui-teal-d, #2c8a71);
  --bm-amber: var(--ui-amber, #eb8423);
  --bm-red: #d64545;
  --bm-ink: #1b2a3b;
  --bm-mut: #64748b;
  --bm-line: #e3eaf1;
  --bm-bg: #f5f9fa;
  position: relative;
  padding: 72px 0;
  color: var(--bm-ink);
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
  text-align: left;
}
.bm-section *, .bm-section *::before, .bm-section *::after { box-sizing: border-box; }
.bm-soft { background: var(--bm-bg); }
.bm-white { background: #fff; }

/* timpa gaya global situs hanya di dalam komponen ini */
.bm-section p { font-size: 15px; line-height: 1.6; color: var(--bm-mut); margin: 0; }
.bm-section a, .bm-section a:hover, .bm-section a:focus { font-size: inherit; font-weight: 700; color: inherit; transition: color .2s, background .2s, box-shadow .2s, transform .2s; }
.bm-section h2, .bm-section h3, .bm-section h4 { color: var(--bm-navy); font-family: inherit; }
.bm-section button { font-family: inherit; }

.bm-section [hidden] { display: none !important; }

.bm-wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- judul bagian ---------- */
.bm-head { text-align: center; margin-bottom: 44px; }
.bm-eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--bm-teal-d); }
.bm-title { margin: 8px 0 10px; font-size: clamp(22px, 2.8vw, 32px); font-weight: 800; letter-spacing: .01em; text-transform: uppercase; line-height: 1.25; }
.bm-title::after { content: ""; display: block; width: 64px; height: 4px; border-radius: 4px; margin: 14px auto 0; background: linear-gradient(90deg, var(--bm-teal), var(--bm-amber)); }
.bm-section .bm-sub { max-width: 620px; margin: 0 auto; text-align: center; }

/* ---------- kartu ---------- */
.bm-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.bm-card { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--bm-line); border-radius: 22px; box-shadow: 0 12px 34px rgba(35, 73, 116, .08); overflow: hidden; }
.bm-card-h { display: flex; align-items: center; gap: 14px; padding: 22px 26px 16px; }
.bm-ico { flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(135deg, var(--bm-navy), var(--bm-teal)); box-shadow: 0 8px 18px rgba(35, 73, 116, .22); }
.bm-ico svg { width: 24px; height: 24px; }
.bm-card-t { flex: 1 1 auto; min-width: 0; }
.bm-card-t h3 { margin: 0; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; }
.bm-card-t span { display: block; margin-top: 2px; font-size: 13px; color: var(--bm-mut); font-weight: 400; }
.bm-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--bm-teal-d); background: #e7f5f0; white-space: nowrap; }
.bm-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bm-teal); animation: bm-pulse 1.8s ease-out infinite; }
.bm-card-f { margin-top: auto; padding: 16px 26px 22px; border-top: 1px solid var(--bm-line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.bm-note { font-size: 12.5px; color: var(--bm-mut); font-weight: 400; }
.bm-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-size: 14px !important; color: #fff !important; background: var(--bm-navy); box-shadow: 0 8px 18px rgba(35, 73, 116, .22); }
.bm-link:hover { background: var(--bm-teal-d); transform: translateY(-1px); }
.bm-link svg { width: 16px; height: 16px; }

/* ---------- jadwal dokter ---------- */
.bm-days { display: flex; gap: 8px; padding: 0 26px 14px; overflow-x: auto; scrollbar-width: none; }
.bm-days::-webkit-scrollbar { display: none; }
.bm-day { position: relative; flex: 1 0 auto; min-width: 56px; padding: 9px 14px; border: 1px solid var(--bm-line); border-radius: 13px; background: #fff; color: var(--bm-mut); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: all .2s; }
.bm-day:hover { border-color: var(--bm-teal); color: var(--bm-navy); }
.bm-day[aria-selected="true"] { background: var(--bm-navy); border-color: var(--bm-navy); color: #fff; box-shadow: 0 8px 18px rgba(35, 73, 116, .24); }
.bm-day.is-today::after { content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--bm-teal); box-shadow: 0 0 0 2px #fff; }
.bm-day:focus-visible { outline: 3px solid rgba(71, 168, 142, .55); outline-offset: 2px; }

.bm-searchbox { position: relative; margin: 0 26px 6px; }
.bm-searchbox svg { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--bm-mut); pointer-events: none; }
.bm-search { width: 100%; height: 46px; padding: 0 16px 0 44px; border: 1px solid var(--bm-line); border-radius: 14px; background: #f8fbfc; font-size: 15px; color: var(--bm-ink); outline: 0; transition: border-color .2s, box-shadow .2s, background .2s; }
.bm-search:focus { border-color: var(--bm-teal); background: #fff; box-shadow: 0 0 0 4px rgba(71, 168, 142, .15); }

.bm-scroll { max-height: 430px; overflow-y: auto; padding: 0 26px 6px; scrollbar-width: thin; scrollbar-color: #c5d3df transparent; }
.bm-poli { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 0 8px; background: #fff; }
.bm-poli h4 { margin: 0; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; }
.bm-poli em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--bm-teal-d); background: #e7f5f0; padding: 3px 10px; border-radius: 999px; }
.bm-doc { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 12px; margin: 0 -12px; border-radius: 14px; transition: background .2s; }
.bm-doc:hover { background: #f3f8fa; }
.bm-av { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .04em; background: var(--c, var(--bm-navy)); }
.bm-av svg { width: 22px; height: 22px; }
.bm-doc-n { min-width: 0; font-size: 15.5px; font-weight: 700; color: var(--bm-ink); line-height: 1.3; overflow-wrap: anywhere; }
.bm-time { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--bm-navy); background: #eaf1f8; }
.bm-time.is-live { color: #17745b; background: #e2f5ee; }
.bm-time.is-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bm-teal); animation: bm-pulse 1.8s ease-out infinite; }
.bm-empty { padding: 34px 10px; text-align: center; color: var(--bm-mut); font-size: 15px; }
.bm-empty svg { display: block; width: 44px; height: 44px; margin: 0 auto 10px; color: #b7c6d4; }

/* ---------- ketersediaan kamar ---------- */
.bm-bed-top { display: flex; align-items: center; gap: 26px; padding: 4px 26px 20px; }
.bm-donut { position: relative; flex: 0 0 auto; width: 132px; height: 132px; }
.bm-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.bm-donut circle { fill: none; stroke-width: 12; }
.bm-donut .bg { stroke: #e8eef4; }
.bm-donut .fg { stroke: var(--bm-teal); stroke-linecap: round; transition: stroke-dasharray 1s ease; }
.bm-donut .fg.is-hi { stroke: var(--bm-amber); }
.bm-donut .fg.is-full { stroke: var(--bm-red); }
.bm-donut b { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: 28px; line-height: 1; color: var(--bm-navy); }
.bm-donut small { display: block; margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--bm-mut); }
.bm-kpis { flex: 1 1 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bm-kpi { padding: 12px 10px; border-radius: 16px; text-align: center; background: #f3f8fa; }
.bm-kpi b { display: block; font-size: 26px; line-height: 1.1; color: var(--bm-navy); }
.bm-kpi span { display: block; margin-top: 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--bm-mut); font-weight: 700; }
.bm-kpi.ok b { color: var(--bm-teal-d); }
.bm-kpi.use b { color: var(--bm-amber); }

.bm-kelas { padding: 0 26px 14px; }
.bm-kelas-row { padding: 10px 0; }
.bm-kelas-row + .bm-kelas-row { border-top: 1px dashed var(--bm-line); }
.bm-kelas-hd { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14.5px; font-weight: 700; color: var(--bm-ink); }
.bm-kelas-hd span { font-size: 13px; color: var(--bm-mut); font-weight: 400; }
.bm-bar { height: 9px; margin-top: 8px; border-radius: 999px; background: #e8eef4; overflow: hidden; }
.bm-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--bm-teal), #6cc7ad); }
.bm-bar i.is-hi { background: linear-gradient(90deg, var(--bm-amber), #f3a95a); }
.bm-bar i.is-full { background: linear-gradient(90deg, var(--bm-red), #ea7b7b); }

.bm-rooms-h { padding: 4px 26px 8px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--bm-mut); }
.bm-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 250px; overflow-y: auto; padding: 0 26px 10px; scrollbar-width: thin; scrollbar-color: #c5d3df transparent; }
.bm-room { display: flex; flex-direction: column; gap: 4px; padding: 11px 13px; border-radius: 14px; border: 1px solid var(--bm-line); background: #fff; min-width: 0; }
.bm-room strong { font-size: 13.5px; line-height: 1.25; color: var(--bm-ink); overflow-wrap: anywhere; }
.bm-room span { font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.bm-room.is-ok { border-color: #bfe5d8; background: #f2fbf8; }
.bm-room.is-ok span { color: #17745b; }
.bm-room.is-full { border-color: #f1c4c4; background: #fff6f6; }
.bm-room.is-full span { color: #b83a3a; }
.bm-room.is-off { background: #f6f8fa; }
.bm-room.is-off strong, .bm-room.is-off span { color: #98a6b5; }


@keyframes bm-pulse { 0% { box-shadow: 0 0 0 0 rgba(71, 168, 142, .55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(71, 168, 142, 0); } }

/* tujuan tautan #layanan-rs tidak tertutup menu yang menempel di atas */
.bm-section[id] { scroll-margin-top: 90px; }

/* ---------- responsif ---------- */
@media (max-width: 991px) {
  .bm-section { padding: 56px 0; }
  .bm-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
  .bm-wrap { padding: 0 14px; }
  .bm-head { margin-bottom: 30px; }
  .bm-card-h, .bm-bed-top, .bm-kelas, .bm-rooms-h, .bm-rooms, .bm-scroll, .bm-days, .bm-card-f { padding-left: 18px; padding-right: 18px; }
  .bm-searchbox { margin-left: 18px; margin-right: 18px; }
  .bm-card-h { flex-wrap: wrap; }
  .bm-card-f { flex-direction: column; align-items: flex-start; }
  .bm-bed-top { flex-direction: column; align-items: stretch; }
  .bm-donut { margin: 0 auto; }
  .bm-doc { grid-template-columns: 38px minmax(0, 1fr); }
  .bm-doc .bm-time { grid-column: 2; justify-self: start; }
  .bm-av { width: 38px; height: 38px; }
  .bm-av svg { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .bm-section *, .bm-section *::before, .bm-section *::after { animation: none !important; transition: none !important; }
}
