/* ==========================================================================
   Arsip Legal — sistem desain (Modul Desain)
   Kosakata kelas mengikuti docs/SPEC.md §8. Halaman lain JANGAN mengubah berkas
   ini; gaya khusus halaman ditaruh di static/css/pages/<nama>.css.

   Daftar isi
   1.  Token desain
   2.  Dasar (reset, tipografi, tautan)
   3.  Ikon
   4.  Kerangka aplikasi (app-shell, sidebar, topbar, content, footer)
   5.  Layout (page-header, breadcrumb, grid, stack, cluster, section)
   6.  Kartu & statistik
   7.  Tombol
   8.  Badge, chip, tag
   9.  Tabel
   10. Formulir
   11. Filter & pencarian
   12. Peringatan & pesan
   13. Keadaan kosong
   14. Paginasi
   15. Tab
   16. Daftar deskripsi
   17. Timeline
   18. Pohon
   19. Dropdown
   20. Modal
   21. Progres
   22. Unggah (dropzone), pratinjau nama & dokumen
   23. Avatar & elemen kecil
   24. Halaman login & galat
   25. Panduan gaya
   26. Utilitas
   27. Responsif, gerak & cetak
   ========================================================================== */

/* 1. Token desain ========================================================= */
:root {
  /* Warna merek: biru tinta + aksen toska */
  --c-primary-50: #f1f5fb;
  --c-primary-100: #e1e9f6;
  --c-primary-200: #c3d3ec;
  --c-primary-300: #9ab3dc;
  --c-primary-400: #6a8cc6;
  --c-primary-500: #3f67aa;
  --c-primary-600: #2b5190;
  --c-primary-700: #1d3a6e;
  --c-primary-800: #172f59;
  --c-primary-900: #112344;
  --c-primary-950: #0b1830;

  --c-accent-50: #f0fdfa;
  --c-accent-100: #ccfbf1;
  --c-accent-200: #99f6e4;
  --c-accent-300: #5eead4;
  --c-accent-500: #14b8a6;
  --c-accent-600: #0d9488;
  --c-accent-700: #0f766e;
  --c-accent-800: #115e59;

  /* Netral (slate) */
  --c-slate-0: #ffffff;
  --c-slate-50: #f8fafc;
  --c-slate-100: #f1f5f9;
  --c-slate-200: #e2e8f0;
  --c-slate-300: #cbd5e1;
  --c-slate-400: #94a3b8;
  --c-slate-500: #64748b;
  --c-slate-600: #475569;
  --c-slate-700: #334155;
  --c-slate-800: #1e293b;
  --c-slate-900: #0f172a;

  /* Semantik */
  --c-success-50: #f0fdf4;
  --c-success-100: #dcfce7;
  --c-success-200: #bbf7d0;
  --c-success-300: #86efac;
  --c-success-600: #16a34a;
  --c-success-700: #15803d;
  --c-success-800: #166534;

  --c-warning-50: #fffbeb;
  --c-warning-100: #fef3c7;
  --c-warning-200: #fde68a;
  --c-warning-300: #fcd34d;
  --c-warning-500: #f59e0b;
  --c-warning-600: #d97706;
  --c-warning-700: #b45309;
  --c-warning-800: #92400e;

  --c-orange-50: #fff7ed;
  --c-orange-100: #ffedd5;
  --c-orange-200: #fed7aa;
  --c-orange-300: #fdba74;
  --c-orange-400: #fb923c;
  --c-orange-600: #ea580c;
  --c-orange-700: #c2410c;
  --c-orange-800: #9a3412;

  --c-danger-50: #fef2f2;
  --c-danger-100: #fee2e2;
  --c-danger-200: #fecaca;
  --c-danger-300: #fca5a5;
  --c-danger-600: #dc2626;
  --c-danger-700: #b91c1c;
  --c-danger-800: #991b1b;

  --c-info-50: #eff6ff;
  --c-info-100: #dbeafe;
  --c-info-200: #bfdbfe;
  --c-info-300: #93c5fd;
  --c-info-600: #2563eb;
  --c-info-700: #1d4ed8;
  --c-info-800: #1e40af;

  --c-burgundy-50: #fff1f2;
  --c-burgundy-100: #ffe4e6;
  --c-burgundy-300: #fda4af;
  --c-burgundy-700: #9f1239;
  --c-burgundy-800: #881337;

  /* Alias peran warna */
  --color-bg: #f3f5f9;
  --color-surface: #ffffff;
  --color-surface-muted: var(--c-slate-50);
  --color-surface-sunken: var(--c-slate-100);
  --color-border: var(--c-slate-200);
  --color-border-strong: var(--c-slate-300);
  --color-divider: #edf1f6;
  --color-text: var(--c-slate-800);
  --color-text-strong: var(--c-slate-900);
  --color-text-muted: #5c6878;
  --color-text-subtle: #667085;
  --color-primary: var(--c-primary-700);
  --color-primary-hover: var(--c-primary-800);
  --color-link: var(--c-primary-600);
  --color-link-hover: var(--c-primary-800);
  --color-focus: #2563eb;
  --color-row-hover: #f5f8fd;

  /* Tipografi */
  --font-sans: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.875rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --leading-tight: 1.25;
  --leading: 1.55;

  /* Spasi */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Radius */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* Bayangan */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 16px -4px rgba(15, 23, 42, 0.12), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 36px -10px rgba(15, 23, 42, 0.22), 0 4px 10px -4px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 28px 64px -16px rgba(11, 24, 48, 0.4);

  /* Ukuran kerangka */
  --sidebar-width: 264px;
  --topbar-height: 60px;
  --content-max: 1400px;
  --control-height: 2.375rem;

  /* Lapisan */
  --z-sticky: 20;
  --z-topbar: 30;
  --z-dropdown: 40;
  --z-backdrop: 55;
  --z-sidebar: 60;
  --z-skip: 100;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration: 0.16s;

  color-scheme: light;
}

/* 2. Dasar ================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-height) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-3);
  color: var(--color-text-strong);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-base); }
h5, h6 { font-size: var(--text-md); }

p { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 var(--space-3); padding-left: 1.25rem; }
li + li { margin-top: 0.15rem; }

a {
  color: var(--color-link);
  text-decoration: none;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

strong, b { font-weight: 650; }
small { font-size: var(--text-sm); }

img, svg, video, iframe { max-width: 100%; }
img { height: auto; }

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-5) 0;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--c-slate-100);
  color: var(--c-slate-800);
}
pre {
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--c-slate-900);
  color: var(--c-slate-100);
  line-height: 1.5;
}
pre code { padding: 0; background: none; color: inherit; }

table { border-collapse: collapse; }

button { font: inherit; color: inherit; }

::selection { background: var(--c-primary-200); color: var(--c-primary-950); }

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* 3. Ikon ================================================================= */
.icon {
  display: inline-block;
  flex: none;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  pointer-events: none;
}
.icon--sm { width: 0.95em; height: 0.95em; vertical-align: -0.12em; }
.icon--lg { width: 1.5em; height: 1.5em; vertical-align: -0.35em; }
.icon--spin { animation: spin 0.9s linear infinite; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 4. Kerangka aplikasi ==================================================== */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: var(--z-skip);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}
.skip-link:focus {
  top: var(--space-4);
  color: #fff;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar -------------------------------------------------------------- */
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--c-primary-800) 0%, var(--c-primary-900) 55%, var(--c-primary-950) 100%);
  color: #d6e0f2;
  z-index: var(--z-sidebar);
}
.sidebar :focus-visible { outline-color: var(--c-accent-300); }

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--topbar-height);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  color: #fff;
  text-decoration: none;
}
.sidebar__logo:hover { color: #fff; text-decoration: none; }
.sidebar__logo img { flex: none; width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
.sidebar__logo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sidebar__logo-text strong { font-size: var(--text-base); font-weight: 700; letter-spacing: 0.01em; }
.sidebar__logo-text small {
  overflow: hidden;
  color: #9fb4da;
  font-size: var(--text-2xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar__close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #c9d6ee;
  cursor: pointer;
}
.sidebar__close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.sidebar__nav {
  flex: 1;
  padding: var(--space-2) var(--space-3) var(--space-4);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.nav-section {
  margin: var(--space-5) var(--space-3) var(--space-1);
  color: #8fa6cf;
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list li + li { margin-top: 0; }
.nav-list:first-child { margin-top: var(--space-2); }
.sidebar__nav > .nav-section:first-child { margin-top: var(--space-3); }

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.25rem;
  padding: 0.45rem var(--space-3);
  border-radius: var(--radius);
  color: #d6e0f2;
  font-size: var(--text-md);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
.nav-link .icon { width: 1.15rem; height: 1.15rem; color: #9fb4da; }
.nav-link__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  text-decoration: none;
}
.nav-link:hover .icon { color: #d6e0f2; }
.nav-link.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
}
.nav-link.is-active::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  bottom: 0.45rem;
  left: calc(-1 * var(--space-3) + 2px);
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--c-accent-300);
}
.nav-link.is-active .icon { color: var(--c-accent-300); }
.nav-link .badge-count { margin-left: auto; }

.sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
  color: #fff;
  text-decoration: none;
}
.sidebar__user:hover { background: rgba(255, 255, 255, 0.06); color: #fff; text-decoration: none; }
.sidebar__user .avatar { background: rgba(255, 255, 255, 0.14); color: #fff; }
.sidebar__user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sidebar__user-name { overflow: hidden; font-size: var(--text-sm); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user-role { overflow: hidden; color: #9fb4da; font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }

.sidebar-backdrop { display: none; }

/* Main & topbar -------------------------------------------------------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--topbar-height);
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
}
.topbar .topbar__menu { display: none; }
.topbar__search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 560px;
}
.topbar__search input[type="search"] {
  background-color: var(--c-slate-50);
}
.topbar__search input[type="search"]:focus { background-color: #fff; }
.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}
.topbar__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-height);
  height: var(--control-height);
  border-radius: var(--radius);
  color: var(--c-slate-600);
  text-decoration: none;
}
.topbar__icon-btn .icon { width: 1.25rem; height: 1.25rem; }
.topbar__icon-btn:hover { background: var(--c-slate-100); color: var(--color-text-strong); text-decoration: none; }
.topbar__icon-btn.is-active { background: var(--c-primary-50); color: var(--color-primary); }
.topbar__icon-btn .badge-count {
  position: absolute;
  top: 1px;
  right: 0;
  box-shadow: 0 0 0 2px #fff;
}

.user-menu > summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.2rem var(--space-2) 0.2rem 0.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--color-text);
  cursor: pointer;
}
.user-menu > summary:hover,
.user-menu[open] > summary { background: var(--c-slate-100); border-color: var(--color-border); }
.user-menu__name { max-width: 12rem; overflow: hidden; font-size: var(--text-md); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.user-menu .dropdown__menu { min-width: 15rem; }

.content {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-8) var(--space-10);
}
.content:focus { outline: none; }

.app-footer {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-4) var(--space-8) var(--space-6);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.app-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}
.app-footer .icon { color: var(--c-slate-400); }

/* 5. Layout =============================================================== */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.page-header__text { flex: 1 1 22rem; min-width: 0; }
.page-title {
  margin: 0;
  color: var(--color-text-strong);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.page-subtitle {
  margin: var(--space-1) 0 0;
  max-width: 72ch;
  color: var(--color-text-muted);
  font-size: var(--text-base);
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumb { margin-bottom: var(--space-2); font-size: var(--text-sm); }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumb li { margin: 0; color: var(--color-text-muted); }
.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--c-slate-300);
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-link-hover); }
.breadcrumb [aria-current] { color: var(--color-text); font-weight: 500; }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid > * { min-width: 0; }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack--sm { gap: var(--space-2); }
.stack--lg { gap: var(--space-6); }
.stack > * { margin-top: 0; margin-bottom: 0; }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.section { margin-bottom: var(--space-8); }
.section:last-child { margin-bottom: 0; }
.section__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  font-size: var(--text-lg);
}

.divider {
  height: 0;
  margin: var(--space-5) 0;
  border: 0;
  border-top: 1px solid var(--color-border);
}

/* 6. Kartu & statistik ==================================================== */
.card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}
.card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-divider);
}
.card__header > :first-child { min-width: 0; }
.card__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--color-text-strong);
  font-size: var(--text-base);
  font-weight: 650;
  line-height: 1.35;
}
.card__title .icon { color: var(--c-primary-500); }
.card__subtitle {
  margin: 0.15rem 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}
.card__body { padding: var(--space-5); }
.card__body > :last-child { margin-bottom: 0; }
.card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-divider);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--color-surface-muted);
  font-size: var(--text-sm);
}
.card--flush > .card__body { padding: 0; }
.card--flush .table th:first-child,
.card--flush .table td:first-child { padding-left: var(--space-5); }
.card--flush .table th:last-child,
.card--flush .table td:last-child { padding-right: var(--space-5); }
.card--flush .table tbody tr:last-child > * { border-bottom: 0; }
.card--flush > .table-wrap:first-child,
.card--flush > .card__body:first-child > .table-wrap:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card--flush > .empty-state { padding-block: var(--space-10); }
.card--muted { background: var(--color-surface-muted); box-shadow: none; }
.card--danger { border-color: var(--c-danger-200); box-shadow: inset 4px 0 0 var(--c-danger-600), var(--shadow-xs); }
.card--danger .card__title .icon { color: var(--c-danger-700); }
.card--warning { border-color: var(--c-warning-200); box-shadow: inset 4px 0 0 var(--c-warning-500), var(--shadow-xs); }
.card--warning .card__title .icon { color: var(--c-warning-700); }

/* Statistik ------------------------------------------------------------- */
.stat {
  --stat-accent: var(--c-primary-600);
  --stat-soft: var(--c-primary-50);
  --stat-value: var(--color-text-strong);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label icon"
    "value icon"
    "meta  meta";
  align-items: start;
  gap: 0.15rem var(--space-3);
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: inset 3px 0 0 var(--stat-accent), var(--shadow-xs);
  color: var(--color-text);
  text-decoration: none;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
a.stat:hover {
  border-color: var(--c-primary-200);
  box-shadow: inset 3px 0 0 var(--stat-accent), var(--shadow-md);
  color: var(--color-text);
  text-decoration: none;
  transform: translateY(-1px);
}
.stat__label {
  grid-area: label;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}
.stat__value {
  grid-area: value;
  color: var(--stat-value);
  font-size: var(--text-3xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.stat__meta {
  grid-area: meta;
  margin-top: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.stat__icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--stat-soft);
  color: var(--stat-accent);
}
.stat__icon .icon { width: 1.25rem; height: 1.25rem; }
.stat--danger { --stat-accent: var(--c-danger-600); --stat-soft: var(--c-danger-50); --stat-value: var(--c-danger-700); }
.stat--warning { --stat-accent: var(--c-warning-500); --stat-soft: var(--c-warning-50); --stat-value: var(--c-warning-800); }
.stat--success { --stat-accent: var(--c-success-600); --stat-soft: var(--c-success-50); --stat-value: var(--c-success-800); }
.stat--info { --stat-accent: var(--c-info-600); --stat-soft: var(--c-info-50); --stat-value: var(--c-info-800); }
.stat--neutral { --stat-accent: var(--c-slate-400); --stat-soft: var(--c-slate-100); --stat-value: var(--c-slate-700); }
.stat--warning .stat__icon { color: var(--c-warning-700); }

/* 7. Tombol =============================================================== */
.btn {
  --btn-bg: var(--color-surface);
  --btn-fg: var(--c-slate-700);
  --btn-border: var(--color-border-strong);
  --btn-bg-hover: var(--c-slate-50);
  --btn-border-hover: var(--c-slate-400);
  --btn-fg-hover: var(--color-text-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease),
    color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.btn:hover {
  border-color: var(--btn-border-hover);
  background: var(--btn-bg-hover);
  color: var(--btn-fg-hover);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 1.1em; height: 1.1em; vertical-align: 0; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

.btn--primary {
  --btn-bg: var(--color-primary);
  --btn-fg: #fff;
  --btn-border: var(--color-primary);
  --btn-bg-hover: var(--color-primary-hover);
  --btn-border-hover: var(--color-primary-hover);
  --btn-fg-hover: #fff;
  box-shadow: 0 1px 2px rgba(17, 35, 68, 0.25);
}
.btn--secondary {
  --btn-bg: var(--color-surface);
  --btn-fg: var(--c-slate-700);
  --btn-border: var(--color-border-strong);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--c-slate-600);
  --btn-border: transparent;
  --btn-bg-hover: var(--c-slate-100);
  --btn-border-hover: transparent;
  --btn-fg-hover: var(--color-text-strong);
}
.btn--danger {
  --btn-bg: var(--c-danger-700);
  --btn-fg: #fff;
  --btn-border: var(--c-danger-700);
  --btn-bg-hover: var(--c-danger-800);
  --btn-border-hover: var(--c-danger-800);
  --btn-fg-hover: #fff;
}
.btn--success {
  --btn-bg: var(--c-success-700);
  --btn-fg: #fff;
  --btn-border: var(--c-success-700);
  --btn-bg-hover: var(--c-success-800);
  --btn-border-hover: var(--c-success-800);
  --btn-fg-hover: #fff;
}
.btn--warning {
  --btn-bg: var(--c-warning-700);
  --btn-fg: #fff;
  --btn-border: var(--c-warning-700);
  --btn-bg-hover: var(--c-warning-800);
  --btn-border-hover: var(--c-warning-800);
  --btn-fg-hover: #fff;
}
.btn--sm {
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  gap: 0.35rem;
}
.btn--lg {
  min-height: 2.75rem;
  padding: 0.55rem 1.3rem;
  font-size: var(--text-base);
}
.btn--block { display: flex; width: 100%; }
.btn--icon {
  width: var(--control-height);
  min-width: var(--control-height);
  padding: 0;
}
.btn--icon.btn--sm { width: 2rem; min-width: 2rem; }
.btn--icon.btn--lg { width: 2.75rem; min-width: 2.75rem; }
.btn--icon .icon { width: 1.15rem; height: 1.15rem; }

.btn:disabled,
.btn[aria-disabled="true"],
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

/* Status sedang diproses (diset app.js saat form dikirim) */
.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"] > * { visibility: hidden; }
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid var(--btn-fg);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-group { display: inline-flex; align-items: stretch; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn + .btn { margin-left: -1px; }
.btn-group > .btn:first-child { border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius); }
.btn-group > .btn:last-child { border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.btn-group > .btn:hover,
.btn-group > .btn:focus-visible { z-index: 1; }
.btn-group > .btn.is-active {
  z-index: 1;
  --btn-bg: var(--c-primary-50);
  --btn-fg: var(--color-primary);
  --btn-border: var(--c-primary-300);
}

/* 8. Badge, chip, tag ===================================================== */
.badge {
  --badge-bg: var(--c-slate-100);
  --badge-fg: var(--c-slate-700);
  --badge-border: var(--c-slate-200);
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  max-width: 100%;
  padding: 0.18em 0.6em;
  border: 1px solid var(--badge-border);
  border-radius: var(--radius-pill);
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  vertical-align: middle;
}
.badge .icon { width: 1em; height: 1em; vertical-align: 0; }

/* Status masa berlaku */
.badge--valid { --badge-bg: var(--c-success-50); --badge-fg: var(--c-success-800); --badge-border: var(--c-success-200); }
.badge--expiring { --badge-bg: var(--c-warning-50); --badge-fg: var(--c-warning-800); --badge-border: var(--c-warning-300); }
.badge--critical { --badge-bg: var(--c-orange-100); --badge-fg: var(--c-orange-800); --badge-border: var(--c-orange-400); }
.badge--expired { --badge-bg: var(--c-danger-700); --badge-fg: #fff; --badge-border: var(--c-danger-700); }
.badge--permanent { --badge-bg: var(--c-slate-100); --badge-fg: var(--c-slate-600); --badge-border: var(--c-slate-200); }
.badge--inactive {
  --badge-bg: transparent;
  --badge-fg: var(--color-text-muted);
  --badge-border: var(--c-slate-300);
  border-style: dashed;
  text-decoration: line-through;
  text-decoration-color: var(--c-slate-400);
}
.badge--valid::before,
.badge--expiring::before,
.badge--critical::before,
.badge--expired::before {
  content: "";
  flex: none;
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: currentColor;
}

/* Verifikasi */
.badge--pending { --badge-bg: #fff; --badge-fg: var(--c-warning-800); --badge-border: var(--c-warning-600); }
.badge--verified { --badge-bg: var(--c-success-50); --badge-fg: var(--c-success-800); --badge-border: var(--c-success-300); }
.badge--needs-fix { --badge-bg: var(--c-danger-50); --badge-fg: var(--c-danger-800); --badge-border: var(--c-danger-300); }

/* Perpanjangan & klasifikasi */
.badge--renewal-progress { --badge-bg: var(--c-info-50); --badge-fg: var(--c-info-800); --badge-border: var(--c-info-200); }
.badge--renewal-no { --badge-bg: var(--c-slate-100); --badge-fg: var(--c-slate-600); --badge-border: var(--c-slate-300); }
.badge--confidential { --badge-bg: var(--c-burgundy-50); --badge-fg: var(--c-burgundy-800); --badge-border: var(--c-burgundy-300); }

/* Peran */
.badge--role-admin { --badge-bg: var(--color-primary); --badge-fg: #fff; --badge-border: var(--color-primary); }
.badge--role-editor { --badge-bg: var(--c-accent-50); --badge-fg: var(--c-accent-800); --badge-border: var(--c-accent-200); }
.badge--role-viewer { --badge-bg: var(--c-slate-100); --badge-fg: var(--c-slate-700); --badge-border: var(--c-slate-300); }

/* Umum */
.badge--neutral { --badge-bg: var(--c-slate-100); --badge-fg: var(--c-slate-700); --badge-border: var(--c-slate-200); }
.badge--success { --badge-bg: var(--c-success-50); --badge-fg: var(--c-success-800); --badge-border: var(--c-success-200); }
.badge--warning { --badge-bg: var(--c-warning-50); --badge-fg: var(--c-warning-800); --badge-border: var(--c-warning-200); }
.badge--danger { --badge-bg: var(--c-danger-50); --badge-fg: var(--c-danger-800); --badge-border: var(--c-danger-200); }
.badge--info { --badge-bg: var(--c-info-50); --badge-fg: var(--c-info-800); --badge-border: var(--c-info-200); }

.badge-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: var(--radius-pill);
  background: var(--c-danger-600);
  color: #fff;
  font-size: var(--text-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.badge-count--warning { background: var(--c-warning-300); color: var(--c-slate-900); }
.badge-count--neutral { background: var(--c-slate-200); color: var(--c-slate-700); }

/* Chip kategori ------------------------------------------------------------ */
.chip {
  --chip-bg: var(--c-slate-100);
  --chip-fg: var(--c-slate-700);
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  max-width: 100%;
  padding: 0.12em 0.5em;
  border-radius: var(--radius-sm);
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}
a.chip:hover { filter: brightness(0.96); text-decoration: none; color: var(--chip-fg); }
.chip--slate { --chip-bg: #eef2f6; --chip-fg: #334155; }
.chip--blue { --chip-bg: #dbeafe; --chip-fg: #1e40af; }
.chip--teal { --chip-bg: #ccfbf1; --chip-fg: #115e59; }
.chip--green { --chip-bg: #dcfce7; --chip-fg: #166534; }
.chip--amber { --chip-bg: #fef3c7; --chip-fg: #92400e; }
.chip--orange { --chip-bg: #ffedd5; --chip-fg: #9a3412; }
.chip--red { --chip-bg: #fee2e2; --chip-fg: #991b1b; }
.chip--purple { --chip-bg: #f3e8ff; --chip-fg: #6b21a8; }
.chip--pink { --chip-bg: #fce7f3; --chip-fg: #9d174d; }
.chip--indigo { --chip-bg: #e0e7ff; --chip-fg: #3730a3; }

/* Label dokumen (tag) ---------------------------------------------------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tag-list li { margin: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.1em 0.6em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--c-slate-600);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.tag::before { content: "#"; color: var(--c-slate-400); }
a.tag:hover {
  border-color: var(--c-primary-300);
  background: var(--c-primary-50);
  color: var(--color-primary);
  text-decoration: none;
}

/* 9. Tabel ================================================================ */
.table-wrap {
  /* position: relative agar elemen absolut (mis. .visually-hidden) ikut tergulir, tidak melebarkan halaman */
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
}
.table th,
.table td {
  padding: 0.75rem var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  text-align: left;
  vertical-align: top;
}
.table thead th {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: bottom;
}
.table thead th a { display: inline-flex; align-items: center; gap: 0.25rem; color: inherit; }
.table thead th a:hover { color: var(--color-text-strong); text-decoration: none; }
.table tbody th { font-weight: 600; }
.table tfoot td,
.table tfoot th { background: var(--color-surface-muted); font-weight: 600; }
.table--compact th,
.table--compact td { padding: 0.45rem var(--space-3); }
.table--compact thead th { padding-top: 0.45rem; padding-bottom: 0.45rem; }
.table--hover tbody tr:hover > *,
.table tbody tr[data-href]:hover > * { background: var(--color-row-hover); }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover .table__primary a { color: var(--color-link-hover); text-decoration: underline; }
.table tbody tr.is-muted > * { color: var(--color-text-muted); }
.table tbody tr.is-muted .table__primary,
.table tbody tr.is-muted .table__primary a { color: var(--color-text-muted); font-weight: 500; }
.table tbody tr.is-highlight > * { background: var(--c-warning-50); }

.table__primary {
  color: var(--color-text-strong);
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.table__primary a { color: var(--color-text-strong); }
.table__primary a:hover { color: var(--color-link-hover); }
.table__secondary {
  margin-top: 0.2rem;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}
.table .cell-actions,
.cell-actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}
.cell-actions > * + * { margin-left: var(--space-1); }
.table .num,
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Komponen tabel dokumen */
.doc-table td:first-child { min-width: 20rem; }
.doc-table__reg {
  display: block;
  margin-bottom: 0.1rem;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.doc-table__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.45rem;
}
.doc-table__badges { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.doc-table__date { white-space: nowrap; }
.doc-table__date + .badge { margin-top: 0.3rem; }

/* 10. Formulir ============================================================ */
:where(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"],
  [type="submit"], [type="button"], [type="reset"], [type="image"], [type="hidden"]), select, textarea) {
  display: block;
  width: 100%;
  min-height: var(--control-height);
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background-color: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-md);
  line-height: 1.4;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
:where(input, select, textarea)::placeholder { color: var(--color-text-subtle); opacity: 1; }
:where(input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea):hover { border-color: var(--c-slate-400); }
:where(input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea):focus {
  border-color: var(--c-primary-500);
  outline: none;
  box-shadow: 0 0 0 3px rgba(63, 103, 170, 0.22);
}
:where(input, select, textarea):disabled,
:where(input, textarea)[readonly] {
  background-color: var(--c-slate-100);
  color: var(--color-text-muted);
  cursor: not-allowed;
}
:where(input, textarea)[readonly] { cursor: default; }
:where(input, select, textarea)[aria-invalid="true"] { border-color: var(--c-danger-600); }
:where(input, select, textarea)[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18); }

textarea { min-height: 6rem; resize: vertical; }
input[type="number"] { font-variant-numeric: tabular-nums; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }

select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 0.65rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
  cursor: pointer;
}
select[multiple] { min-height: 7rem; padding: 0.35rem; }
select[multiple] option { padding: 0.25rem 0.4rem; border-radius: 4px; }

input[type="checkbox"],
input[type="radio"] {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--color-primary);
  vertical-align: -0.15em;
  cursor: pointer;
}

input[type="file"] {
  max-width: 100%;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: var(--text-md);
}
input[type="file"]::file-selector-button {
  margin-right: var(--space-3);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--c-slate-700);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--duration) var(--ease);
}
input[type="file"]::file-selector-button:hover { background: var(--c-slate-50); }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
label { cursor: default; }

.form { display: block; }
.form > :last-child { margin-bottom: 0; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-5);
  align-items: start;
}
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid > * { min-width: 0; }
.form-grid + .form-grid { margin-top: var(--space-5); }

.form-section { padding: var(--space-6) 0; }
.form-section:first-child { padding-top: 0; }
.form-section:last-child { padding-bottom: 0; }
.form-section + .form-section { border-top: 1px solid var(--color-divider); }
.form-section__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-1);
  color: var(--color-text-strong);
  font-size: var(--text-base);
  font-weight: 650;
}
.form-section__title .icon { color: var(--c-primary-500); }
.form-section__desc {
  margin: 0 0 var(--space-4);
  max-width: 75ch;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.field--full { grid-column: 1 / -1; }
.field__label {
  display: block;
  color: var(--c-slate-700);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.35;
}
.field__required {
  margin-left: 0.2rem;
  color: var(--c-danger-700);
  font-weight: 700;
}
.field__help {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}
.field__help ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.field__errors {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--c-danger-700);
  font-size: var(--text-sm);
  font-weight: 500;
}
.field__errors li { margin: 0; }
.field__errors li::before { content: "⚠ "; }
.field--error .field__label { color: var(--c-danger-800); }
.field--error :where(input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea) {
  border-color: var(--c-danger-600);
  background-color: #fffafa;
}

.field--checkbox { gap: 0.25rem; }
.field__control {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.field__control > input[type="checkbox"] { margin-top: 0.15rem; }
.field--checkbox .field__label { font-weight: 500; cursor: pointer; }
.field--checkbox .field__help,
.field--checkbox .field__errors { padding-left: 1.65rem; }

.field__choices > div,
.field__choices ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.field__choices li { margin: 0; }
.field__choices label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
  font-size: var(--text-md);
  font-weight: 400;
  cursor: pointer;
}
.field__choices--stacked > div,
.field__choices--stacked ul { flex-direction: column; }
.field fieldset > .field__label { margin-bottom: 0.4rem; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-divider);
}
.form-actions--start { justify-content: flex-start; }
.form-actions__note { margin-right: auto; color: var(--color-text-muted); font-size: var(--text-sm); }
.card__body > .form-actions:last-child { margin-bottom: 0; }

.form-errors { margin-bottom: var(--space-5); }
.form-errors ul { margin: 0.25rem 0 0; }

/* 11. Filter & pencarian ================================================== */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}
.card > .filter-bar {
  margin-bottom: 0;
  border: 0;
  border-bottom: 1px solid var(--color-divider);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: none;
}
.filter-bar__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--space-3);
  align-items: end;
}
.filter-bar__row > .search-input { grid-column: span 2; }
.filter-bar__row .field { gap: 0.25rem; }
.filter-bar__row .field__label { font-size: var(--text-xs); color: var(--color-text-muted); }
.filter-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}
.filter-bar__actions > :first-child:not(.btn) { margin-right: auto; color: var(--color-text-muted); font-size: var(--text-sm); }

.search-input {
  position: relative;
  display: block;
  min-width: 0;
}
.search-input > .icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: -0.525rem;
  color: var(--color-text-subtle);
  pointer-events: none;
}
.search-input :where(input) { padding-left: 2.35rem; }
.search-input__hint {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  transform: translateY(-50%);
  pointer-events: none;
}
.search-input:focus-within .search-input__hint { display: none; }
.search-input > .icon + input,
.search-input > .icon + label + input { padding-left: 2.35rem; }

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-sm);
}
.active-filters__label { margin-right: 0.15rem; color: var(--color-text-muted); font-weight: 600; }
.active-filters > a:not(.active-filters__clear),
.active-filters__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.45rem 0.15rem 0.65rem;
  border: 1px solid var(--c-primary-200);
  border-radius: var(--radius-pill);
  background: var(--c-primary-50);
  color: var(--c-primary-800);
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
}
.active-filters > a:not(.active-filters__clear) .icon { width: 0.9em; height: 0.9em; opacity: 0.7; }
.active-filters > a:not(.active-filters__clear):hover {
  border-color: var(--c-danger-300);
  background: var(--c-danger-50);
  color: var(--c-danger-800);
  text-decoration: none;
}
.active-filters__clear { margin-left: 0.25rem; color: var(--color-text-muted); font-weight: 600; }

/* 12. Peringatan & pesan ================================================== */
.messages {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.alert {
  --alert-bg: var(--c-info-50);
  --alert-fg: var(--c-info-800);
  --alert-border: var(--c-info-200);
  --alert-accent: var(--c-info-600);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 0.8rem var(--space-4);
  border: 1px solid var(--alert-border);
  border-left: 4px solid var(--alert-accent);
  border-radius: var(--radius-md);
  background: var(--alert-bg);
  color: var(--alert-fg);
  font-size: var(--text-md);
  line-height: 1.5;
}
.alert > .icon { width: 1.2rem; height: 1.2rem; margin-top: 0.05rem; color: var(--alert-accent); }
.alert__body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.alert__body > :last-child { margin-bottom: 0; }
.alert__body ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.alert__title { margin: 0 0 0.15rem; font-weight: 700; }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.alert__close,
.alert [data-dismiss] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.2rem -0.4rem -0.2rem 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
}
.alert__close:hover,
.alert [data-dismiss]:hover { background: rgba(15, 23, 42, 0.07); opacity: 1; }
.alert--info { --alert-bg: var(--c-info-50); --alert-fg: var(--c-info-800); --alert-border: var(--c-info-200); --alert-accent: var(--c-info-600); }
.alert--success { --alert-bg: var(--c-success-50); --alert-fg: var(--c-success-800); --alert-border: var(--c-success-200); --alert-accent: var(--c-success-600); }
.alert--warning { --alert-bg: var(--c-warning-50); --alert-fg: var(--c-warning-800); --alert-border: var(--c-warning-200); --alert-accent: var(--c-warning-500); }
.alert--warning > .icon { color: var(--c-warning-700); }
.alert--danger { --alert-bg: var(--c-danger-50); --alert-fg: var(--c-danger-800); --alert-border: var(--c-danger-200); --alert-accent: var(--c-danger-600); }
.alert.is-leaving { opacity: 0; transform: translateY(-4px); transition: opacity 0.15s ease, transform 0.15s ease; }

/* 13. Keadaan kosong ====================================================== */
.empty-state {
  padding: var(--space-12) var(--space-6);
  color: var(--color-text-muted);
  text-align: center;
}
.empty-state__icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  background: var(--c-slate-100);
  color: var(--c-slate-500);
}
.empty-state__icon .icon { width: 1.5rem; height: 1.5rem; }
.empty-state__title {
  margin: 0 0 var(--space-1);
  color: var(--color-text-strong);
  font-size: var(--text-base);
  font-weight: 650;
}
.empty-state__text {
  max-width: 46ch;
  margin: 0 auto;
  font-size: var(--text-md);
}
.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

/* 14. Paginasi ============================================================ */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-4);
  font-size: var(--text-md);
}
.card .pagination {
  margin-top: 0;
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-divider);
}
.pagination__summary { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.pagination__summary strong { color: var(--color-text); font-weight: 600; }
.pagination__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pagination__list li { margin: 0; }
.pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.125rem;
  height: 2.125rem;
  padding: 0 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--c-slate-700);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
a.pagination__item:hover {
  border-color: var(--c-primary-300);
  background: var(--c-primary-50);
  color: var(--color-primary);
  text-decoration: none;
}
.pagination__item.is-current {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
}
.pagination__item.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.pagination__item--gap { border-color: transparent; background: transparent; }

/* 15. Tab ================================================================= */
.tabs {
  position: relative;
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-5);
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.card > .tabs { margin-bottom: 0; padding: 0 var(--space-4); }
.tabs__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: -1px;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--c-slate-600);
  font-size: var(--text-md);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.tabs__item:hover { border-bottom-color: var(--c-slate-300); color: var(--color-text-strong); text-decoration: none; }
.tabs__item.is-active,
.tabs__item[aria-selected="true"],
.tabs__item[aria-current="page"] {
  border-bottom-color: var(--color-primary);
  color: var(--color-primary);
}
.tabs__item:focus-visible { outline-offset: -2px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tabs__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.25rem;
  padding: 0 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--c-slate-100);
  color: var(--c-slate-600);
  font-size: var(--text-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tabs__item.is-active .tabs__count,
.tabs__item[aria-selected="true"] .tabs__count,
.tabs__item[aria-current="page"] .tabs__count { background: var(--c-primary-100); color: var(--color-primary); }

/* 16. Daftar deskripsi ==================================================== */
.dl { margin: 0; }
.dl__row {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr);
  gap: 0.2rem var(--space-4);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-divider);
}
.dl__row:first-child { padding-top: 0; }
.dl__row:last-child { padding-bottom: 0; border-bottom: 0; }
.dl__term {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}
.dl__desc {
  min-width: 0;
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-md);
  overflow-wrap: anywhere;
}
.dl--2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-8);
}
.dl--2col .dl__row:first-child,
.dl--2col .dl__row:nth-child(2) { padding-top: 0; }
.dl--2col .dl__row:last-child { padding-bottom: 0.6rem; border-bottom: 1px solid var(--color-divider); }

/* 17. Timeline ============================================================ */
.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline__item {
  position: relative;
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding-bottom: var(--space-5);
}
.timeline__item::before {
  content: "";
  position: absolute;
  top: 1.75rem;
  bottom: 0.25rem;
  left: calc(0.8125rem - 1px);
  width: 2px;
  border-radius: 2px;
  background: var(--color-border);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:last-child::before { display: none; }
.timeline__marker {
  --marker-fg: var(--c-primary-600);
  --marker-bg: var(--c-primary-50);
  --marker-border: var(--c-primary-200);
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: none;
  width: 1.625rem;
  height: 1.625rem;
  border: 2px solid var(--marker-border);
  border-radius: 50%;
  background: var(--marker-bg);
  color: var(--marker-fg);
}
.timeline__marker .icon { width: 0.8rem; height: 0.8rem; stroke-width: 2.5; }
.timeline__marker--success { --marker-fg: var(--c-success-700); --marker-bg: var(--c-success-50); --marker-border: var(--c-success-300); }
.timeline__marker--warning { --marker-fg: var(--c-warning-700); --marker-bg: var(--c-warning-50); --marker-border: var(--c-warning-300); }
.timeline__marker--danger { --marker-fg: var(--c-danger-700); --marker-bg: var(--c-danger-50); --marker-border: var(--c-danger-300); }
.timeline__marker--neutral { --marker-fg: var(--c-slate-500); --marker-bg: var(--c-slate-50); --marker-border: var(--c-slate-300); }
.timeline__marker--info { --marker-fg: var(--c-info-700); --marker-bg: var(--c-info-50); --marker-border: var(--c-info-300); }
.timeline__content { flex: 1; min-width: 0; padding-top: 0.15rem; }
.timeline__title {
  margin: 0;
  color: var(--color-text-strong);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.4;
}
.timeline__meta {
  margin: 0.1rem 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.timeline__body {
  margin-top: var(--space-2);
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
  background: var(--color-surface-muted);
  font-size: var(--text-md);
  overflow-wrap: anywhere;
}
.timeline__body > :last-child { margin-bottom: 0; }

/* 18. Pohon =============================================================== */
.tree {
  margin: 0;
  padding: 0;
  font-size: var(--text-md);
  list-style: none;
}
.tree li { margin: 0; }
.tree__node { margin: 0; }
.tree__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.25rem;
  padding: 0.35rem var(--space-2);
  border-radius: var(--radius);
  color: var(--color-text-strong);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.tree__label::-webkit-details-marker { display: none; }
.tree__label::before {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  margin: 0 0.3rem 0 0.15rem;
  border-right: 2px solid var(--c-slate-400);
  border-bottom: 2px solid var(--c-slate-400);
  transform: rotate(-45deg);
  transition: transform var(--duration) var(--ease);
}
.tree__node[open] > .tree__label::before { transform: rotate(45deg); }
.tree__label:hover { background: var(--c-slate-100); }
.tree__label .icon { color: var(--c-primary-500); }
.tree__label a { color: inherit; }
.tree__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex: none;
  min-width: 1.6rem;
  height: 1.3rem;
  margin-left: auto;
  padding: 0 0.45rem;
  border-radius: var(--radius-pill);
  background: var(--c-slate-100);
  color: var(--c-slate-600);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tree__label:hover .tree__count { background: var(--color-surface); }
.tree__count--alert { background: var(--c-danger-50); color: var(--c-danger-700); }
.tree__children {
  margin: 0.1rem 0 0.25rem 0.95rem;
  padding: 0 0 0 0.6rem;
  border-left: 1px dashed var(--color-border-strong);
  list-style: none;
}
.tree__leaf {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2rem;
  padding: 0.3rem var(--space-2) 0.3rem 1.55rem;
  border-radius: var(--radius);
  color: var(--color-text);
  font-weight: 400;
}
a.tree__leaf:hover,
.tree__leaf:has(a:hover) { background: var(--color-row-hover); text-decoration: none; }
.tree__leaf .icon { color: var(--c-slate-400); }
.tree__leaf > a { min-width: 0; overflow: hidden; color: inherit; text-overflow: ellipsis; white-space: nowrap; }
.tree__leaf .badge,
.tree__leaf .chip { flex: none; }

/* 19. Dropdown ============================================================ */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown__menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
  min-width: 13rem;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  text-align: left;
  animation: dropdown-in 0.12s var(--ease);
}
.dropdown--end .dropdown__menu,
.dropdown.is-flipped .dropdown__menu { right: 0; left: auto; }
.dropdown--up .dropdown__menu,
.dropdown.is-up .dropdown__menu { top: auto; bottom: calc(100% + 0.35rem); }
.dropdown__menu form { display: block; margin: 0; }
.dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--c-slate-700);
  font-family: inherit;
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.dropdown__item .icon { color: var(--c-slate-500); }
.dropdown__item:hover,
.dropdown__item:focus-visible {
  background: var(--c-slate-100);
  color: var(--color-text-strong);
  text-decoration: none;
}
.dropdown__item:focus-visible { outline-offset: -2px; }
.dropdown__item.is-active { background: var(--c-primary-50); color: var(--color-primary); }
.dropdown__item--danger,
.dropdown__item--danger .icon { color: var(--c-danger-700); }
.dropdown__item--danger:hover,
.dropdown__item--danger:focus-visible { background: var(--c-danger-50); color: var(--c-danger-800); }
.dropdown__divider {
  height: 1px;
  margin: 0.35rem -0.35rem;
  background: var(--color-divider);
}
.dropdown__header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: -0.35rem -0.35rem 0.35rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--color-divider);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--color-surface-muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}
.dropdown__header strong { color: var(--color-text-strong); font-size: var(--text-md); }
.dropdown__header .badge { align-self: flex-start; margin-top: 0.2rem; }

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* 20. Modal =============================================================== */
.modal {
  width: min(560px, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-xl);
  color: var(--color-text);
}
.modal[open] {
  display: flex;
  flex-direction: column;
  animation: modal-in 0.18s var(--ease);
}
.modal::backdrop {
  background: rgba(11, 24, 48, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal--lg { width: min(820px, calc(100vw - 2rem)); }
.modal--sm { width: min(420px, calc(100vw - 2rem)); }
.modal > form { display: flex; flex-direction: column; min-height: 0; margin: 0; }
.modal__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-divider);
}
.modal__header [data-modal-close] { margin-left: auto; }
.modal__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--color-text-strong);
  font-size: var(--text-lg);
  font-weight: 700;
}
.modal__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--space-5);
  overflow-y: auto;
}
.modal__body > :last-child { margin-bottom: 0; }
.modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-divider);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: var(--color-surface-muted);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* 21. Progres ============================================================= */
.progress {
  --progress-color: var(--c-primary-600);
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--c-slate-200);
}
.progress__bar {
  display: block;
  width: 0;
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--progress-color);
  transition: width 0.3s var(--ease);
}
.progress--danger { --progress-color: var(--c-danger-600); }
.progress--warning { --progress-color: var(--c-warning-500); }
.progress--success { --progress-color: var(--c-success-600); }
.progress--info { --progress-color: var(--c-info-600); }
.progress--lg { height: 0.75rem; }

/* 22. Unggah & pratinjau ================================================== */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 11rem;
  padding: var(--space-8) var(--space-5);
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--duration) var(--ease), background-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.dropzone:hover { border-color: var(--c-primary-400); background: var(--c-primary-50); }
.dropzone:focus-within {
  border-color: var(--c-primary-500);
  box-shadow: 0 0 0 3px rgba(63, 103, 170, 0.2);
}
.dropzone.is-dragover {
  border-color: var(--c-accent-600);
  border-style: solid;
  background: var(--c-accent-50);
  box-shadow: inset 0 0 0 4px rgba(13, 148, 136, 0.1);
}
.dropzone.has-file { border-style: solid; border-color: var(--c-primary-300); background: var(--color-surface); }
.dropzone.has-error { border-color: var(--c-danger-600); background: var(--c-danger-50); }
.dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  clip-path: inset(50%);
}
.dropzone__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  color: var(--c-primary-600);
}
.dropzone__icon .icon { width: 1.35rem; height: 1.35rem; }
.dropzone.is-dragover .dropzone__icon { color: var(--c-accent-700); }
.dropzone__title { margin: 0; color: var(--color-text-strong); font-size: var(--text-base); font-weight: 600; }
.dropzone__title u { color: var(--color-link); text-decoration-thickness: 1px; }
.dropzone__hint { margin: 0; font-size: var(--text-sm); }
.dropzone__file {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  max-width: 34rem;
  margin-top: var(--space-3);
}
.dropzone__file:empty { display: none; }
.dropzone__file-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-md);
  text-align: left;
}
.dropzone__file-item .icon { color: var(--c-primary-500); }
.dropzone__file-name { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dropzone__file-size { flex: none; color: var(--color-text-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.dropzone__file-item.is-invalid { border-color: var(--c-danger-300); background: var(--c-danger-50); }
.dropzone__file-item.is-invalid .icon { color: var(--c-danger-700); }
.dropzone__file-error { flex-basis: 100%; color: var(--c-danger-700); font-size: var(--text-sm); }
.dropzone__file-item:has(.dropzone__file-error) { flex-wrap: wrap; }
.dropzone__clear {
  align-self: center;
  padding: 0.2rem 0.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-link);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.dropzone__clear:hover { background: var(--c-primary-50); text-decoration: underline; }

/* Pratinjau nama baku */
.name-preview {
  display: grid;
  gap: 0.55rem;
  padding: var(--space-4);
  border: 1px solid var(--c-primary-100);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--c-primary-50), #f7f9fd);
}
.name-preview__row {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-3);
}
.name-preview__label {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.name-preview__value {
  min-width: 0;
  color: var(--c-primary-900);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.name-preview__value:empty::before { content: "—"; color: var(--color-text-subtle); font-weight: 400; }
.name-preview__value.is-placeholder { color: var(--color-text-subtle); font-weight: 400; }
.name-preview.is-loading { opacity: 0.6; }

/* Pratinjau dokumen */
.doc-viewer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 75vh;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--c-slate-100);
}
.doc-viewer iframe,
.doc-viewer embed,
.doc-viewer object {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.doc-viewer img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.doc-viewer--image { overflow: auto; background: repeating-conic-gradient(#eef2f6 0% 25%, #f8fafc 0% 50%) 50% / 20px 20px; }

/* 23. Avatar & elemen kecil =============================================== */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  overflow: hidden;
  border-radius: 50%;
  background: var(--c-primary-100);
  color: var(--c-primary-800);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}
.avatar--sm { width: 1.75rem; height: 1.75rem; font-size: var(--text-2xs); }
.avatar--lg { width: 3.25rem; height: 3.25rem; font-size: var(--text-lg); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.meta-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  list-style: none;
}
.meta-list > li { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; }
.meta-list .icon { color: var(--c-slate-400); }

.kbd,
kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--color-border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--color-surface);
  color: var(--c-slate-600);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: -0.01em; }

.copy-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  vertical-align: middle;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--color-border); background: var(--color-surface); color: var(--color-link-hover); }
.copy-btn .icon { width: 0.95rem; height: 0.95rem; }
[data-copy].is-copied::after {
  content: attr(data-copy-feedback);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: var(--z-dropdown);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--c-slate-900);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}
[data-copy].is-copied { position: relative; }

.char-count { display: block; margin-top: 0.2rem; color: var(--color-text-muted); font-size: var(--text-xs); text-align: right; font-variant-numeric: tabular-nums; }
.char-count.is-over { color: var(--c-danger-700); font-weight: 600; }

/* 24. Halaman login & galat =============================================== */
.auth-body {
  background:
    radial-gradient(circle at 12% 18%, rgba(13, 148, 136, 0.1), transparent 38%),
    radial-gradient(circle at 88% 82%, rgba(29, 58, 110, 0.14), transparent 42%),
    linear-gradient(180deg, #eef2f8 0%, #e7edf6 100%);
  background-attachment: fixed;
}
.auth-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-8) var(--space-4);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-primary);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}
.auth-card--wide { max-width: 560px; }
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  text-align: center;
}
.auth-brand img { width: 56px; height: 56px; border-radius: 14px; box-shadow: var(--shadow-sm); }
.auth-brand__name { margin: 0; color: var(--c-primary-800); font-size: var(--text-xl); font-weight: 750; letter-spacing: -0.01em; }
.auth-brand__org { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.auth-title {
  margin: 0 0 var(--space-1);
  color: var(--color-text-strong);
  font-size: var(--text-lg);
  font-weight: 700;
  text-align: center;
}
.auth-subtitle {
  margin: 0 0 var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--text-md);
  text-align: center;
}
.auth-card .form-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.auth-card .form-actions { margin-top: var(--space-5); padding-top: 0; border-top: 0; }
.auth-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: var(--space-5) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  text-align: center;
}

.error-page { text-align: center; }
.error-page__icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto var(--space-3);
  border-radius: 50%;
  background: var(--c-primary-50);
  color: var(--c-primary-600);
}
.error-page__icon .icon { width: 1.6rem; height: 1.6rem; }
.error-page__icon--danger { background: var(--c-danger-50); color: var(--c-danger-700); }
.error-page__icon--warning { background: var(--c-warning-50); color: var(--c-warning-700); }
.error-page__code {
  margin: 0 0 var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
}
.error-page__text { margin: var(--space-2) auto var(--space-3); max-width: 38ch; color: var(--color-text-muted); }
.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
}
.error-page__user { margin-top: var(--space-4); color: var(--color-text-muted); font-size: var(--text-xs); }

/* 25. Panduan gaya ======================================================== */
.sg-toc { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sg-toc a {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--c-slate-700);
  font-size: var(--text-sm);
  font-weight: 500;
}
.sg-toc a:hover { border-color: var(--c-primary-300); color: var(--color-primary); text-decoration: none; }
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: var(--space-3); }
.sg-swatch { overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); font-size: var(--text-xs); }
.sg-swatch__color { height: 3rem; border-bottom: 1px solid var(--color-border); }
.sg-swatch__name { display: block; padding: 0.35rem 0.5rem 0; font-weight: 600; }
.sg-swatch__value { display: block; padding: 0 0.5rem 0.4rem; color: var(--color-text-muted); font-family: var(--font-mono); }
.sg-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: var(--space-2); }
.sg-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: var(--space-3) var(--space-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
  color: var(--c-slate-700);
  font-size: var(--text-xs);
  text-align: center;
  overflow-wrap: anywhere;
}
.sg-icon .icon { width: 1.4rem; height: 1.4rem; color: var(--color-primary); }
.sg-demo-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.sg-label { margin: var(--space-4) 0 var(--space-2); color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.sg-label:first-child { margin-top: 0; }
.sg-code { margin-top: var(--space-3); font-size: var(--text-xs); white-space: pre; }

/* 26. Utilitas ============================================================ */
.text-muted { color: var(--color-text-muted) !important; }
.text-small { font-size: var(--text-sm) !important; }
.text-danger { color: var(--c-danger-700) !important; }
.text-warning { color: var(--c-warning-700) !important; }
.text-success { color: var(--c-success-700) !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.nowrap { white-space: nowrap !important; }
.truncate {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fw-semibold { font-weight: 600 !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.w-full { width: 100% !important; }
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* 27. Responsif, gerak & cetak ============================================ */
@media (max-width: 1279.98px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 1099.98px) {
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023.98px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(288px, 86vw);
    height: auto;
    box-shadow: var(--shadow-xl);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.22s var(--ease), visibility 0s linear 0.22s;
  }
  .sidebar-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform 0.22s var(--ease);
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-backdrop);
    display: block;
    background: rgba(11, 24, 48, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease);
  }
  .sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  body.sidebar-open { overflow: hidden; }
  .sidebar__close,
  .topbar .topbar__menu { display: inline-flex; }
  .topbar { padding: 0 var(--space-4); }
  .content { padding: var(--space-5) var(--space-5) var(--space-8); }
  .app-footer { padding: var(--space-3) var(--space-5) var(--space-5); }
}

@media (max-width: 719.98px) {
  body { font-size: var(--text-md); }
  .hide-mobile { display: none !important; }
  .topbar { gap: var(--space-2); padding: 0 var(--space-3); }
  .topbar__actions { gap: 0.15rem; }
  .topbar__actions > .btn { width: var(--control-height); padding: 0; }
  .content { padding: var(--space-4) var(--space-4) var(--space-8); }
  .app-footer { padding: var(--space-3) var(--space-4) var(--space-5); }
  .page-header { margin-bottom: var(--space-5); }
  .page-title { font-size: var(--text-xl); }
  .page-actions { width: 100%; }
  .grid--2,
  .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid,
  .form-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .filter-bar__row { grid-template-columns: minmax(0, 1fr); }
  .filter-bar__row > .search-input { grid-column: auto; }
  .dl--2col { grid-template-columns: minmax(0, 1fr); }
  .dl--2col .dl__row:nth-child(2) { padding-top: 0.6rem; }
  .card__header,
  .card__body { padding-left: var(--space-4); padding-right: var(--space-4); }
  .card__footer { padding-left: var(--space-4); padding-right: var(--space-4); }
  .card--flush .table th:first-child,
  .card--flush .table td:first-child { padding-left: var(--space-4); }
  .card--flush .table th:last-child,
  .card--flush .table td:last-child { padding-right: var(--space-4); }
  .card .pagination { padding: var(--space-3) var(--space-4); }
  .pagination { justify-content: center; }
  .pagination__summary { width: 100%; text-align: center; }
  .doc-table td:first-child { min-width: 16rem; }
  .auth-card { padding: var(--space-6) var(--space-5); }
  .modal__header,
  .modal__body,
  .modal__footer { padding-left: var(--space-4); padding-right: var(--space-4); }
  .doc-viewer { height: 62vh; min-height: 320px; }
  .form-actions > .btn { flex: 1 1 auto; }
}

@media (max-width: 479.98px) {
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .dl__row,
  .name-preview__row { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .user-menu > summary .icon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .badge,
  .chip,
  .tag,
  .badge-count { border: 1px solid CanvasText; }
  .nav-link.is-active,
  .tabs__item.is-active { outline: 2px solid Highlight; }
}

@media print {
  @page { margin: 14mm 12mm; }
  html, body { background: #fff !important; }
  body { color: #000; font-size: 10.5pt; }
  .sidebar,
  .sidebar-backdrop,
  .topbar,
  .skip-link,
  .btn,
  .btn-group,
  .page-actions,
  .card__actions,
  .filter-bar,
  .pagination__list,
  .dropdown,
  .copy-btn,
  .alert [data-dismiss],
  .alert__close,
  .modal,
  .doc-viewer,
  .dropzone,
  .print-hide { display: none !important; }
  .app-shell { display: block; }
  .main { min-height: 0; }
  .content { max-width: none; padding: 0; }
  .app-footer { max-width: none; padding: 6mm 0 0; }
  .card,
  .stat { border-color: #bbb; box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; }
  .table { font-size: 9pt; }
  .table thead { display: table-header-group; }
  .table tr { break-inside: avoid; }
  .table tbody tr[data-href] { cursor: auto; }
  a { color: inherit; text-decoration: none; }
  .badge,
  .chip,
  .progress,
  .progress__bar,
  .stat__icon { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
  .tabs { display: none; }
  [data-tab-panel][hidden] { display: block !important; }
}
