/* ==========================================================================
   Inbox Bot — satu-satunya file CSS.
   Tanpa CDN, tanpa Google Fonts, tanpa library ikon. Font sistem + SVG inline.
   Urutan: 1) token  2) dasar  3) tata letak  4) komponen  5) utilitas
   ========================================================================== */

/* 1 — TOKEN =============================================================== */

:root {
  /* font */
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, "Noto Sans", sans-serif,
             "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  /* permukaan */
  --bg-app: #F4F6F8;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F3F6;
  --bg-hover: #E9ECF1;
  --bg-selected: #EEF1FD;
  --bg-inverse: #1B1F27;

  /* garis */
  --border: #E2E6EC;
  --border-strong: #C9D0DA;
  --border-focus: #4C5BD4;

  /* teks */
  --text-primary: #151A21;
  --text-secondary: #57616E;
  --text-muted: #8A94A1;
  --text-inverse: #FFFFFF;

  /* aksen / aksi utama */
  --accent: #4C5BD4;
  --accent-hover: #3B49BC;
  --accent-bg: #EEF0FE;
  --accent-border: #C5CBF8;

  /* merah — alarm, kill switch, gagal */
  --status-alarm: #B42318;
  --status-alarm-strong: #D92D20;
  --status-alarm-bg: #FEF3F2;
  --status-alarm-border: #FBC5C0;

  /* oranye — eskalasi */
  --status-escalate: #B93815;
  --status-escalate-bg: #FFF4ED;
  --status-escalate-border: #F7C7A3;

  /* kuning — menunggu, antre, perlu perhatian */
  --status-wait: #A35A06;
  --status-wait-strong: #F79009;
  --status-wait-bg: #FFFAEB;
  --status-wait-border: #F6D08A;

  /* hijau — terkirim, normal */
  --status-ok: #06794B;
  --status-ok-strong: #17B26A;
  --status-ok-bg: #ECFDF3;
  --status-ok-border: #A9E9C5;

  /* abu — didiamkan, dibatalkan */
  --status-idle: #5C6875;
  --status-idle-bg: #F1F3F6;
  --status-idle-border: #D5DAE1;

  /* ungu — draft bot */
  --status-draft: #6239C0;
  --status-draft-bg: #F4F2FE;
  --status-draft-border: #D5CCF9;

  /* kanal */
  --channel-wa: #1B9E52;
  --channel-wa-bg: #E9F8EF;
  --channel-off: #98A2B3;
  --channel-off-bg: #F1F3F6;

  /* gelembung chat */
  --bubble-in: #FFFFFF;
  --bubble-out: #EEF0FE;          /* bot */
  --bubble-out-border: #DDE1FB;
  --bubble-out-manual: #E8F3EC;   /* manual dashboard */
  --bubble-out-manual-border: #CBE5D5;
  --bubble-out-hp: #E6F2F4;       /* manual HP */
  --bubble-out-hp-border: #C7E2E6;
  --bubble-out-unknown: #F1F3F6;  /* tidak diketahui */
  --sender-hp: #0E6E85;
  --chat-canvas: #F7F8FA;

  /* radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-pill: 999px;

  /* spasi */
  --sp-1: 2px;  --sp-2: 4px;  --sp-3: 6px;  --sp-4: 8px;  --sp-5: 12px;
  --sp-6: 16px; --sp-7: 20px; --sp-8: 24px; --sp-9: 32px;

  /* ukuran font */
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px;  --fs-base: 14px;
  --fs-lg: 16px; --fs-xl: 19px; --fs-2xl: 24px; --fs-3xl: 30px;

  /* ukuran tetap tata letak */
  --h-topbar: 52px;
  --h-banner: 40px;
  --w-sidebar: 232px;
  --w-list: 340px;
  --w-info: 300px;

  --shadow-pop: 0 10px 28px -6px rgb(15 23 42 / 0.20);
}

/* 2 — DASAR =============================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.45;
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.mono { font-family: var(--font-mono); }

/* ikon: <svg class="i"><use href="#i-bot"/></svg> */
.i {
  width: 14px; height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i--xs { width: 11px; height: 11px; stroke-width: 2.2; }
.i--sm { width: 13px; height: 13px; }
.i--lg { width: 16px; height: 16px; }
.i--xl { width: 24px; height: 24px; stroke-width: 1.8; }

/* titik status */
.dot { width: 7px; height: 7px; border-radius: var(--radius-pill); flex: none; }
.dot--ok    { background: var(--status-ok-strong); }
.dot--wait  { background: var(--status-wait-strong); }
.dot--alarm { background: var(--status-alarm-strong); }
.dot--off   { background: var(--channel-off); }

/* 3 — TATA LETAK ========================================================== */

.app {
  position: relative;      /* jangkar untuk .alarm-panel */
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app__body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: var(--w-sidebar);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 14px 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.list-col {
  width: var(--w-list);
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
}

.conv-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
}

.info-col {
  width: var(--w-info);
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-surface);
  overflow-y: auto;
}

/* panel info yang dilipat */
.info-col--collapsed {
  width: 44px;
  align-items: center;
  padding: 10px 0;
}

/* halaman biasa (Ringkasan, Robot) memakai kolom tunggal */
.page {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  padding: var(--sp-7);
  background: var(--bg-app);
  overflow-y: auto;
}

/* ±1024px: panel info menyusut, sidebar lebih rapat */
@media (max-width: 1180px) {
  :root { --w-sidebar: 208px; --w-list: 300px; --w-info: 264px; }
}
@media (max-width: 1024px) {
  .info-col { display: none; }
}

/* 4 — KOMPONEN ============================================================ */

/* 4.1 Bilah atas --------------------------------------------------------- */

.topbar {
  height: var(--h-topbar);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 var(--sp-6);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.topbar__group { display: flex; align-items: center; gap: 14px; }
.topbar__group--right { gap: 10px; }

.brand { display: flex; align-items: center; gap: var(--sp-4); }
.brand__mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--text-inverse);
}
.brand__mark .i { width: 16px; height: 16px; }
.brand__name { font-size: var(--fs-base); font-weight: 700; letter-spacing: -0.2px; }

.vr { width: 1px; height: 22px; background: var(--border); flex: none; }

/* segmented (mode otak) */
.seg {
  display: flex; gap: 2px; padding: 2px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.seg__label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.seg__btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  cursor: pointer;
}
.seg__btn[aria-pressed="true"] {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-primary);
  font-weight: 700;
}
.seg__btn[aria-pressed="true"] .i { color: var(--accent); }
.seg__btn--auto[aria-pressed="true"]  .i { color: var(--status-ok); }
.seg__btn--draft[aria-pressed="true"] .i { color: var(--status-draft); }

/* kill switch */
.killswitch {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 5px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.killswitch__label { font-size: var(--fs-sm); font-weight: 700; }
.killswitch__state { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.4px; color: var(--text-muted); }
.killswitch .i { color: var(--status-alarm); }

.killswitch[aria-pressed="true"] {
  background: var(--status-alarm-strong);
  border-color: var(--status-alarm-strong);
  color: var(--text-inverse);
}
.killswitch[aria-pressed="true"] .i,
.killswitch[aria-pressed="true"] .killswitch__state { color: var(--text-inverse); }

.toggle {
  width: 28px; height: 16px; flex: none;
  display: flex; align-items: center;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
}
.toggle__knob { width: 12px; height: 12px; border-radius: var(--radius-pill); background: #fff; }
[aria-pressed="true"] > .toggle { background: rgb(255 255 255 / 0.27); justify-content: flex-end; }

/* indikator robot & alarm di bilah atas */
.pill {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.pill__name { font-weight: 600; }
.pill__meta { font-size: var(--fs-xs); color: var(--text-muted); }

.pill--alarm  { background: var(--status-alarm-bg); border-color: var(--status-alarm-border); color: var(--status-alarm); }
.pill--alarm .pill__meta { color: var(--status-alarm); }
.pill--alarm[data-open="true"] { background: var(--status-alarm-strong); border-color: var(--status-alarm-strong); color: #fff; }
.pill--alarm[data-open="true"] .pill__meta { color: #fff; }
.pill--ok     { background: var(--status-ok-bg); border-color: var(--status-ok-border); color: var(--status-ok); }
.pill--wait   { background: var(--status-wait-bg); border-color: var(--status-wait-border); color: var(--status-wait); }
.pill--wait .pill__meta { color: var(--status-wait); }

.avatar {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: var(--radius-pill);
  background: var(--status-idle);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 700;
}
.avatar--sm { width: 26px; height: 26px; font-size: var(--fs-xs); }
.avatar--md { width: 32px; height: 32px; }
.avatar--lg { width: 40px; height: 40px; font-size: var(--fs-base); }

/* 4.2 Banner global ------------------------------------------------------ */

.banner {
  height: var(--h-banner);
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--sp-6);
}
.banner__title { font-size: var(--fs-md); font-weight: 800; letter-spacing: 0.5px; white-space: nowrap; }
.banner__sep { width: 1px; height: 18px; background: currentColor; opacity: 0.35; }
.banner__body { flex: 1; min-width: 0; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner__meta { font-family: var(--font-mono); font-size: var(--fs-xs); opacity: 0.8; white-space: nowrap; }
.banner__action {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 5px 10px;
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}

.banner--danger { background: var(--status-alarm-strong); color: #fff; }
.banner--danger .banner__action { background: #fff; border-color: #fff; color: var(--status-alarm); }

.banner--warn {
  background: var(--status-wait-bg);
  border-bottom: 1px solid var(--status-wait-border);
  color: var(--status-wait);
}
.banner--warn .banner__action { background: var(--bg-surface); border-color: var(--status-wait-border); color: var(--status-wait); }

.banner--ok {
  background: var(--status-ok-bg);
  border-bottom: 1px solid var(--status-ok-border);
  color: var(--status-ok);
}
.banner--ok .banner__action { background: var(--bg-surface); border-color: var(--status-ok-border); color: var(--status-ok); }

/* 4.3 Sidebar ------------------------------------------------------------ */

.nav-group { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.nav-group__head {
  padding: 4px 9px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.7px;
  color: var(--text-muted);
}
.nav-sep { height: 1px; background: var(--border); margin: var(--sp-3) 0; }
.nav-spacer { flex: 1; }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 6px 9px;
  border: 0; background: none;
  border-radius: var(--radius-md);
  font-size: var(--fs-md);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.nav-item:hover { background: var(--bg-hover); }
.nav-item .i { color: var(--text-secondary); }
.nav-item__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item__count { font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); }

.nav-item[aria-current="page"] {
  background: var(--bg-selected);
  color: var(--accent);
  font-weight: 700;
}
.nav-item[aria-current="page"] .i,
.nav-item[aria-current="page"] .nav-item__count { color: var(--accent); }

/* warna angka per filter (ikon ikut) */
.nav-item--draft    .i, .nav-item--draft    .nav-item__count { color: var(--status-draft); }
.nav-item--escalate .i, .nav-item--escalate .nav-item__count { color: var(--status-escalate); }
.nav-item--alarm    .i, .nav-item--alarm    .nav-item__count { color: var(--status-alarm); }
.nav-item--wait     .i, .nav-item--wait     .nav-item__count { color: var(--status-wait); }
.nav-item--idle     .i, .nav-item--idle     .nav-item__count { color: var(--status-idle); }
.nav-item--ok       .i, .nav-item--ok       .nav-item__count { color: var(--status-ok); }
.nav-item.is-zero   .i, .nav-item.is-zero .nav-item__label,
.nav-item.is-zero .nav-item__count { color: var(--text-muted); }

/* kanal */
.chan-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 6px 9px;
  border: 0; background: none;
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
}
.chan-item:hover { background: var(--bg-hover); }
.chan-item[aria-current="true"] { background: var(--bg-selected); }
.chan-item__mark {
  width: 18px; height: 18px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--channel-wa-bg);
  color: var(--channel-wa);
}
.chan-item__text { flex: 1; min-width: 0; }
.chan-item__name { font-size: var(--fs-md); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-item__sub  { font-size: var(--fs-xs); color: var(--text-muted); }
.chan-item__count { font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); }

.chan-item--off .chan-item__mark { background: var(--channel-off-bg); color: var(--channel-off); }
.chan-item--off .chan-item__name { color: var(--text-muted); font-weight: 500; }
.chan-item--off .i { color: var(--channel-off); }

/* kartu anggaran di kaki sidebar */
.budget { margin: 10px; padding: 10px; border-radius: var(--radius-lg); border: 1px solid; }
.budget__head { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-xs); font-weight: 700; }
.budget__head span:first-of-type { flex: 1; }
.budget__note { font-size: var(--fs-xs); margin-top: var(--sp-3); }
.budget--warn { background: var(--status-wait-bg); border-color: var(--status-wait-border); color: var(--status-wait); }
.budget--ok   { background: var(--status-ok-bg);   border-color: var(--status-ok-border);   color: var(--status-ok); }

.meter { height: 6px; margin-top: var(--sp-3); border-radius: var(--radius-pill); overflow: hidden; }
.meter--lg { height: 10px; background: var(--bg-subtle); border: 1px solid var(--border); }
.meter__fill { height: 100%; border-radius: var(--radius-pill); }
.budget--warn .meter { background: #F2E3C4; }
.budget--warn .meter__fill { background: var(--status-wait-strong); }
.budget--ok   .meter { background: #C9EBD8; }
.budget--ok   .meter__fill { background: var(--status-ok-strong); }

/* 4.4 Badge status ------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 2px 6px;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge--draft    { color: var(--status-draft);    background: var(--status-draft-bg);    border-color: var(--status-draft-border); }
.badge--escalate { color: var(--status-escalate); background: var(--status-escalate-bg); border-color: var(--status-escalate-border); }
.badge--wait     { color: var(--status-wait);     background: var(--status-wait-bg);     border-color: var(--status-wait-border); }
.badge--alarm    { color: var(--status-alarm);    background: var(--status-alarm-bg);    border-color: var(--status-alarm-border); }
.badge--ok       { color: var(--status-ok);       background: var(--status-ok-bg);       border-color: var(--status-ok-border); }
.badge--idle     { color: var(--status-idle);     background: var(--status-idle-bg);     border-color: var(--status-idle-border); }
.badge--accent   { color: var(--accent);          background: var(--accent-bg);          border-color: var(--accent-border); }

/* chip kanal kecil */
.chip-chan {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: var(--channel-wa-bg);
  color: var(--channel-wa);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.chip-chan--off { background: var(--channel-off-bg); color: var(--channel-off); }

/* chip sumber keputusan (mono) */
.chip-src {
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 4.5 Tombol ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { background: var(--bg-hover); }

.btn--primary  { background: var(--accent);           border-color: var(--accent);           color: var(--text-inverse); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--draft    { background: var(--status-draft);     border-color: var(--status-draft);     color: var(--text-inverse); }
.btn--escalate { background: var(--status-escalate);  border-color: var(--status-escalate);  color: var(--text-inverse); }
.btn--danger   { background: var(--status-alarm-strong); border-color: var(--status-alarm-strong); color: var(--text-inverse); }
.btn--draft:hover, .btn--escalate:hover, .btn--danger:hover { filter: brightness(0.93); }

.btn--ghost        { border-color: var(--border); color: var(--text-secondary); }
.btn--danger-out   { border-color: var(--status-alarm-border); color: var(--status-alarm); }
.btn--warn-out     { border-color: var(--status-wait-border);  color: var(--status-wait); }
.btn--ok-out       { border-color: var(--status-ok-border);    color: var(--status-ok); }
.btn--accent-out   { border-color: var(--accent-border); background: var(--accent-bg); color: var(--accent); }

.btn--sm { padding: 5px 9px; font-size: var(--fs-xs); font-weight: 700; }
.btn--icon { padding: 0; width: 30px; height: 30px; justify-content: center; color: var(--text-secondary); }

.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-muted);
  cursor: not-allowed;
  filter: none;
}

/* 4.6 Daftar percakapan -------------------------------------------------- */

.list-head {
  flex: none;
  display: flex; flex-direction: column; gap: 9px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.search {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text-muted);
}
.search input {
  flex: 1; min-width: 0;
  border: 0; background: none; outline: none;
  font: inherit; font-size: var(--fs-md);
  color: var(--text-primary);
}
.search:focus-within { border-color: var(--border-focus); background: var(--bg-surface); }

.list-meta { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); }
.list-meta__filter { font-weight: 700; }
.list-meta__count  { flex: 1; color: var(--text-muted); }
.list-meta__sort   { display: flex; align-items: center; gap: var(--sp-2); font-weight: 600; color: var(--text-secondary); }

.list-items { flex: 1; min-height: 0; overflow-y: auto; }

.conv-item {
  display: flex; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  background: none;
  text-align: left;
  cursor: pointer;
}
.conv-item:hover { background: var(--bg-hover); }
.conv-item[aria-current="true"] {
  background: var(--bg-selected);
  border-left-color: var(--accent);
  border-bottom-color: transparent;
}
.conv-item__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conv-item__top  { display: flex; align-items: center; gap: var(--sp-4); }
.conv-item__name {
  flex: 1; min-width: 0;
  font-size: var(--fs-md); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-item.is-unread .conv-item__name { font-weight: 700; }
.conv-item__time { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.conv-item.is-late .conv-item__time { color: var(--status-alarm); font-weight: 700; }
.conv-item__snippet {
  font-size: var(--fs-sm); color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-item.is-unread .conv-item__snippet { color: var(--text-primary); }
.conv-item__status { display: flex; align-items: center; gap: var(--sp-3); }

/* 4.7 Panel percakapan --------------------------------------------------- */

.conv-head {
  height: 56px; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
  padding: 0 var(--sp-6);
  border-bottom: 1px solid var(--border);
}
.conv-head__id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.conv-head__text { min-width: 0; }
.conv-head__name {
  font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-head__meta { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-xs); color: var(--text-secondary); }
.conv-head__actions { display: flex; align-items: center; gap: var(--sp-4); flex: none; }

.chat {
  flex: 1;
  min-height: 0;
  display: flex; flex-direction: column; justify-content: flex-end; gap: var(--sp-5);
  padding: var(--sp-6) var(--sp-7);
  background: var(--chat-canvas);
  overflow-y: auto;
}

.day-sep { display: flex; justify-content: center; }
.day-sep span {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-hover);
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-secondary);
}

/* gelembung */
.msg { display: flex; }
.msg--out { justify-content: flex-end; }

.bubble {
  max-width: 380px;
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 12px;
  background: var(--bubble-in);
}
.msg--in  .bubble { border-top-left-radius: 3px; }
.msg--out .bubble { border-top-right-radius: 3px; }

.bubble__text { font-size: var(--fs-md); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble__meta {
  display: flex; align-items: center; gap: var(--sp-4);
  font-size: var(--fs-xs); color: var(--text-muted);
}
.bubble__time { margin-left: auto; white-space: nowrap; }

/* warna gelembung per pengirim */
.bubble--bot     { background: var(--bubble-out);         border-color: var(--bubble-out-border); }
.bubble--dash    { background: var(--bubble-out-manual);  border-color: var(--bubble-out-manual-border); }
.bubble--hp      { background: var(--bubble-out-hp);      border-color: var(--bubble-out-hp-border); }
.bubble--unknown { background: var(--bubble-out-unknown); border-color: var(--border-strong); }

/* status kirim mengubah garis, bukan hanya warna teks */
.bubble.is-queued { border-width: 1.5px; border-color: var(--status-wait-border); }
.bubble.is-failed { border-width: 1.5px; border-color: var(--status-alarm-border); }
.bubble.is-cancelled {
  background: var(--bg-subtle); border-color: var(--border-strong); opacity: 0.7;
}
.bubble.is-cancelled .bubble__text { text-decoration: line-through; color: var(--text-muted); }

/* label pengirim + status di dalam meta */
.tag { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.tag--bot     { color: var(--accent); }
.tag--dash    { color: var(--status-ok); }
.tag--hp      { color: var(--sender-hp); }
.tag--unknown { color: var(--text-muted); }
.tag--queued  { color: var(--status-wait); }
.tag--sent    { color: var(--status-ok); }
.tag--failed  { color: var(--status-alarm); }
.tag--cancelled { color: var(--status-idle); }

/* placeholder media */
.media {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}
.media__icon {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  font-size: 15px;
}
.media__label { font-size: var(--fs-md); font-weight: 600; }
.media__sub   { font-size: var(--fs-xs); color: var(--text-muted); }

/* catatan antre / gagal di dalam gelembung */
.sendnote {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 6px 8px;
  border: 1px solid var(--status-wait-border);
  border-radius: var(--radius-md);
  background: var(--status-wait-bg);
  color: var(--status-wait);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.4;
}
.sendnote p { margin: 0; flex: 1; }
.sendnote--failed {
  flex-direction: column; align-items: stretch; gap: 7px;
  border-color: var(--status-alarm-border);
  background: var(--status-alarm-bg);
  color: var(--status-alarm);
}
.sendnote--failed .sendnote__row { display: flex; gap: 7px; }
.sendnote--failed .sendnote__actions { display: flex; gap: var(--sp-3); justify-content: flex-end; }
.sendnote__approver { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--text-muted); }

/* 4.8 Penanda keputusan otak --------------------------------------------- */

.decision { display: flex; justify-content: center; }

.decision__toggle {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  font-size: var(--fs-xs);
  cursor: pointer;
}
.decision__action { font-weight: 700; }
.decision__reason { color: var(--text-secondary); }
.decision__src { font-family: var(--font-mono); color: var(--text-muted); }

.decision--balas    .decision__action, .decision--balas    .i:first-child { color: var(--accent); }
.decision--diam     .decision__action, .decision--diam     .i:first-child { color: var(--status-idle); }
.decision--eskalasi .decision__action, .decision--eskalasi .i:first-child { color: var(--status-escalate); }

.decision__card {
  width: 460px; max-width: 100%;
  display: flex; flex-direction: column; gap: 7px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.decision--eskalasi .decision__card { border-color: var(--status-escalate-border); }
.decision__card-head { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-xs); font-weight: 700; }
.decision__card-head time { flex: 1; font-family: var(--font-mono); font-weight: 400; color: var(--text-muted); }
.decision__row { display: flex; gap: var(--sp-4); font-size: var(--fs-xs); }
.decision__row dt { width: 88px; flex: none; color: var(--text-muted); }
.decision__row dd { margin: 0; font-weight: 500; }

/* 4.9 Area bawah: kartu draft + kotak ketik ------------------------------ */

.composer-area {
  flex: none;
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px var(--sp-6) 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.draft {
  display: flex; flex-direction: column; gap: 9px;
  padding: 11px;
  border: 1px solid var(--status-draft-border);
  border-radius: var(--radius-lg);
  background: var(--status-draft-bg);
  color: var(--status-draft);
}
.draft__head { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-xs); }
.draft__title { font-size: var(--fs-sm); font-weight: 700; }
.draft__origin { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft__count { font-family: var(--font-mono); }
.draft__body {
  padding: 10px;
  border: 1px solid var(--status-draft-border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--fs-md);
  line-height: 1.5;
  white-space: pre-wrap;
}
.draft__actions { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.draft__hint { display: flex; align-items: center; gap: 5px; font-size: var(--fs-xs); }

.draft--disabled {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text-muted);
}
.draft--disabled .draft__body { border-color: var(--border); color: var(--text-muted); }

.composer {
  display: flex; flex-direction: column; gap: var(--sp-4);
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.composer:focus-within { border-color: var(--border-focus); box-shadow: inset 0 0 0 1px var(--border-focus); }
.composer textarea {
  width: 100%;
  min-height: 42px;
  resize: vertical;
  border: 0; outline: none; background: none;
  font: inherit; font-size: var(--fs-md); line-height: 1.5;
  color: var(--text-primary);
}
.composer textarea::placeholder { color: var(--text-muted); }
.composer__foot { display: flex; align-items: center; gap: var(--sp-4); }
.composer__mark { display: flex; align-items: center; gap: var(--sp-3); flex: 1; min-width: 0;
                  font-size: var(--fs-xs); font-weight: 600; color: var(--status-ok); }
.composer__count { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
.composer__count.is-near { color: var(--status-wait); font-weight: 700; }
.composer--disabled { background: var(--bg-subtle); border-color: var(--border); }
.composer--disabled .composer__mark { color: var(--text-muted); }

/* strip peringatan di dalam kartu draft / kotak ketik */
.inline-note {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 6px 8px;
  border: 1px solid;
  border-radius: var(--radius-md);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.4;
}
.inline-note--warn   { background: var(--status-wait-bg);  border-color: var(--status-wait-border);  color: var(--status-wait); }
.inline-note--danger { background: var(--status-alarm-bg); border-color: var(--status-alarm-border); color: var(--status-alarm); }
.inline-note--ok     { background: var(--status-ok-bg);    border-color: var(--status-ok-border);    color: var(--status-ok); }
.inline-note--info   { background: var(--bg-subtle);       border-color: var(--border);              color: var(--text-secondary); }

/* 4.10 Panel info -------------------------------------------------------- */

.info-head {
  height: 40px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm); font-weight: 700;
}
.info-block { padding: 14px; border-bottom: 1px solid var(--border); }
.info-contact { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.info-contact__name { font-size: var(--fs-base); font-weight: 700; line-height: 1.3; }
.info-contact__id { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }

.info-rows { display: flex; flex-direction: column; gap: var(--sp-3); margin: 0; }
.info-row { display: flex; align-items: center; gap: var(--sp-4); font-size: var(--fs-sm); }
.info-row dt { width: 104px; flex: none; color: var(--text-muted); }
.info-row dd { margin: 0; flex: 1; min-width: 0; font-weight: 600; display: flex; align-items: center; gap: var(--sp-3); }

.decision-log { padding: 10px 14px 14px; }
.decision-log__head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding-bottom: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.5px;
  color: var(--text-muted);
}
.decision-log__head span:nth-child(2) { flex: 1; }

.log-entry { padding: 8px 0; border-bottom: 1px solid var(--border); }
.log-entry__row { display: flex; align-items: center; gap: 5px; }
.log-entry__time { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
.log-entry__status { margin-left: auto; }
.log-entry__reason { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.45; }

/* 4.11 Panel alarm (dropdown dari bilah atas) ---------------------------- */

.alarm-panel {
  position: absolute;
  top: calc(var(--h-topbar) + 6px);
  right: var(--sp-6);
  width: 424px;
  z-index: 40;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.app.has-banner .alarm-panel { top: calc(var(--h-topbar) + var(--h-banner) + 6px); }

.alarm-panel__head {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: var(--fs-md); font-weight: 700;
}
.alarm-panel__head .i { color: var(--status-alarm); }
.alarm-panel__count {
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--status-alarm-strong);
  color: #fff;
  font-size: var(--fs-xs);
}
.alarm-panel__updated { margin-left: auto; font-size: var(--fs-xs); font-weight: 400; color: var(--text-muted); }
.alarm-panel__foot {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 9px 12px;
  background: var(--bg-subtle);
  font-size: var(--fs-xs); color: var(--text-muted);
}
.alarm-panel__foot a { margin-left: auto; font-weight: 700; }

.alarm {
  display: flex; gap: 10px;
  padding: 11px;
  border-bottom: 1px solid var(--border);
}
.alarm:last-child { border-bottom: 0; }
.alarm__icon {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border: 1px solid;
  border-radius: var(--radius-md);
}
.alarm__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.alarm__head { display: flex; align-items: center; gap: var(--sp-4); }
.alarm__title { flex: 1; min-width: 0; font-size: var(--fs-md); font-weight: 700; }
.alarm__level {
  padding: 1px 6px; border: 1px solid; border-radius: var(--radius-sm);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.3px;
}
.alarm__since { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.alarm__detail { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.45; }
.alarm__foot { display: flex; align-items: center; gap: var(--sp-4); }
.alarm__metric {
  padding: 1px 6px; border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-secondary);
}
.alarm__link { margin-left: auto; display: inline-flex; align-items: center; gap: var(--sp-2);
               font-size: var(--fs-xs); font-weight: 700; }

.alarm--kritis { background: var(--status-alarm-bg); }
.alarm--kritis .alarm__title, .alarm--kritis .alarm__level, .alarm--kritis .alarm__icon { color: var(--status-alarm); }
.alarm--kritis .alarm__icon, .alarm--kritis .alarm__level { border-color: var(--status-alarm-border); background: var(--status-alarm-bg); }

.alarm--peringatan .alarm__title, .alarm--peringatan .alarm__level, .alarm--peringatan .alarm__icon { color: var(--status-wait); }
.alarm--peringatan .alarm__icon, .alarm--peringatan .alarm__level { border-color: var(--status-wait-border); background: var(--status-wait-bg); }

.alarm-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-4);
  padding: 22px;
  border: 1px solid var(--status-ok-border);
  border-radius: var(--radius-lg);
  background: var(--status-ok-bg);
  color: var(--status-ok);
  text-align: center;
}
.alarm-empty__title { font-size: var(--fs-lg); font-weight: 700; }
.alarm-empty p { margin: 0; font-size: var(--fs-sm); }

/* 4.12 Halaman: kepala, kartu angka, tabel, kartu robot ------------------ */

.page-head { display: flex; align-items: center; gap: var(--sp-5); }
.page-head__text { flex: 1; min-width: 0; }
.page-head h1 { margin: 0 0 3px; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.4px; }
.page-head p  { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }

.card {
  padding: var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
}
.card--flush { padding: 0; overflow: hidden; }
.card__head {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 12px var(--sp-6);
  border-bottom: 1px solid var(--border);
}
.card__title { flex: 1; font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.2px; }

.stat-row { display: flex; gap: var(--sp-5); }
.stat {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 5px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.stat__head { display: flex; align-items: center; gap: var(--sp-3); }
.stat__label { flex: 1; min-width: 0; font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); }
.stat__value { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.8px; line-height: 1.15; }
.stat__sub   { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.4; }

.stat--accent   .stat__value, .stat--accent   .stat__head .i { color: var(--accent); }
.stat--ok       .stat__value, .stat--ok       .stat__head .i { color: var(--status-ok); }
.stat--hp       .stat__value, .stat--hp       .stat__head .i { color: var(--sender-hp); }
.stat--alarm    .stat__value, .stat--alarm    .stat__head .i { color: var(--status-alarm); }
.stat--wait     .stat__value, .stat--wait     .stat__head .i { color: var(--status-wait); }
.stat--idle     .stat__value, .stat--idle     .stat__head .i { color: var(--status-idle); }
.stat--escalate .stat__value, .stat--escalate .stat__head .i { color: var(--status-escalate); }

/* biaya LLM */
.cost { display: flex; align-items: flex-end; gap: var(--sp-6); }
.cost__figure { display: flex; align-items: baseline; gap: var(--sp-4); }
.cost__usd { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -1px; line-height: 1.1; }
.cost__idr { font-size: var(--fs-md); font-weight: 600; color: var(--text-muted); }
.cost__note { font-size: var(--fs-xs); color: var(--text-muted); }
.cost__budget { flex: 1; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.cost__budget .meter--lg { width: 100%; }
.cost__warn { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); font-weight: 700; color: var(--status-wait); }

.kv-row { display: flex; gap: var(--sp-5); }
.kv { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kv dt { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.kv dd { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.kv dd.mono { font-weight: 600; }

.hr { height: 1px; background: var(--border); border: 0; margin: 0; }

/* tabel */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 10px; text-align: left; }
.table thead th {
  padding: 7px 10px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.4px;
  color: var(--text-muted);
}
.table tbody tr { border-bottom: 1px solid var(--border); }
.table tbody tr:last-child { border-bottom: 0; }
.table .num { text-align: right; font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; }
.table .num--alarm { color: var(--status-alarm); }
.table .num--wait  { color: var(--status-wait); }
.table .is-off td, .table .is-off .num { color: var(--text-muted); }
.table__chan { display: flex; align-items: center; gap: var(--sp-3); }
.table__chan-mark {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center;
  border-radius: var(--radius-sm); background: var(--channel-wa-bg); color: var(--channel-wa);
}
.is-off .table__chan-mark { background: var(--channel-off-bg); color: var(--channel-off); }
.table__sub { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
.table__status { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); font-weight: 600; }

/* kartu robot */
.robot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-6); }
.robot {
  display: flex; flex-direction: column; gap: var(--sp-5);
  padding: var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
}
.robot--aktif { border-color: var(--status-ok-border); }
.robot--diam  { border-color: var(--status-alarm-border); }
.robot__head { display: flex; align-items: center; gap: 11px; }
.robot__mark {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border-radius: var(--radius-lg); background: var(--channel-wa-bg); color: var(--channel-wa);
}
.robot--off .robot__mark { background: var(--channel-off-bg); color: var(--channel-off); }
.robot__name { flex: 1; min-width: 0; }
.robot__name strong { display: block; font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.2px; }
.robot__name span  { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
.robot--off .robot__name strong { color: var(--text-secondary); }
.robot__metrics { display: flex; gap: 10px; }
.robot__metrics .kv dd { font-size: var(--fs-xl); letter-spacing: -0.3px; }
.robot__meta { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.robot__meta-row { display: flex; gap: var(--sp-4); font-size: var(--fs-xs); }
.robot__meta-row dt { width: 120px; flex: none; color: var(--text-muted); }
.robot__meta-row dd { margin: 0; flex: 1; font-family: var(--font-mono); color: var(--text-secondary); font-weight: 500; }
.robot__actions { display: flex; align-items: center; gap: var(--sp-4); }
.robot__sync { margin-left: auto; display: flex; align-items: center; gap: 5px; font-size: var(--fs-xs); color: var(--text-muted); }
.robot--diam .robot__sync { color: var(--status-alarm); font-weight: 600; }

.summary-strip {
  display: flex; align-items: center; gap: var(--sp-6);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  font-size: var(--fs-md);
}
.summary-strip__item { display: flex; align-items: center; gap: var(--sp-3); font-weight: 600; }
.summary-strip__sep { width: 1px; height: 16px; background: var(--border); }
.summary-strip__updated { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }

/* 4.13 Keadaan kosong & gagal dimuat ------------------------------------- */

.empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-5);
  padding: var(--sp-9);
  text-align: center;
}
.empty__icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-muted);
}
.empty__title { font-size: var(--fs-lg); font-weight: 700; }
.empty p { margin: 0; max-width: 42ch; font-size: var(--fs-md); color: var(--text-secondary); line-height: 1.55; }

.errbox {
  display: flex; flex-direction: column; gap: var(--sp-4);
  padding: 12px;
  border: 1px solid var(--status-alarm-border);
  border-radius: var(--radius-lg);
  background: var(--status-alarm-bg);
  color: var(--status-alarm);
}
.errbox__title { display: flex; align-items: center; gap: 7px; font-size: var(--fs-md); font-weight: 700; }
.errbox p { margin: 0; font-size: var(--fs-xs); line-height: 1.5; }
.errbox__actions { display: flex; gap: var(--sp-3); }

.stale-strip {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 5px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted);
}
.is-stale { opacity: 0.45; pointer-events: none; }

/* rangka (skeleton) saat htmx memuat */
.skel { border-radius: var(--radius-sm); background: var(--bg-hover); }
.skel--line { height: 10px; }
.skel--btn  { height: 30px; }
@media (prefers-reduced-motion: no-preference) {
  .skel { animation: skel-pulse 1.4s ease-in-out infinite; }
  @keyframes skel-pulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }
}

/* indikator htmx: tampil hanya saat request berjalan */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline-flex; }

/* 5 — UTILITAS ============================================================ */

.row    { display: flex; align-items: center; gap: var(--sp-4); }
.col    { display: flex; flex-direction: column; gap: var(--sp-4); }
.grow   { flex: 1; min-width: 0; }
.muted  { color: var(--text-muted); }
.small  { font-size: var(--fs-xs); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
