/* =====================================================================
   Sistem Tolakan Pengajuan — stylesheet tunggal
   Dasar putih, aksen merah. Flat, sudut membulat, banyak white space.
   Tidak memerlukan build step apa pun.
   ===================================================================== */

:root {
  --merah:        #d92027;
  --merah-gelap:  #b3161c;
  --merah-muda:   #fdecec;
  --merah-garis:  #f6c9ca;

  --putih:        #ffffff;
  --abu-latar:    #f7f7f8;
  --abu-garis:    #e6e7ea;
  --abu-garis-2:  #f0f1f3;
  --abu-teks:     #6b7280;
  --teks:         #1f2328;

  --hijau:        #157f45;
  --hijau-muda:   #e8f6ee;
  --kuning:       #92600a;
  --kuning-muda:  #fdf4e3;
  --biru:         #1b5fb3;
  --biru-muda:    #eaf1fb;

  --radius:       10px;
  --radius-lg:    14px;
  --radius-sm:    7px;

  --shadow:       0 1px 2px rgba(16, 18, 22, .06);
  --shadow-pop:   0 6px 24px rgba(16, 18, 22, .12);

  --sidebar-w:    244px;
  --header-h:     58px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--teks);
  background: var(--abu-latar);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p  { margin: 0 0 .6rem; }
a  { color: var(--merah); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; vertical-align: middle; }

/* =====================================================================
   Kerangka halaman
   ===================================================================== */
.layout { min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1rem;
  background: var(--putih);
  border-bottom: 1px solid var(--abu-garis);
}

.topbar .brand {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 700; color: var(--teks); font-size: .98rem;
  letter-spacing: -.02em; white-space: nowrap;
}
.topbar .brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: grid; place-items: center;
  background: var(--merah); color: #fff;
  border-radius: 8px; font-size: .8rem; font-weight: 800;
}
.brand-sub { color: var(--abu-teks); font-weight: 500; font-size: .78rem; display: block; }

.topbar-spacer { flex: 1; }

.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--abu-garis); border-radius: var(--radius-sm);
  background: var(--putih); color: var(--teks); cursor: pointer;
}
.icon-btn:hover { background: var(--abu-latar); }

.nav-toggle { display: none; }

/* --- Sidebar --------------------------------------------------------- */
.shell { display: flex; align-items: flex-start; }

.sidebar {
  position: sticky; top: var(--header-h);
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 1rem .7rem;
  background: var(--putih);
  border-right: 1px solid var(--abu-garis);
}

.nav-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: #9aa0a8;
  padding: .9rem .65rem .35rem;
}
.nav-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .58rem .65rem; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: #414852; font-weight: 500; font-size: .9rem;
}
.nav-item:hover { background: var(--abu-latar); text-decoration: none; color: var(--teks); }
.nav-item.active { background: var(--merah-muda); color: var(--merah-gelap); font-weight: 620; }
.nav-item.active svg { color: var(--merah); }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; color: #9aa0a8; }

.sidebar-foot {
  margin-top: 1.2rem; padding-top: .9rem;
  border-top: 1px solid var(--abu-garis-2);
}

.main {
  flex: 1 1 auto; min-width: 0;
  padding: 1.4rem;
  max-width: 1400px;
}

/* --- Header halaman -------------------------------------------------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem;
}
.page-head .sub { color: var(--abu-teks); font-size: .88rem; margin: .15rem 0 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* =====================================================================
   Kartu
   ===================================================================== */
.card {
  background: var(--putih);
  border: 1px solid var(--abu-garis);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap;
  padding: .95rem 1.15rem;
  border-bottom: 1px solid var(--abu-garis-2);
}
.card-head h2, .card-head h3 { font-size: .98rem; }
.card-head .hint { color: var(--abu-teks); font-size: .82rem; font-weight: 400; margin: .1rem 0 0; }
.card-body { padding: 1.15rem; }
.card-body.tight { padding: .5rem 1.15rem 1.15rem; }
.card-foot {
  padding: .85rem 1.15rem;
  border-top: 1px solid var(--abu-garis-2);
  background: #fcfcfd;
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: center;
}

.section-number {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; margin-right: .5rem;
  background: var(--merah-muda); color: var(--merah-gelap);
  border-radius: 50%; font-size: .72rem; font-weight: 700;
}

/* =====================================================================
   Tombol
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .55rem 1rem;
  font: inherit; font-size: .88rem; font-weight: 600;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--abu-latar); color: var(--teks);
  cursor: pointer; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; flex: 0 0 16px; }

.btn-primary { background: var(--merah); color: #fff; }
.btn-primary:hover { background: var(--merah-gelap); color: #fff; }

.btn-outline { background: var(--putih); border-color: var(--abu-garis); color: #414852; }
.btn-outline:hover { background: var(--abu-latar); border-color: #d6d8dd; }

.btn-danger-outline { background: var(--putih); border-color: var(--merah-garis); color: var(--merah); }
.btn-danger-outline:hover { background: var(--merah-muda); }

.btn-ghost { background: transparent; color: var(--abu-teks); }
.btn-ghost:hover { background: var(--abu-latar); color: var(--teks); }

.btn-sm { padding: .35rem .7rem; font-size: .81rem; }
.btn-sm svg { width: 14px; height: 14px; flex: 0 0 14px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn-icon { padding: .38rem; width: 32px; height: 32px; }

/* =====================================================================
   Formulir
   ===================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: .95rem 1rem;
}
.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }

.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }

.field label {
  font-size: .82rem; font-weight: 600; color: #414852;
  display: flex; align-items: center; gap: .3rem;
}
.req { color: var(--merah); font-weight: 700; }

.input, .select, .textarea {
  width: 100%;
  padding: .55rem .7rem;
  font: inherit; font-size: .9rem; color: var(--teks);
  background: var(--putih);
  border: 1px solid var(--abu-garis);
  border-radius: var(--radius-sm);
  transition: border-color .12s ease, box-shadow .12s ease;
  appearance: none;
}
.textarea { min-height: 76px; resize: vertical; line-height: 1.5; }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--merah);
  box-shadow: 0 0 0 3px rgba(217, 32, 39, .12);
}
.input::placeholder, .textarea::placeholder { color: #b0b5bd; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  padding-right: 2rem;
}

.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
  border-color: var(--merah);
  background: #fffafa;
}
.input.is-valid { border-color: #bcd9c6; }

.field-msg { font-size: .77rem; color: var(--abu-teks); }
.field-err { font-size: .77rem; color: var(--merah); font-weight: 500; min-height: 0; }
.field-err:empty { display: none; }

.checkbox { display: flex; align-items: center; gap: .5rem; font-size: .88rem; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--merah); cursor: pointer; }

fieldset { border: 0; margin: 0; padding: 0; }

/* --- Baris berulang (alasan, kendaraan) ------------------------------ */
.repeat-item {
  border: 1px solid var(--abu-garis);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: .85rem;
  background: #fdfdfe;
}
.repeat-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; margin-bottom: .8rem;
}
.repeat-title { font-weight: 650; font-size: .88rem; color: #414852; }

.subsection-title {
  grid-column: span 12;
  font-size: .74rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: #9aa0a8;
  padding-top: .35rem; margin-bottom: -.25rem;
  border-top: 1px dashed var(--abu-garis);
  padding-top: .8rem;
}
.subsection-title:first-child { border-top: 0; padding-top: 0; }

/* =====================================================================
   Tabel
   ===================================================================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  white-space: nowrap;
}
table.data th {
  text-align: left; font-weight: 650; font-size: .76rem;
  letter-spacing: .05em; text-transform: uppercase; color: #7a8089;
  padding: .7rem .9rem;
  background: #fbfbfc;
  border-bottom: 1px solid var(--abu-garis);
  position: sticky; top: 0; z-index: 1;
}
table.data td {
  padding: .72rem .9rem;
  border-bottom: 1px solid var(--abu-garis-2);
  vertical-align: middle;
}
table.data tbody tr:nth-child(even) { background: #fcfcfd; }
table.data tbody tr:hover { background: var(--merah-muda); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .aksi { text-align: right; }
.cell-strong { font-weight: 600; }
.cell-sub { color: var(--abu-teks); font-size: .8rem; }

/* Tabel detail berpasangan label/nilai */
table.kv { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.kv th {
  text-align: left; font-weight: 500; color: var(--abu-teks);
  width: 190px; padding: .45rem .75rem .45rem 0;
  vertical-align: top;
}
table.kv td { padding: .45rem 0; font-weight: 500; vertical-align: top; }
table.kv tr + tr th, table.kv tr + tr td { border-top: 1px solid var(--abu-garis-2); }

/* =====================================================================
   Badge & status
   ===================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .75rem; font-weight: 650; line-height: 1.5;
  white-space: nowrap;
}
.badge-merah  { background: var(--merah-muda);  color: var(--merah-gelap); }
.badge-abu    { background: var(--abu-latar);   color: #5b616b; }
.badge-hijau  { background: var(--hijau-muda);  color: var(--hijau); }
.badge-kuning { background: var(--kuning-muda); color: var(--kuning); }
.badge-biru   { background: var(--biru-muda);   color: var(--biru); }

.chip {
  display: inline-block;
  padding: .3rem .65rem; margin: 0 .3rem .3rem 0;
  background: var(--merah-muda); color: var(--merah-gelap);
  border-radius: var(--radius-sm); font-size: .82rem; font-weight: 500;
}

/* =====================================================================
   Statistik dashboard
   ===================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .9rem; margin-bottom: 1.1rem;
}
.stat {
  background: var(--putih);
  border: 1px solid var(--abu-garis);
  border-radius: var(--radius-lg);
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow);
}
.stat .label {
  font-size: .76rem; font-weight: 650; letter-spacing: .05em;
  text-transform: uppercase; color: #8b9098;
  display: flex; align-items: center; gap: .4rem;
}
.stat .value {
  font-size: 1.9rem; font-weight: 700; letter-spacing: -.03em;
  margin-top: .3rem; font-variant-numeric: tabular-nums;
}
.stat.accent { border-color: var(--merah-garis); background: var(--merah-muda); }
.stat.accent .value, .stat.accent .label { color: var(--merah-gelap); }

.bar-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .7rem; }
.bar-row .name { flex: 1 1 auto; min-width: 0; font-size: .87rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { flex: 0 0 120px; height: 7px; background: var(--abu-garis-2); border-radius: 99px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--merah); border-radius: 99px; }
.bar-row .count { flex: 0 0 34px; text-align: right; font-weight: 650; font-size: .85rem;
  font-variant-numeric: tabular-nums; }

/* =====================================================================
   Filter & pagination
   ===================================================================== */
.filter-bar {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(130px, 1fr)) auto;
  gap: .65rem; align-items: end;
}
.filter-bar .field label { font-size: .76rem; }

.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap;
}
.pagination .pages { display: flex; gap: .25rem; flex-wrap: wrap; }
.page-link {
  display: grid; place-items: center;
  min-width: 34px; height: 34px; padding: 0 .5rem;
  border: 1px solid var(--abu-garis); border-radius: var(--radius-sm);
  background: var(--putih); color: #414852;
  font-size: .85rem; font-weight: 550;
}
.page-link:hover { background: var(--abu-latar); text-decoration: none; }
.page-link.active { background: var(--merah); border-color: var(--merah); color: #fff; }
.page-link.disabled { opacity: .45; pointer-events: none; }
.page-info { color: var(--abu-teks); font-size: .84rem; }

/* =====================================================================
   Alert / flash
   ===================================================================== */
.alert {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .75rem .95rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: .88rem; margin-bottom: .8rem;
}
.alert svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.alert-success { background: var(--hijau-muda);  border-color: #c6e6d3; color: #106034; }
.alert-error   { background: var(--merah-muda);  border-color: var(--merah-garis); color: var(--merah-gelap); }
.alert-info    { background: var(--biru-muda);   border-color: #cfe0f5; color: #144a8c; }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer;
  color: inherit; opacity: .55; padding: 0 .2rem; font-size: 1.1rem; line-height: 1; }
.alert .close:hover { opacity: 1; }

.toast-area {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 200;
  display: flex; flex-direction: column; gap: .5rem;
  max-width: min(360px, calc(100vw - 2rem));
}
.toast {
  padding: .7rem .9rem; border-radius: var(--radius);
  background: var(--teks); color: #fff; font-size: .86rem;
  box-shadow: var(--shadow-pop);
  animation: toast-in .18s ease;
}
.toast.ok  { background: #14663c; }
.toast.err { background: var(--merah-gelap); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* =====================================================================
   Upload dokumen
   ===================================================================== */
.dropzone {
  border: 2px dashed var(--abu-garis);
  border-radius: var(--radius-lg);
  padding: 1.9rem 1.1rem;
  text-align: center;
  background: #fcfcfd;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.dropzone:hover { border-color: var(--merah-garis); background: var(--merah-muda); }
.dropzone.dragover { border-color: var(--merah); background: var(--merah-muda); }
.dropzone .dz-icon {
  width: 42px; height: 42px; margin: 0 auto .6rem;
  display: grid; place-items: center;
  background: var(--merah-muda); color: var(--merah);
  border-radius: 50%;
}
.dropzone .dz-icon svg { width: 21px; height: 21px; }
.dropzone .dz-main { font-weight: 600; font-size: .92rem; }
.dropzone .dz-sub { color: var(--abu-teks); font-size: .8rem; margin-top: .2rem; }

.file-list { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .5rem; }
.file-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .75rem;
  border: 1px solid var(--abu-garis); border-radius: var(--radius);
  background: var(--putih);
}
.file-thumb {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--abu-latar);
  display: grid; place-items: center; color: var(--abu-teks);
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb svg { width: 19px; height: 19px; }
.file-meta { flex: 1 1 auto; min-width: 0; }
.file-name {
  font-size: .86rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-sub { font-size: .77rem; color: var(--abu-teks); }
.file-sub .saved { color: var(--hijau); font-weight: 600; }
.file-sub .failed { color: var(--merah); font-weight: 600; }

.progress {
  height: 5px; margin-top: .35rem;
  background: var(--abu-garis-2); border-radius: 99px; overflow: hidden;
}
.progress > span {
  display: block; height: 100%; width: 0;
  background: var(--merah); border-radius: 99px;
  transition: width .18s ease;
}
.progress.done > span { background: var(--hijau); }
.progress.fail > span { background: var(--merah-gelap); }

/* Galeri dokumen tersimpan */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .8rem;
}
.doc-card {
  border: 1px solid var(--abu-garis);
  border-radius: var(--radius);
  overflow: hidden; background: var(--putih);
  display: flex; flex-direction: column;
}
.doc-preview {
  aspect-ratio: 4 / 3; background: var(--abu-latar);
  display: grid; place-items: center; overflow: hidden;
  color: var(--abu-teks);
}
.doc-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-preview svg { width: 30px; height: 30px; }
.doc-info { padding: .5rem .6rem; border-top: 1px solid var(--abu-garis-2); }
.doc-name {
  font-size: .79rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: .3rem; margin-top: .2rem;
}
.doc-meta .size { font-size: .73rem; color: var(--abu-teks); }
.doc-del {
  background: none; border: 0; cursor: pointer; padding: 2px;
  color: #b6bbc2; line-height: 0; border-radius: 4px;
}
.doc-del:hover { color: var(--merah); background: var(--merah-muda); }
.doc-del svg { width: 15px; height: 15px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(15, 17, 21, .88);
  display: none; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius); }
.lightbox .lb-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff;
  font-size: 1.3rem; cursor: pointer;
}

/* =====================================================================
   Halaman kosong / error / login
   ===================================================================== */
.empty { text-align: center; padding: 2.6rem 1.2rem; color: var(--abu-teks); }
.empty .empty-icon {
  width: 50px; height: 50px; margin: 0 auto .8rem;
  display: grid; place-items: center;
  background: var(--abu-latar); border-radius: 50%; color: #b0b5bd;
}
.empty .empty-icon svg { width: 24px; height: 24px; }
.empty h3 { color: var(--teks); margin-bottom: .3rem; }
.empty p { font-size: .88rem; }

.auth-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 12% 8%, #fdecec 0%, transparent 42%),
    radial-gradient(circle at 88% 92%, #fdecec 0%, transparent 42%),
    var(--abu-latar);
}
.auth-card {
  width: 100%; max-width: 388px;
  background: var(--putih);
  border: 1px solid var(--abu-garis);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-pop);
}
.auth-logo {
  width: 46px; height: 46px; margin: 0 auto .85rem;
  display: grid; place-items: center;
  background: var(--merah); color: #fff;
  border-radius: 12px; font-weight: 800; font-size: 1rem;
}
.auth-card h1 { text-align: center; font-size: 1.22rem; }
.auth-card .lead { text-align: center; color: var(--abu-teks); font-size: .87rem; margin-bottom: 1.4rem; }
.auth-foot { text-align: center; margin-top: 1.2rem; font-size: .78rem; color: #9aa0a8; }

.error-page { text-align: center; max-width: 460px; margin: 0 auto; padding: 3rem 1.2rem; }
.error-code { font-size: 3.6rem; font-weight: 800; color: var(--merah); letter-spacing: -.04em; line-height: 1; }
.error-page pre {
  text-align: left; background: var(--abu-latar); border: 1px solid var(--abu-garis);
  border-radius: var(--radius); padding: .8rem; font-size: .74rem;
  overflow-x: auto; margin-top: 1rem; white-space: pre-wrap; word-break: break-word;
}

/* Utilitas */
.muted { color: var(--abu-teks); }
.small { font-size: .82rem; }
.mono  { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
.mb-0  { margin-bottom: 0 !important; }
.mt-1  { margin-top: .8rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.gap-sm { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.divider { height: 1px; background: var(--abu-garis-2); margin: 1rem 0; border: 0; }
.hidden { display: none !important; }

/* =====================================================================
   Responsif
   ===================================================================== */
@media (max-width: 1024px) {
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar .filter-actions { grid-column: span 2; }
}

@media (max-width: 900px) {
  .nav-toggle { display: grid; }

  .sidebar {
    position: fixed; top: var(--header-h); left: 0; bottom: 0;
    height: auto; z-index: 80;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-pop);
  }
  .sidebar.open { transform: translateX(0); }

  .nav-backdrop {
    position: fixed; inset: var(--header-h) 0 0; z-index: 70;
    background: rgba(15, 17, 21, .38);
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .nav-backdrop.show { opacity: 1; pointer-events: auto; }

  .main { padding: 1rem; }
  .col-8, .col-6, .col-4, .col-3 { grid-column: span 12; }
  .brand-sub { display: none; }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .main { padding: .8rem; }
  .card-body { padding: .95rem; }
  .card-head { padding: .8rem .95rem; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar .filter-actions { grid-column: span 1; }
  .page-head { gap: .7rem; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  table.kv th { width: 130px; }
  .doc-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .stat .value { font-size: 1.6rem; }
}

/* Cetak */
@media print {
  .topbar, .sidebar, .nav-backdrop, .page-actions, .no-print { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .main { padding: 0; max-width: none; }
  .card { border: 1px solid #ccc; box-shadow: none; page-break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
