/* denyut.id - CSS murni, mobile-first. Semua warna & ukuran lewat design tokens di :root. */
:root {
  --ink: #101828;
  --ink-2: #344054;
  --muted: #5d6b7e;
  --bg: #f6f8f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --brand: #0b7a6e;
  --brand-hover: #09665c;
  --brand-deep: #064e46;
  --brand-tint: #e7f5f2;
  --brand-ring: rgba(11, 122, 110, 0.28);
  --danger: #b42318;
  --danger-tint: #fef1f0;
  --warn: #93540a;
  --warn-tint: #fef6e7;
  --ok: #067647;
  --ok-tint: #e9f7ef;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 16rem;
  --topbar-h: 3.5rem;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 1px 3px rgba(16, 24, 40, 0.06), 0 8px 24px -12px rgba(16, 24, 40, 0.14);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, 0.04), 0 24px 48px -16px rgba(16, 24, 40, 0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; letter-spacing: -0.015em; font-weight: 650; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.125rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.icon { flex: none; display: block; }
.visually-hidden, .hp {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link {
  position: absolute; left: 0.5rem; top: -4rem; background: var(--brand); color: #fff;
  padding: 0.5rem 0.9rem; border-radius: var(--radius-sm); z-index: 100;
}
.skip-link:focus { top: 0.5rem; color: #fff; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--brand); text-decoration: none; }
.logo__mark { flex: none; display: block; }
.logo__text { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.03em; color: var(--ink); }
.site-logo, .platform-bar__brand { text-decoration: none; display: inline-flex; }

/* ---------- App shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 0.75rem; padding: 0 1rem;
  background: rgba(255, 255, 255, 0.92); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(8px);
}
.topbar__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .logo__mark { width: 26px; height: 26px; }
.menu-btn {
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); cursor: pointer;
}
.menu-btn:hover { background: var(--surface-2); }
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block; width: 1.1rem; height: 2px; border-radius: 2px; background: currentColor; content: ""; position: relative;
}
.menu-btn span::before { position: absolute; top: -6px; }
.menu-btn span::after { position: absolute; top: 6px; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(var(--sidebar-w), 86vw);
  display: flex; flex-direction: column; padding: 1rem 0.85rem; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line); color: var(--ink-2);
  transform: translateX(-100%); transition: transform 0.2s ease;
}
.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(16, 24, 40, 0.45); display: none; }
.nav-open .scrim { display: block; }
.brand { padding: 0.25rem 0.5rem 1rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--line); display: grid; gap: 0.85rem; }
.brand__clinic { display: block; font-size: 0.95rem; font-weight: 650; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.brand__app { display: block; font-size: 0.78rem; color: var(--muted); }
.brand__card { padding: 0.6rem 0.75rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.nav a {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.nav a .icon { color: var(--muted); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-deep); font-weight: 600; }
.nav a[aria-current="page"] .icon { color: var(--brand); }
.sidebar__foot { margin-top: auto; padding-top: 0.85rem; border-top: 1px solid var(--line); display: grid; gap: 0.15rem; }
.whoami { display: flex; align-items: center; gap: 0.65rem; padding: 0.25rem 0.5rem 0.6rem; min-width: 0; }
.whoami__text { min-width: 0; }
.whoami strong { display: block; color: var(--ink); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami__text span { display: block; font-size: 0.78rem; color: var(--muted); }
.avatar {
  flex: none; width: 2.1rem; height: 2.1rem; border-radius: 999px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-deep); font-weight: 700; font-size: 0.9rem;
}
.sidebar__foot a, .sidebar__foot button.linklike {
  display: flex; align-items: center; gap: 0.7rem; width: 100%; text-align: left; padding: 0.5rem 0.7rem; border-radius: var(--radius-sm);
  color: var(--ink-2); background: none; border: 0; font: inherit; font-size: 0.92rem; cursor: pointer; text-decoration: none;
}
.sidebar__foot .icon { color: var(--muted); }
.sidebar__foot a:hover, .sidebar__foot button.linklike:hover { background: var(--surface-2); color: var(--ink); }

.main { padding: 1.25rem 1rem 3rem; max-width: 74rem; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.5rem; }
.page-head h1 { margin-bottom: 0.2rem; }
.page-head p { margin: 0; color: var(--muted); }

@media (min-width: 60em) {
  .topbar, .scrim, .menu-btn { display: none !important; }
  .sidebar { transform: none; width: var(--sidebar-w); box-shadow: none !important; }
  .main-wrap { margin-left: var(--sidebar-w); }
  .main { padding: 2.25rem 2.5rem 4rem; }
}

/* ---------- Components ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow);
}
@media (min-width: 48em) { .card { padding: 1.5rem; } }
.card + .card { margin-top: 1rem; }
.grid-2 > .card { margin-top: 0; }
.card > h2:first-child { margin-bottom: 0.75rem; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 48em) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.mt { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mb { margin-bottom: 1rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 2.5rem; padding: 0.45rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow); transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn--danger { color: var(--danger); border-color: #f2c4bf; }
.btn--danger:hover { background: var(--danger-tint); border-color: #eaa49c; color: var(--danger); }
.btn--sm { min-height: 2rem; padding: 0.2rem 0.7rem; font-size: 0.85rem; }
.btn--lg { min-height: 3rem; padding: 0.6rem 1.35rem; font-size: 1rem; }
.btn--block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Atribut hidden harus selalu menang atas display milik class (mis. .badge). */
[hidden] { display: none !important; }

.badge {
  display: inline-flex; align-items: center; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: var(--brand-tint); color: var(--brand-deep); white-space: nowrap; border: 1px solid rgba(11, 122, 110, 0.15);
}
.badge--ok { background: var(--ok-tint); color: var(--ok); border-color: rgba(6, 118, 71, 0.18); }
.badge--off { background: #f2f4f7; color: var(--muted); border-color: var(--line); }
.badge--warn { background: var(--warn-tint); color: var(--warn); border-color: rgba(147, 84, 10, 0.18); }
.badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid; font-size: 0.95rem; }
.alert--success { background: var(--ok-tint); border-color: #abdfc2; color: #05532f; }
.alert--error { background: var(--danger-tint); border-color: #f5c2bc; color: #7a1a12; }
.alert--warning { background: var(--warn-tint); border-color: #f1d39a; color: #6b3d06; }
.alert--info { background: var(--brand-tint); border-color: #b3ddd5; color: var(--brand-deep); }
.alert ul { margin: 0; padding-left: 1.1rem; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label, .field .label { display: block; font-weight: 600; font-size: 0.9rem; color: var(--ink-2); margin-bottom: 0.35rem; }
.input {
  width: 100%; min-height: 2.6rem; padding: 0.5rem 0.75rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: #98a2b3; }
.input:hover { border-color: #98a2b3; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.18); }
.input:disabled { background: #f2f4f7; color: var(--muted); box-shadow: none; }
textarea.input { min-height: 7rem; resize: vertical; }
.help { font-size: 0.85rem; color: var(--muted); margin: 0.35rem 0 0; }
.help ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
.error { font-size: 0.85rem; color: var(--danger); margin: 0.35rem 0 0; font-weight: 550; }
.check { display: flex; align-items: flex-start; gap: 0.6rem; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; accent-color: var(--brand); flex: none; }
.field .check label { margin: 0; font-weight: 550; color: var(--ink); font-size: 0.95rem; }
.choice-list > div { display: flex; flex-direction: column; gap: 0.4rem; }
.field .choice-list label { display: flex; align-items: center; gap: 0.6rem; font-weight: 500; margin: 0; color: var(--ink); font-size: 0.95rem; }
.choice-list input { width: 1.15rem; height: 1.15rem; accent-color: var(--brand); }
.form-grid { display: grid; gap: 0 1.25rem; }
@media (min-width: 48em) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }
.form-narrow { max-width: 34rem; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table tbody tr:hover td { background: #fbfcfc; }
.table tr:last-child td { border-bottom: 0; }
.table .nowrap { white-space: nowrap; }
.cell-sub { display: block; font-size: 0.85rem; color: var(--muted); }
.inline-form { display: inline; }
@media (max-width: 47.99em) {
  .table--stack thead { position: absolute; left: -9999px; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
  .table--stack tr:last-child { border-bottom: 0; }
  .table--stack td { border: 0; padding: 0.3rem 1rem; }
  .table--stack td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
}

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; gap: 1rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.stat { font-size: 2.1rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- Halaman tanpa sidebar (login, galat, platform) ---------- */
.plain { min-height: 100vh; display: flex; flex-direction: column; }
.plain > main { flex: 1; }
.plain__bar { display: flex; align-items: center; padding: 1rem 1.25rem; }
.plain__messages { width: min(26rem, 100% - 2rem); margin: 1rem auto 0; }
.plain__foot { padding: 1.5rem 1rem; text-align: center; font-size: 0.85rem; color: var(--muted); }
.login { width: min(26rem, 100% - 2rem); margin: 6vh auto 2rem; }
.login > h1 { font-size: 1.55rem; margin-bottom: 0.3rem; }
.login > h1 + .muted { margin-bottom: 1.5rem; }
.login .card { box-shadow: var(--shadow-md); }
.login__icon {
  width: 3rem; height: 3rem; border-radius: 14px; display: grid; place-items: center; margin-bottom: 1.25rem;
  background: var(--brand-tint); color: var(--brand); border: 1px solid rgba(11, 122, 110, 0.15);
}
.login__icon .icon { width: 24px; height: 24px; }
.login__note { margin-top: 1.25rem; text-align: center; }
.login__url { display: block; padding: 0.6rem 0.75rem; margin-bottom: 1rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Landing (domain utama) ---------- */
.site { background: var(--surface); }
.site-header {
  position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(10px);
}
.site-header__inner, .section__inner, .site-footer__inner { width: min(72rem, 100% - 2rem); margin: 0 auto; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4rem; }
.site-nav { display: flex; align-items: center; gap: 0.25rem; }
.site-nav > a:not(.btn) { padding: 0.4rem 0.7rem; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.site-nav > a:not(.btn):hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 39.99em) { .site-nav > a:not(.btn) { display: none; } }

.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(11, 122, 110, 0.10), transparent 60%),
    radial-gradient(40rem 24rem at -10% 10%, rgba(11, 122, 110, 0.06), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}
.hero__inner { width: min(72rem, 100% - 2rem); margin: 0 auto; padding: 3rem 0 3.5rem; display: grid; gap: 2.5rem; }
@media (min-width: 62em) { .hero__inner { grid-template-columns: minmax(0, 1fr) 27rem; align-items: start; gap: 4rem; padding: 5rem 0 5.5rem; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.8rem 0.3rem 0.4rem; margin-bottom: 1.25rem;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 0.85rem; font-weight: 550; color: var(--ink-2);
}
.eyebrow__dot { padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--brand-tint); color: var(--brand-deep); font-size: 0.75rem; font-weight: 700; }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); line-height: 1.08; letter-spacing: -0.035em; font-weight: 750; max-width: 18ch; margin-bottom: 1.25rem; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero__lead { font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--ink-2); max-width: 36rem; margin-bottom: 2rem; }
.find-box { max-width: 34rem; }
.find-box__label { display: block; font-weight: 600; font-size: 0.9rem; color: var(--ink-2); margin-bottom: 0.5rem; }
.find { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.find__field {
  flex: 1 1 15rem; min-width: 0; display: flex; align-items: center; min-height: 3rem; padding: 0 0.85rem;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.find__field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.find__field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); padding: 0.5rem 0; }
.find__field input::placeholder { color: #98a2b3; }
.suffix { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.find .btn { flex: 0 0 auto; }
@media (max-width: 29.99em) { .find .btn { flex: 1 1 100%; } }
.ticks { list-style: none; margin: 2rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; color: var(--ink-2); font-size: 0.92rem; }
.ticks li { display: flex; align-items: center; gap: 0.45rem; }
.ticks .icon { color: var(--brand); width: 18px; height: 18px; }

.signup-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; box-shadow: var(--shadow-lg); }
@media (min-width: 48em) { .signup-card { padding: 1.75rem; } }
.signup-card h2 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.signup-card > p { margin-bottom: 1.25rem; }
.signup-card .form-grid { gap: 0 0.85rem; }
@media (min-width: 30em) { .signup-card .form-grid { grid-template-columns: 1fr 1fr; } }
.signup-card .form-grid > .field:not(.field--half) { grid-column: 1 / -1; }

.section { padding: 4rem 0; }
@media (min-width: 48em) { .section { padding: 5.5rem 0; } }
.section--muted { background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { max-width: 40rem; margin-bottom: 2.5rem; }
.section__kicker { display: block; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); margin-bottom: 0.6rem; }
.section__head h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 0.75rem; }
.section__head p { color: var(--ink-2); font-size: 1.05rem; margin: 0; }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 40em) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62em) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } }
.feature { padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.feature h3 { font-size: 1.05rem; margin: 1rem 0 0.4rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.feature__icon { width: 2.6rem; height: 2.6rem; border-radius: 10px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; counter-reset: step; }
@media (min-width: 48em) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; } }
.steps li { counter-increment: step; padding-top: 1.25rem; border-top: 2px solid var(--line); }
.steps li::before { content: "0" counter(step); display: block; font-size: 0.85rem; font-weight: 700; color: var(--brand); margin-bottom: 0.5rem; font-variant-numeric: tabular-nums; }
.steps h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.cta { text-align: center; }
.cta h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); letter-spacing: -0.03em; margin-bottom: 0.75rem; }
.cta p { color: var(--ink-2); max-width: 34rem; margin: 0 auto 1.75rem; }
.cta .actions { justify-content: center; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; padding: 1.75rem 0; font-size: 0.875rem; color: var(--muted); }
.site-footer__inner p { margin: 0; }
.site-footer .logo__text { font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) { html:focus-within { scroll-behavior: smooth; } }

/* ---------- Tahap 2: toolbar, tab status, chip, form multi-kolom ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.toolbar > .input[type="search"] { flex: 1 1 14rem; min-width: 0; }
.toolbar__check { align-items: center; }
.date-nav { display: flex; align-items: center; gap: 0.4rem; }
.date-nav .input { width: auto; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-left: auto; }
.tabs a {
  padding: 0.35rem 0.75rem; border-radius: 999px; text-decoration: none; color: var(--ink-2);
  border: 1px solid transparent; font-size: 0.9rem;
}
.tabs a:hover { background: var(--surface); border-color: var(--line); }
.tabs a[aria-current="true"] { background: var(--brand); color: #fff; font-weight: 600; }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0.25rem 0.2rem 0.75rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
}
.chip button {
  border: 0; background: var(--danger-tint); color: var(--danger); border-radius: 999px;
  padding: 0.15rem 0.6rem; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.chip button:hover { background: #f9d0cc; }
.inline-fields { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.form-grid--4 { grid-template-columns: 1fr; }
@media (min-width: 48em) { .form-grid--4 { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); } }
h3 { font-size: 1rem; margin: 0 0 0.75rem; }

/* ---------- Tahap 3: rekam medis ---------- */
.input--auto { width: auto; min-width: 11rem; }
.workspace { display: grid; gap: 1rem; align-items: start; }
.workspace__main, .workspace__side { display: grid; gap: 1rem; min-width: 0; }
/* Kartu di dalam form (layar dokter) bukan anak langsung grid, jadi form-nya ikut dijadikan grid. */
.workspace__main > form, .workspace__side > form { display: grid; gap: 1rem; min-width: 0; }
.workspace__main > form > .form-actions { margin-top: 0; }
.workspace .card + .card { margin-top: 0; }
@media (min-width: 64em) { .workspace { grid-template-columns: minmax(0, 1fr) 22rem; } }
.soap-read { margin-bottom: 1rem; }
.soap-read h3 { margin-bottom: 0.2rem; }
.soap-read p { margin: 0; }
.addendum { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.addendum p { margin: 0 0 0.25rem; }
.history { margin: 0 0 0.6rem; }
.history a { font-weight: 600; }

/* Diagnosis */
.dx-list { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 0.5rem; }
.dx {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.6rem 0.75rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.dx__code { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--brand-deep); }
.dx__text { flex: 1 1 12rem; min-width: 0; }
.dx__primary { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.875rem; font-weight: 600; }
.dx__primary input { accent-color: var(--brand); width: 1.05rem; height: 1.05rem; }
.dx .btn { margin-left: auto; }
.autocomplete { position: relative; }
.autocomplete__list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: 0.25rem; list-style: none;
  max-height: 18rem; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.autocomplete__list[hidden] { display: none; }
.autocomplete__list li { display: flex; gap: 0.6rem; padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); cursor: pointer; }
.autocomplete__list li[aria-selected="true"], .autocomplete__list li:hover { background: var(--brand-tint); }
.autocomplete__list .dx__code { flex: none; min-width: 3.6rem; }
.autocomplete__none { padding: 0.6rem; color: var(--muted); }

/* Income */
.table--compact th, .table--compact td { padding: 0.5rem 0.25rem; }
.table--compact .amount, .amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table--compact .total td { font-weight: 650; border-top: 2px solid var(--line-strong); }

/* Attachments */
.gallery { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.75rem; }
.gallery li { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.gallery img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #f2f4f7; display: block; }
.gallery__caption { font-size: 0.875rem; overflow-wrap: anywhere; }
.upload-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.file-btn { position: relative; }
.file-btn:focus-within { outline: 3px solid var(--brand-ring); outline-offset: 2px; }
button:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Bar aksi menempel di bawah layar (nyaman di HP) */
.sticky-actions {
  position: sticky; bottom: 0; z-index: 10; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem;
  padding: 0.75rem 1rem; margin-top: 1rem; background: rgba(246, 248, 249, 0.94);
  border-top: 1px solid var(--line-strong); backdrop-filter: blur(4px);
}

/* ---------- Tahap 4: laporan ---------- */
.tabs--left { margin-left: 0; margin-bottom: 0.75rem; }
.stats { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1rem; }
@media (min-width: 40em) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64em) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-card { display: flex; flex-direction: column; gap: 0.2rem; padding: 1rem 1.15rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.stat-card--wide { grid-column: span 2; }
.stat-card__label { font-size: 0.85rem; color: var(--muted); }
.stat-card__value { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.row-muted td { color: var(--muted); }
.table .total td { font-weight: 650; background: var(--surface-2); border-top: 2px solid var(--line-strong); }
.bar-cell { display: flex; align-items: center; gap: 0.6rem; min-width: 6rem; }
.bar-cell strong { min-width: 1.5rem; font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: 0.55rem; background: #eef1f4; border-radius: 999px; overflow: hidden; min-width: 3rem; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.definitions { margin-top: 1rem; color: var(--ink-2); }
.definitions summary { cursor: pointer; font-weight: 600; padding: 0.25rem 0; }
.definitions dl.facts { margin-top: 0.5rem; }

@media print {
  .sidebar, .topbar, .scrim, .no-print, .skip-link, .pager { display: none !important; }
  .main-wrap { margin-left: 0 !important; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .card, .stat-card, .table-wrap { box-shadow: none; }
  .table-wrap { overflow: visible; }
  .table th, .table td { padding: 0.35rem 0.5rem; }
  .row-muted { color: #555; }
}
.help:empty { display: none; }
[data-live-results][aria-busy="true"] { opacity: 0.6; transition: opacity 0.15s; }
.toolbar > select.input { width: auto; flex: 0 1 auto; max-width: 100%; }
.vitals-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 0.75rem; }
@media (min-width: 48em) { .vitals-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.vitals-grid .field label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge--danger { background: var(--danger-tint); color: #7a1a12; }
.tabs-inline { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.code-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; word-break: break-all; }

/* ---------- Dashboard platform (domain utama, /platform/) ---------- */
.platform-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.75rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.platform-bar__brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.platform-bar__tag { font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.platform-bar__user { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.platform-bar__user .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-section { margin-top: 1rem; }
@media (min-width: 40em) { .stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.4rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.danger-zone { border-color: #f0b8b3; }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.log-list li { min-width: 0; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.log-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.log-list__detail { overflow-wrap: anywhere; }
.reasons { margin: 0.5rem 0 0; padding-left: 1.1rem; }
