/* =========================================================================
   Design tokens
   ========================================================================= */
:root {
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f4f8;
  --border: #e5e9f0;
  --border-strong: #d4dae3;

  --text: #0f1729;
  --text-2: #3d4a5c;
  --muted: #64748b;
  --faint: #94a3b8;

  --primary: #0d8f82;
  --primary-hover: #0a7469;
  --primary-700: #0a6158;
  --primary-soft: #e6f5f3;
  --primary-ring: rgba(13, 143, 130, .18);

  --ok: #067647;      --ok-bg: #ecfdf3;     --ok-bd: #abefc6;
  --warn: #b54708;    --warn-bg: #fffaeb;   --warn-bd: #fedf89;
  --err: #c4320a;     --err-bg: #fef3f2;    --err-bd: #fecdca;
  --info: #175cd3;    --info-bg: #eff8ff;   --info-bd: #b2ddff;
  --purple: #6941c6;  --purple-bg: #f4f3ff; --purple-bd: #d9d6fe;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 41, .04), 0 1px 3px rgba(15, 23, 41, .04);
  --shadow-md: 0 4px 12px rgba(15, 23, 41, .06);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 41, .25);

  --sidebar-w: 268px;

  --border-hex: #e5e9f0;      /* versi hex dari --border untuk Chart.js */
  --tooltip-bg: #0f1729;
  --ok-solid: #079455;
  --warn-solid: #f79009;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --row-hover: #fafbfd;
  color-scheme: light;
}

/* Tema gelap */
:root[data-theme="dark"] {
  --bg: #0a101c;
  --surface: #111a2a;
  --surface-2: #0e1625;
  --surface-3: #1a2639;
  --border: #223049;
  --border-strong: #2f405c;
  --border-hex: #223049;

  --text: #e8eef7;
  --text-2: #c3cddb;
  --muted: #8d9bb1;
  --faint: #5f6f88;

  --primary: #19b8a8;
  --primary-hover: #2ccdbd;
  --primary-700: #6ee7d8;
  --primary-soft: rgba(25, 184, 168, .14);
  --primary-ring: rgba(25, 184, 168, .3);

  --ok: #4ade80;      --ok-bg: rgba(74, 222, 128, .1);   --ok-bd: rgba(74, 222, 128, .28);
  --warn: #fbbf24;    --warn-bg: rgba(251, 191, 36, .1); --warn-bd: rgba(251, 191, 36, .28);
  --err: #f87171;     --err-bg: rgba(248, 113, 113, .1); --err-bd: rgba(248, 113, 113, .3);
  --info: #60a5fa;    --info-bg: rgba(96, 165, 250, .1); --info-bd: rgba(96, 165, 250, .28);
  --purple: #a78bfa;  --purple-bg: rgba(167, 139, 250, .1); --purple-bd: rgba(167, 139, 250, .28);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
  --tooltip-bg: #1e2a3f;
  --row-hover: #142033;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
.icon { flex-shrink: 0; display: block; }

/* =========================================================================
   Layout shell
   ========================================================================= */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; }
.brand strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #10b3a3, #0a6158);
  box-shadow: 0 6px 14px -6px rgba(13, 143, 130, .7);
}

nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.nav-section { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; padding: 18px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link .icon { color: var(--faint); transition: color .15s; }
.nav-link:hover { background: var(--surface-3); color: var(--text); }
.nav-link:hover .icon { color: var(--text-2); }
.nav-link.active { background: var(--primary-soft); color: var(--primary-700); font-weight: 600; }
.nav-link.active .icon { color: var(--primary); }

.sidebar-foot { border-top: 1px solid var(--border); padding: 14px 16px; }
.user-card { display: flex; align-items: center; gap: 10px; }
.user-card .meta { flex: 1; min-width: 0; }
.user-card .meta strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .meta small { color: var(--muted); font-size: 12px; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 64px; padding: 0 32px;
  display: flex; align-items: center; gap: 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.topbar-date { color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.topbar-date .clock {
  margin-left: 4px; padding: 2px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; width: min(380px, 40vw); height: 40px; padding: 0 8px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  font: inherit; color: var(--faint); cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.search-trigger span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger:hover { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); color: var(--muted); }
kbd {
  font: 600 11px/1 var(--font); color: var(--muted); padding: 4px 6px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--border); border-bottom-width: 2px; white-space: nowrap;
}
.btn.menu-toggle { display: none; }
main { flex: 1; padding: 28px 32px 48px; width: 100%; max-width: 1360px; margin: 0 auto; }

/* Footer aplikasi: selalu di dasar halaman walau isi halaman pendek */
.app-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  padding: 16px 32px; border-top: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 13px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-brand .icon { color: var(--primary); }
.footer-brand b { color: var(--text-2); font-weight: 700; }
.footer-brand .sep { color: var(--faint); }
.footer-links { display: flex; align-items: center; gap: 4px; }
.footer-links button {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: none; font: inherit; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.footer-links button:hover { background: var(--surface-3); color: var(--text); }
.footer-links button .icon { transition: transform .2s var(--ease); }
.footer-links button:hover .icon { transform: translateY(-2px); }

/* User dropdown */
.user-menu { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px 5px 5px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font: inherit; color: var(--text); cursor: pointer;
}
.user-trigger:hover { border-color: var(--border-strong); }
.user-trigger .name { font-weight: 600; font-size: 13px; }
.user-trigger .icon { color: var(--muted); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; display: block;
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right;
  transition: opacity .16s, transform .2s var(--ease), visibility .16s;
}
.user-menu.open .dropdown { opacity: 1; visibility: visible; transform: none; }
.user-trigger .icon { transition: transform .2s var(--ease); }
.user-menu.open .user-trigger .icon { transform: rotate(180deg); }
.dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-head strong { display: block; }
.dropdown-head small { color: var(--muted); }
.dropdown button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: 0; background: none; border-radius: 8px;
  font: inherit; color: var(--text-2); cursor: pointer; text-align: left;
}
.dropdown button:hover { background: var(--surface-3); color: var(--text); }
.dropdown button.danger { color: var(--err); }

/* =========================================================================
   Page structure
   ========================================================================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.back-link:hover { color: var(--text); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
  overflow: hidden;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card > .table-wrap { margin: 0 -20px; }
.card > .table-wrap:last-child { margin-bottom: -20px; }
.card > .table-wrap th:first-child, .card > .table-wrap td:first-child { padding-left: 20px; }
.card > .table-wrap th:last-child, .card > .table-wrap td:last-child { padding-right: 20px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.sticky { position: sticky; top: 84px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start;
}
.stat .chip { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin-top: 2px; }
.stat .sub { color: var(--faint); font-size: 12px; margin-top: 2px; }
.tone-primary { background: var(--primary-soft); color: var(--primary); }
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-purple { background: var(--purple-bg); color: var(--purple); }
.tone-err { background: var(--err-bg); color: var(--err); }

/* =========================================================================
   Forms
   ========================================================================= */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.req { color: var(--err); }
input, select, textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; color: var(--text); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-2); cursor: default; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { margin-bottom: 16px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; color: var(--text); margin: 0; cursor: pointer; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.row > .shrink { flex: 0 0 auto; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.form-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 4px 0 -4px; }

.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon input { padding-left: 38px; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 220px; max-width: 360px; }
.toolbar input, .toolbar select { height: 38px; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2);
  font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 41, .05);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-ring); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.success { background: var(--ok-solid); border-color: var(--ok-solid); color: #fff; }
.btn.success:hover { background: #067647; border-color: #067647; color: #fff; }
.btn.danger-solid { background: #d92d20; border-color: #d92d20; color: #fff; }
.btn.danger-solid:hover { background: #b42318; border-color: #b42318; color: #fff; }
.btn.danger { color: var(--err); border-color: var(--err-bd); }
.btn.danger:hover { background: var(--err-bg); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 36px; height: 36px; padding: 0; }
.btn.icon.sm { width: 32px; height: 32px; }
.btn.block { width: 100%; }
.btn.lg { height: 46px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: 4px; }

/* =========================================================================
   Tables
   ========================================================================= */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th {
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); white-space: nowrap;
  border-top: 1px solid var(--border);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--row-hover); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--primary-soft); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.actions-cell { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
td input, td select { height: 34px; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { color: var(--muted); font-size: 12px; white-space: nowrap; }
.person { display: flex; align-items: center; gap: 10px; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px !important; }
.empty .icon { margin: 0 auto 10px; color: var(--faint); }
tbody tr:hover td.empty { background: none; }

/* =========================================================================
   Badges, alerts, avatars
   ========================================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border);
}
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bd); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bd); }
.badge.err { background: var(--err-bg); color: var(--err); border-color: var(--err-bd); }
.badge.info { background: var(--info-bg); color: var(--info); border-color: var(--info-bd); }
.badge.purple { background: var(--purple-bg); color: var(--purple); border-color: var(--purple-bd); }
.badge.primary { background: var(--primary-soft); color: var(--primary-700); border-color: var(--primary-ring); }

.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px; margin-bottom: 20px;
  border: 1px solid; font-weight: 500;
}
.alert .icon { margin-top: 1px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bd); }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bd); }
.alert.err { background: var(--err-bg); color: var(--err); border-color: var(--err-bd); }
.alert.info { background: var(--info-bg); color: var(--info); border-color: var(--info-bd); }

.avatar {
  --h: 170;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center; flex-shrink: 0;
  font-size: 12px; font-weight: 700;
  background: hsl(var(--h) 60% 92%); color: hsl(var(--h) 50% 30%);
}
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

.muted { color: var(--muted); }
.text-err { color: var(--err); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.strong { font-weight: 700; }

/* =========================================================================
   Tabs (segmented)
   ========================================================================= */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 20px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px;
  flex-wrap: wrap;
}
.tabs button {
  border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

/* Switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; margin: 0; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 22px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 4px var(--primary-ring); }

/* Info list */
.info-list { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; margin: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 600; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.list li:first-child { padding-top: 0; }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list-empty { color: var(--muted); padding: 8px 0; }

/* =========================================================================
   Specific components
   ========================================================================= */
/* Patient search hero */
.search-hero {
  background: linear-gradient(135deg, #0a6158, #0d8f82 60%, #14b8a6);
  background-size: 200% 200%; animation: hero-shift 12s ease-in-out infinite alternate;
  border: 0; color: #fff; padding: 28px;
  position: relative;
}
.search-hero::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(255,255,255,.08);
}
.search-hero h2 { font-size: 18px; color: #fff; }
.search-hero p { margin: 4px 0 18px; color: rgba(255,255,255,.8); }
.hero-search { display: flex; gap: 10px; max-width: 620px; position: relative; z-index: 1; }
.hero-search .input-icon { flex: 1; }
.hero-search input { height: 50px; font-size: 17px; font-weight: 600; border: 0; }
.hero-search input::placeholder { font-weight: 500; font-size: 15px; }
.hero-search .btn { height: 50px; padding: 0 24px; background: #0f1729; border-color: #0f1729; color: #fff; }
.hero-search .btn:hover { background: #1e293b; }
.new-patient-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.new-patient-cta span { color: var(--muted); }

/* Patient header */
.patient-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.patient-head .grow { flex: 1; min-width: 200px; }
.patient-head h2 { font-size: 20px; }
.patient-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); margin-top: 4px; font-size: 13px; }
.patient-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* Timeline (riwayat) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 24px; cursor: pointer; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: -4px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ''; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.timeline li:hover .t-title { color: var(--primary); }
.timeline .t-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* Form pasien & rekam medis */
.input-suffix { position: relative; }
.input-suffix input { padding-right: 60px; }
.input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.choice { display: flex; gap: 10px; flex-wrap: wrap; }
.choice label { margin: 0; flex: 1 1 180px; position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  font-weight: 500; color: var(--text-2); transition: .15s;
}
.choice span .icon { color: var(--faint); }
.choice span:hover { background: var(--surface-2); }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px var(--primary-ring); }
.choice input:checked + span { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.choice label.err input:checked + span { border-color: var(--err); background: var(--err-bg); color: var(--err); }
.choice input:checked + span .icon { color: inherit; }
.keluhan-note {
  display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; padding: 10px 12px;
  background: var(--info-bg); border: 1px solid var(--info-bd); border-radius: var(--radius-sm); color: var(--text-2); font-size: 13px;
}
.keluhan-note .icon { color: var(--info); flex-shrink: 0; margin-top: 2px; }
.t-date { font-size: 12px; color: var(--muted); }
.t-title { font-weight: 600; }

/* Totals */
.summary-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; color: var(--text-2); }
.summary-line input { width: 150px; text-align: right; height: 36px; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--border-strong); margin-top: 10px; padding-top: 14px; }
.summary-total .amount { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* Item picker (pemeriksaan) */
.card.allow-overflow { overflow: visible; }
.picker { position: relative; margin-bottom: 16px; }
.picker-panel {
  position: absolute; left: 0; right: 0; top: 74px; z-index: 25;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); max-height: 380px; overflow-y: auto; padding: 6px;
}
.picker-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 10px 10px 4px; }
.picker-opt {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border: 0; background: none; border-radius: 8px;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.picker-opt .grow { flex: 1; min-width: 0; }
.picker-opt .price { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.picker-opt:hover, .picker-opt.active { background: var(--primary-soft); }
.picker-opt:disabled { opacity: .55; cursor: not-allowed; background: none; }
.picker-empty { padding: 18px; text-align: center; color: var(--muted); }
.locked { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.locked .icon { color: var(--faint); }
tr.over td { background: var(--err-bg) !important; }
tr.over .stok-info { color: var(--err); font-weight: 600; }

/* Doctor cards */
.doctor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.doctor-card { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.doctor-card.on { border-color: var(--primary-ring); box-shadow: 0 0 0 3px var(--primary-soft); }
.doctor-card .top { display: flex; gap: 12px; align-items: flex-start; }
.doctor-card .top .grow { flex: 1; min-width: 0; }
.doctor-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.doctor-card dt { color: var(--muted); }
.doctor-card dd { margin: 0; font-weight: 600; text-align: right; }
.doctor-card .foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; margin-top: auto; }
.jaga-toggle { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; margin-right: auto; }

/* Role cards */
.role-card { display: flex; gap: 14px; margin: 0; }
.role-card h3 { display: flex; align-items: center; gap: 8px; }
.role-card ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 41, .45); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 72px 16px; overflow-y: auto;
  animation: fade .15s ease-out;
}
.modal {
  background: var(--surface); border-radius: 18px; width: 100%; max-width: 560px;
  box-shadow: var(--shadow-lg); animation: pop .18s ease-out;
}
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 0; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 20px 24px; }
.modal .actions { margin: 24px -24px -20px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* Toast */
#toast { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 420px; padding: 12px 16px;
  background: var(--tooltip-bg); color: #fff; border-radius: 12px; border: 1px solid rgba(255,255,255,.06);
  box-shadow: var(--shadow-lg); font-weight: 500;
  animation: slide .2s ease-out;
}
.toast .icon { color: #4ade80; }
.toast.err .icon { color: #f87171; }
@keyframes slide { from { opacity: 0; transform: translateY(10px); } }

/* =========================================================================
   Login
   ========================================================================= */
#login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-brand {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(150deg, #064e47 0%, #0a6158 35%, #0d8f82 70%, #14b8a6 100%);
  padding: 48px 56px; display: flex; flex-direction: column;
}
.login-brand::before, .login-brand::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.07);
}
.login-brand::before { width: 520px; height: 520px; right: -180px; bottom: -160px; }
.login-brand::after { width: 260px; height: 260px; right: 120px; top: -110px; }
.login-brand .brand { padding: 0; position: relative; z-index: 1; }
.login-brand .brand small { color: rgba(255,255,255,.75); }
.login-brand .brand-mark { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.login-hero { margin: auto 0; max-width: 460px; position: relative; z-index: 1; }
.login-hero h1 { font-size: 36px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.login-hero p { color: rgba(255,255,255,.82); font-size: 15px; margin: 14px 0 28px; }
.login-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.login-features li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.login-features .chip { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.login-brand footer { position: relative; z-index: 1; color: rgba(255,255,255,.6); font-size: 12px; }

.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.login-card > p { color: var(--muted); margin: 6px 0 28px; }
.login-card .field { margin-bottom: 18px; }
.login-card input { height: 46px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-wrap button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.login-note { margin-top: 24px; font-size: 12px; color: var(--faint); text-align: center; }

/* =========================================================================
   Print & responsive
   ========================================================================= */
.print-only { display: none; }

@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .sticky { position: static; }
}

@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  .overlay { position: fixed; inset: 0; background: rgba(15,23,41,.4); z-index: 35; display: none; }
  body.nav-open .overlay { display: block; }
  .btn.menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  main { padding: 20px 16px 40px; }
  .app-footer { padding: 14px 16px; justify-content: center; text-align: center; }
  .footer-brand { justify-content: center; }
  .footer-links kbd, .footer-brand .sep, .footer-brand span:last-child { display: none; }
  .grid-2, .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  #login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .user-trigger .name, .topbar-date { display: none; }
  .search-trigger { width: auto; flex: 1; }
  .search-trigger kbd { display: none; }
  .search-trigger { min-width: 0; }
  .topbar-right { margin-left: 0; gap: 6px; flex-shrink: 0; }
}

@media print {
  #progress, #tip, .app-footer { display: none !important; }
  .sidebar, .topbar, .no-print, #toast, .actions, .tabs, .btn { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .grid-main { grid-template-columns: 1fr; }
}

/* =========================================================================
   Motion & interaksi
   ========================================================================= */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-out { to { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes hero-shift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes flash-row { from { background: var(--primary-soft); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 var(--ok-bd); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
@keyframes float { 50% { transform: translate(-14px, 18px) scale(1.04); } }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Transisi halaman: setiap blok utama muncul berurutan */
.page-enter > * { animation: rise .45s var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 6) * 55ms); }
.page-enter .stats > .stat { animation: rise .45s var(--ease) backwards; }
.page-enter .stats > .stat:nth-child(2) { animation-delay: 60ms; }
.page-enter .stats > .stat:nth-child(3) { animation-delay: 120ms; }
.page-enter .stats > .stat:nth-child(4) { animation-delay: 180ms; }
.page-enter .stats > .stat:nth-child(5) { animation-delay: 240ms; }
#tab > *, #hasil > * { animation: rise .35s var(--ease) backwards; }
#hasil > *:nth-child(2) { animation-delay: 60ms; }
#hasil > *:nth-child(3) { animation-delay: 120ms; }

/* Progress bar request */
#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 300; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, #14b8a6, var(--primary), #60a5fa);
  box-shadow: 0 0 10px var(--primary-ring);
}
#progress.run { opacity: 1; width: 85%; transition: width 6s cubic-bezier(.1, .7, .1, 1); }
#progress.run.done { width: 100%; opacity: 0; transition: width .2s ease-out, opacity .3s .15s; }

/* Skeleton */
.sk {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
.skeleton .grow { flex: 1; }
.sk-title { height: 28px; width: 280px; max-width: 70%; margin-bottom: 10px; }
.sk-sub { height: 14px; width: 420px; max-width: 90%; margin-bottom: 28px; }
.sk-chip { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; }
.sk-line { height: 12px; margin-bottom: 10px; }
.sk-line.tall { height: 22px; margin: 0; }
.sk-row { height: 40px; margin-bottom: 12px; }
.sk-row:last-child { margin-bottom: 0; }
.w60 { width: 60%; } .w40 { width: 40%; }

/* Mikro-interaksi */
.btn { transition: background .15s, border-color .15s, color .15s, box-shadow .2s, transform .12s var(--ease); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background-image: linear-gradient(180deg, rgba(255,255,255,.12), transparent); }
.btn.primary:hover { box-shadow: 0 6px 16px -6px var(--primary); }
.stat, .doctor-card, .role-card { transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.stat:hover, .doctor-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat .chip { transition: transform .35s var(--ease); }
.stat:hover .chip { transform: scale(1.08) rotate(-6deg); }
.stat .value { font-variant-numeric: tabular-nums; }
.nav-link { position: relative; transition: background .15s, color .15s, padding-left .2s var(--ease); }
.nav-link::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--primary); transform: scaleY(0); transition: transform .25s var(--ease);
}
.nav-link.active::before { transform: scaleY(1); }
.nav-link:hover:not(.active) { padding-left: 16px; }
tr.clickable td { transition: background .15s; }
tr.clickable td:last-child .icon { transition: transform .2s var(--ease); }
tr.clickable:hover td:last-child .icon { transform: translateX(3px); }
tr.flash td { animation: flash-row 1.2s ease-out; }
.badge.pulse::before { animation: pulse-ring 1.8s infinite; border-radius: 50%; }
.choice span { transition: background .15s, border-color .15s, color .15s, transform .12s var(--ease); }
.choice span:active { transform: scale(.98); }
.timeline li { transition: transform .2s var(--ease); }
.timeline li:hover { transform: translateX(3px); }
.mini-chip { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }

/* Modal & toast keluar */
.modal-backdrop.closing { animation: fade-out .16s forwards; }
.modal-backdrop.closing .modal { animation: pop-out .16s forwards; }
.toast { position: relative; overflow: hidden; cursor: pointer; animation: slide .3s var(--ease); }
.toast.out { animation: pop-out .25s forwards; }
.toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #4ade80; opacity: .6; transform-origin: left; animation: toast-bar 3.5s linear forwards; }
.toast.err .toast-bar { background: #f87171; animation-duration: 5s; }
.toast:hover .toast-bar { animation-play-state: paused; }

/* Tooltip */
#tip {
  position: fixed; z-index: 400; pointer-events: none; padding: 6px 10px; border-radius: 8px;
  background: var(--tooltip-bg); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow-md); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .15s var(--ease);
}
#tip.show { opacity: 1; transform: none; }

/* Command palette */
.palette-backdrop {
  position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 16px 16px; background: rgba(10, 16, 28, .45); backdrop-filter: blur(4px); animation: fade .15s;
}
.palette-backdrop.closing { animation: fade-out .14s forwards; }
.palette {
  width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .2s var(--ease);
}
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--faint); }
.palette-input input { border: 0; height: 56px; padding: 0; font-size: 16px; box-shadow: none !important; background: none; }
.palette-list { max-height: 380px; overflow-y: auto; padding: 8px; }
.palette-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 10px 10px 6px; }
.palette-item {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; border-radius: 10px;
  background: none; font: inherit; color: var(--text-2); text-align: left; cursor: pointer;
}
.palette-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette-item > .icon { color: var(--faint); opacity: 0; transform: translateX(-4px); transition: .15s var(--ease); }
.palette-item.active { background: var(--primary-soft); color: var(--text); }
.palette-item.active > .icon { opacity: 1; transform: none; color: var(--primary); }
.palette-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex-shrink: 0; }
.palette-item.active .palette-ic { background: var(--primary); color: #fff; }
.palette-empty { padding: 28px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 12px; }
.palette-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* Grafik dashboard */
.grid-chart { grid-template-columns: minmax(0, 1fr) 340px; align-items: stretch; margin-bottom: 0; }
.grid-chart .card { display: flex; flex-direction: column; }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 280px; flex: 1; }
.chart-box.donut { height: 190px; }
.chart-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); text-align: center; }
.chart-empty .icon { color: var(--faint); }
.legend-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.legend-list li { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.legend-list b { margin-left: auto; color: var(--text); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.s-menunggu { background: var(--warn-solid); } .s-diperiksa { background: var(--info); }
.s-selesai { background: var(--ok-solid); } .s-batal { background: var(--faint); }
.bar-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 13px; }
.bar-label .cell-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-bottom: 4px; }
.bar-fill {
  display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--primary);
  transform-origin: left; animation: grow-bar .9s var(--ease) backwards; animation-delay: calc(var(--i) * 90ms + 200ms);
}
.bar-fill.k-Obat { background: var(--ok-solid); } .bar-fill.k-Bahan { background: var(--purple); } .bar-fill.k-Lainnya { background: var(--faint); }
.bar-list li:hover .bar-fill { filter: brightness(1.1); }
@keyframes grow-bar { from { transform: scaleX(0); } }

@media (max-width: 1100px) {
  .grid-chart { grid-template-columns: 1fr; }
}

/* Flatpickr mengikuti token tema */
.flatpickr-calendar {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  font-family: var(--font); overflow: hidden;
}
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { display: none; }
.flatpickr-calendar.open { animation: pop .18s var(--ease); }
.flatpickr-months .flatpickr-month, .flatpickr-current-month input.cur-year, span.flatpickr-weekday,
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { color: var(--text); fill: var(--text); background: none; }
.flatpickr-current-month { font-size: 15px; font-weight: 700; }
.flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 700; }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--primary); }
span.flatpickr-weekday { color: var(--faint); font-weight: 600; font-size: 12px; }
.flatpickr-day { color: var(--text-2); border-radius: 10px; transition: background .12s; }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--surface-3); border-color: transparent; }
.flatpickr-day.today { border-color: var(--primary); }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay, .flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover { color: var(--faint); opacity: .5; background: none; }
input.date-input { cursor: pointer; background-image: none; }

/* SweetAlert2 mengikuti token tema */
.swal2-popup.swal-popup { background: var(--surface); color: var(--text); border-radius: 18px; border: 1px solid var(--border); font-family: var(--font); padding: 28px 24px 24px; box-shadow: var(--shadow-lg); }
.swal-popup .swal2-title { color: var(--text); font-size: 20px; font-weight: 800; padding-top: 8px; }
.swal-popup .swal2-html-container { color: var(--muted); font-size: 14px; }
.swal-popup .swal2-html-container b { color: var(--text); }
.swal-actions { gap: 8px; margin-top: 20px; }
.swal2-container.swal2-backdrop-show { background: rgba(10, 16, 28, .5); backdrop-filter: blur(3px); }
.swal2-timer-progress-bar { background: var(--primary); }
.swal-in { animation: pop .22s var(--ease); }
.swal-out { animation: pop-out .15s forwards; }

/* Login lebih hidup */
.login-brand::before { animation: float 14s ease-in-out infinite; }
.login-brand::after { animation: float 10s ease-in-out infinite reverse; }
.login-hero > * { animation: rise .6s var(--ease) backwards; }
.login-hero > *:nth-child(2) { animation-delay: 80ms; }
.login-hero > *:nth-child(3) { animation-delay: 160ms; }
.login-features li { animation: rise .5s var(--ease) backwards; }
.login-features li:nth-child(2) { animation-delay: 260ms; }
.login-features li:nth-child(3) { animation-delay: 320ms; }
.login-features li:nth-child(4) { animation-delay: 380ms; }
.login-card { animation: rise .5s var(--ease) backwards .1s; }

/* View Transition saat ganti tema */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
