/* ==========================================================================
   Indora - tema gelap dengan kartu putih & drawer samping
   Tanpa AdminLTE / Bootstrap. Hanya butuh Font Awesome untuk ikon.
   ========================================================================== */

:root {
  --bg: #0d0d0f;
  --bg-2: #161618;
  --side: #1a1a1d;
  --side-hover: #242428;
  --side-active: #26262b;
  --side-line: #34343a;
  --text-dim: #9a9aa3;
  --text-side: #c9c9d0;

  --paper: #ffffff;
  --ink: #141416;
  --ink-2: #5f6168;
  --ink-3: #8b8d95;
  --line: #e7e7ea;
  --field: #f6f6f8;

  --accent: #2f6bff;
  --accent-2: #1d4ed8;
  --accent-deep: #1e3fae;
  --green: #12a150;
  --green-bg: #e3f6ea;
  --red: #d92d3a;
  --red-bg: #fdeaec;
  --gray-bg: #ececef;

  --r-card: 20px;
  --r-ctrl: 12px;
  --side-w: 264px;
  --side-w-min: 80px;
  --gap: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

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

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
.is-hidden, .d-none { display: none !important; }
.text-muted { color: var(--ink-3); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- latar: lengkung oranye di atas halaman ---------- */
.app-bg {
  position: fixed; inset: 0 0 auto 0; height: 300px; z-index: 0; pointer-events: none;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 300' preserveAspectRatio='none'><defs><linearGradient id='a' x1='0' y1='0' x2='1' y2='0'><stop offset='0' stop-color='%232f6bff' stop-opacity='0'/><stop offset='.55' stop-color='%231e3fae' stop-opacity='.55'/><stop offset='1' stop-color='%2360a5fa' stop-opacity='.95'/></linearGradient><linearGradient id='b' x1='0' y1='0' x2='1' y2='0'><stop offset='0' stop-color='%231d4ed8' stop-opacity='0'/><stop offset='1' stop-color='%2393c5fd' stop-opacity='.55'/></linearGradient></defs><path d='M610 0 C 760 40 760 200 960 300 L1200 300 L1200 0 Z' fill='url(%23a)'/><path d='M730 0 C 840 50 850 190 1010 300 L1200 300 L1200 0 Z' fill='url(%23b)'/></svg>") right top / 100% 100% no-repeat,
    radial-gradient(900px 260px at 100% 0, rgba(47, 107, 255, .22), transparent 70%);
}

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed; z-index: 40; top: var(--gap); bottom: var(--gap); left: var(--gap);
  width: var(--side-w);
  display: flex; flex-direction: column;
  background: var(--side);
  border-radius: var(--r-card);
  overflow: hidden;
  transition: width .28s var(--ease), transform .28s var(--ease);
}

.sb-brand {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 116px; flex: none; overflow: hidden;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 264 116' preserveAspectRatio='none'><path d='M0 70 C 70 20 130 60 190 28 C 220 12 245 6 264 0 L264 116 L0 116 Z' fill='%23ffffff' fill-opacity='.10'/><path d='M0 96 C 80 60 150 108 264 54 L264 116 L0 116 Z' fill='%23000000' fill-opacity='.22'/></svg>") center / 100% 100% no-repeat,
    linear-gradient(120deg, #0b1f66 0%, #1d4ed8 52%, #4da3ff 100%);
}
.sb-brand-text {
  font-family: 'Kaushan Script', cursive; font-size: 34px; line-height: 1; color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .35); white-space: nowrap;
}
.sb-brand-text small {
  display: block; margin-top: 4px; text-align: right;
  font-family: 'Inter', sans-serif; font-size: 9px; letter-spacing: .04em; opacity: .85; text-shadow: none;
}

.sb-nav { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 12px 10px; scrollbar-width: thin; scrollbar-color: var(--side-line) transparent; }

.nav-item { display: block; flex: none; margin: 0 0 2px; }
.nav-link {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 11px 12px; border: 0; border-radius: 12px; background: transparent;
  color: var(--text-side); font-weight: 500; font-size: 15px; line-height: 1.3; text-align: left;
  white-space: nowrap; overflow: hidden; flex: none;
  transition: background .15s, color .15s;
}
.nav-link span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-link:hover { background: var(--side-hover); color: #fff; }
.nav-link.active { background: var(--side-active); color: #fff; font-weight: 600; }
.nav-link i.ico { width: 20px; text-align: center; font-size: 16px; color: var(--text-dim); flex: none; }
.nav-link.active i.ico, .nav-link:hover i.ico { color: #fff; }
.nav-link .chev { margin-left: auto; font-size: 11px; color: var(--text-dim); transition: transform .2s; }
.nav-item.open > .nav-link .chev { transform: rotate(180deg); }

.nav-sub {
  display: none; margin: 4px 0 6px 21px; padding-left: 0; border-left: 1px solid var(--side-line);
}
.nav-item.open > .nav-sub { display: block; }
.nav-sub a {
  position: relative; display: block; margin-left: 14px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-dim); font-weight: 600; font-size: 14px;
}
.nav-sub a::before {
  content: ''; position: absolute; left: -14px; top: 50%; width: 8px; border-top: 1px solid var(--side-line);
}
.nav-sub a:hover { color: #fff; background: var(--side-hover); }
.nav-sub a.active { color: #fff; background: var(--side-active); }

/* Menu yang halamannya belum dibuat */
.nav-link.is-soon, .nav-sub a.is-soon { opacity: .45; pointer-events: none; }

.sb-foot { flex: none; position: relative; background: var(--side); padding: 10px; border-top: 1px solid #2a2a2f; }
.sb-collapse {
  display: flex; align-items: center; gap: 14px; width: 100%; white-space: nowrap; overflow: hidden;
  padding: 11px 12px; border: 0; border-radius: 12px; background: transparent;
  color: var(--text-dim); font-weight: 500; font-size: 15px;
}
.sb-collapse:hover { background: var(--side-hover); color: #fff; }
.sb-collapse i { width: 20px; text-align: center; transition: transform .28s var(--ease); }

/* sidebar diperkecil */
body.sb-min .sidebar { width: var(--side-w-min); }
body.sb-min .nav-link span, body.sb-min .nav-link .chev, body.sb-min .sb-collapse span,
body.sb-min .nav-sub, body.sb-min .nav-item.open > .nav-sub, body.sb-min .sb-brand-text small { display: none; }
body.sb-min .nav-link, body.sb-min .sb-collapse { justify-content: center; padding-inline: 0; }
body.sb-min .sb-brand-text { font-size: 22px; }
body.sb-min .sb-collapse i { transform: rotate(180deg); }

/* ---------- area utama ---------- */
.main {
  position: relative; z-index: 1;
  margin-left: calc(var(--side-w) + var(--gap) * 2);
  min-height: 100vh; display: flex; flex-direction: column;
  transition: margin-left .28s var(--ease);
}
body.sb-min .main { margin-left: calc(var(--side-w-min) + var(--gap) * 2); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px 0; min-height: 68px; color: #fff;
}
.topbar-right { display: flex; align-items: center; gap: 6px; }
.icon-ghost {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 0; border-radius: 50%; background: transparent; color: #e8e8ec; font-size: 16px;
}
.icon-ghost:hover { background: rgba(255, 255, 255, .12); }
#btnMenu { display: none; }

.bell { position: relative; }
.bell .dot {
  position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%;
  background: #ff4d5e; border: 2px solid var(--bg); display: none;
}
.bell.has-new .dot { display: block; }
.notif-badge {
  position: absolute; top: 1px; right: -2px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: #ff3b4e; color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 19px; text-align: center; box-sizing: border-box;
}
#ddNotif .dropdown-menu { width: 360px; }
.notif-head-count { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--red-bg); color: var(--red); font-size: 11px; vertical-align: middle; }
.notif-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.notif-item {
  display: flex; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none;
  transition: background .15s;
}
.notif-item:hover { background: var(--field); }
.notif-item.baru { background: #eef3ff; color: var(--ink); }
.notif-item.baru:hover { background: #e2eaff; }
.notif-ico {
  flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: var(--gray-bg); color: var(--ink-2); font-size: 14px;
}
.notif-item.baru .notif-ico { background: var(--accent); color: #fff; }
.notif-isi { min-width: 0; line-height: 1.35; }
.notif-isi b { display: block; font-size: 13.5px; font-weight: 600; }
.notif-item.baru .notif-isi b { font-weight: 700; }
.notif-isi small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-2); }
.notif-isi em { display: block; margin-top: 3px; font-style: normal; font-size: 11.5px; color: var(--ink-3); }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; z-index: 60; top: calc(100% + 10px); right: 0; width: 320px;
  background: #fff; color: var(--ink); border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-head { padding: 16px 20px; font-weight: 700; font-size: 16px; border-bottom: 1px solid var(--line); }
.dropdown-empty { padding: 34px 20px; text-align: center; color: var(--ink-3); }
.dropdown-empty i { display: block; margin-bottom: 10px; font-size: 26px; color: #c4c6cc; }

/* Dropdown profil */
.dd-user { width: 260px; overflow: hidden; }
.dd-user-head { padding: 16px 20px; border-bottom: 1px solid var(--line); line-height: 1.3; }
.dd-user-head b { display: block; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-user-head small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 12px; }
.dd-list { padding: 6px; }
.dd-list form { margin: 0; }
.dd-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 500; text-align: left; transition: background .15s;
}
.dd-item i { width: 16px; text-align: center; color: var(--ink-3); }
.dd-item:hover { background: var(--field); }
.dd-item.danger, .dd-item.danger i { color: var(--red); }
.dd-item.danger:hover { background: var(--red-bg); }

.user-chip { display: flex; align-items: center; gap: 12px; margin-left: 8px; padding: 5px 8px 5px 5px; border-radius: 999px; }
button.user-chip { border: 0; background: transparent; color: inherit; transition: background .15s; }
button.user-chip:hover, .dropdown.open > button.user-chip { background: rgba(255, 255, 255, .12); }
.user-chip .chev { font-size: 11px; color: rgba(255, 255, 255, .6); margin-left: 2px; transition: transform .2s; }
.dropdown.open > .user-chip .chev { transform: rotate(180deg); }
.avatar {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, #2f6bff, #4da3ff); color: #fff; font-weight: 700; font-size: 16px;
  border: 2px solid rgba(255, 255, 255, .25);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-meta { line-height: 1.25; text-align: left; }
.user-meta b { display: block; font-size: 14px; font-weight: 600; color: #fff; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { display: block; font-size: 12px; color: rgba(255, 255, 255, .6); }

.page-head { padding: 22px 32px 26px; color: #fff; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; color: rgba(255, 255, 255, .6); }
.crumbs li { display: flex; align-items: center; list-style: none; }
.crumbs a:hover { color: #fff; }
.crumbs li + li::before { content: '/'; margin-right: 6px; opacity: .6; }
.crumbs .active { color: rgba(255, 255, 255, .9); }
.page-title { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.page-sub { margin-top: 6px; color: rgba(255, 255, 255, .62); font-size: 15px; }

.content { padding: 0 32px 32px; flex: 1; }
.footer { padding: 0 32px 24px; color: #6d6d75; font-size: 12px; display: flex; justify-content: space-between; }

/* ---------- kartu ---------- */
.card { background: var(--paper); border-radius: var(--r-card); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); overflow: hidden; }
.card-head { padding: 24px 28px 8px; }
.card-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }

.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-top: 16px; }

.search { position: relative; flex: 1 1 320px; max-width: 420px; }
.search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search input { padding-left: 44px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 28px 0; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px;
  border: 0; border-radius: 999px; background: #f0f0f2; color: var(--ink-2);
  font-weight: 600; font-size: 14px; transition: background .15s, color .15s;
}
.pill:hover { background: #e6e6ea; }
.pill .count {
  min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #fff; color: var(--ink);
  font-size: 12px; font-weight: 700; text-align: center;
}
.pill.active { background: #111113; color: #fff; }
.pill.active .count { background: #fff; color: #111; }

/* ---------- tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 1px solid transparent; border-radius: var(--r-ctrl);
  font-weight: 700; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-dark { background: #111113; color: #fff; }
.btn-dark:hover:not(:disabled) { background: var(--accent-deep); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.btn-outline:hover { border-color: #c9c9cf; background: #fafafa; }
.btn-soft { background: #f0f0f2; color: var(--ink); }
.btn-soft:hover:not(:disabled) { background: #e6e6ea; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b9202c; }

/* ---------- tabel ---------- */
.table-wrap { overflow-x: auto; margin-top: 18px; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 12px 28px; text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-3);
  background: #fafafb; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 16px 28px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafafb; }
.table .c-kode { font-weight: 600; font-variant-numeric: tabular-nums; }
.table .c-no { color: var(--ink-3); }
.table .col-act { text-align: center; white-space: nowrap; }
.empty-row td { text-align: center; color: var(--ink-3); padding: 44px 28px !important; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-success { background: var(--green-bg); color: var(--green); }
.badge-secondary { background: var(--gray-bg); color: var(--ink-2); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; margin: 0 2px;
  border: 0; border-radius: 10px; background: #f0f0f2; color: var(--ink-2); font-size: 14px;
  transition: background .15s, color .15s;
}
.icon-btn.edit:hover { background: #e6efff; color: var(--accent-deep); }
.icon-btn.del:hover { background: var(--red-bg); color: var(--red); }

/* ---------- form ---------- */
.field { margin-bottom: 22px; }
.label { display: block; margin-bottom: 8px; font-weight: 700; font-size: 15px; }
.input {
  display: block; width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r-ctrl);
  background: #fff; color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #a6a8af; }
.input:hover { border-color: #cfcfd5; }
.input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47, 107, 255, .18); }
.input.is-invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(217, 45, 58, .1); }
.invalid-feedback { display: none; margin-top: 6px; color: var(--red); font-size: 13px; }
.is-invalid ~ .invalid-feedback { display: block; }
.hint { margin-top: 6px; color: var(--ink-3); font-size: 13px; }

.form-error {
  margin-bottom: 20px; padding: 12px 16px; border-radius: var(--r-ctrl);
  background: var(--red-bg); color: #9d1823; font-weight: 500;
}

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--field);
}
.switch-row b { display: block; font-size: 15px; }
.switch-row small { color: var(--ink-3); font-size: 13px; }
.switch { position: relative; flex: none; width: 48px; height: 28px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #c9c9cf; transition: background .2s; }
.switch span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s var(--ease);
}
.switch input:checked + span { background: #111113; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- drawer samping ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .6);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.overlay.show { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; z-index: 100; top: var(--gap); right: var(--gap); bottom: var(--gap);
  width: min(560px, calc(100vw - var(--gap) * 2));
  background: #fff; border-radius: var(--r-card); overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateX(calc(100% + 40px)); visibility: hidden;
  transition: transform .35s var(--ease), visibility .35s;
  box-shadow: -20px 0 60px rgba(0, 0, 0, .35);
}
.drawer.show { transform: none; visibility: visible; }
.drawer-bar { height: 8px; background: #f0f0f2; flex: none; }
.drawer-bar span { display: block; height: 100%; width: 38%; background: linear-gradient(90deg, #2f6bff, #4da3ff); border-radius: 0 8px 8px 0; }
.drawer-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 32px 20px; border-bottom: 1px solid var(--line); background: #fcfcfd;
}
.drawer-head small { display: block; color: var(--ink-2); font-size: 14px; }
.drawer-head h2 { margin-top: 2px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.drawer-close {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2); font-size: 18px;
}
.drawer-close:hover { background: #f0f0f2; }
.drawer-body { flex: 1; overflow-y: auto; padding: 28px 32px; }
.drawer-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 32px; border-top: 1px solid var(--line); background: #fff;
}

/* ---------- dialog konfirmasi ---------- */
.dialog {
  position: fixed; z-index: 100; left: 50%; top: 50%; width: min(440px, calc(100vw - 32px));
  background: #fff; border-radius: var(--r-card); padding: 32px 32px 24px; text-align: center;
  transform: translate(-50%, -46%) scale(.96); opacity: 0; visibility: hidden;
  transition: transform .25s var(--ease), opacity .25s, visibility .25s;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.dialog.show { transform: translate(-50%, -50%); opacity: 1; visibility: visible; }
.dialog-ico {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 50%; background: var(--red-bg); color: var(--red); font-size: 26px;
}
.dialog h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.dialog p { color: var(--ink-2); }
.dialog .target { margin: 14px 0 6px; padding: 12px 16px; border-radius: var(--r-ctrl); background: var(--field); color: var(--ink); font-weight: 700; word-break: break-word; }
.dialog .form-error { text-align: left; margin: 16px 0 0; }
.dialog-foot { display: flex; gap: 12px; margin-top: 26px; }
.dialog-foot .btn { flex: 1; }

/* ---------- dialog berformulir (Ubah Password) ---------- */
.dialog-form { width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; text-align: left; }
.dialog-form .dialog-ico { margin-left: 0; }
.dialog-ico-blue { background: #e6efff; color: var(--accent-deep); }
.dialog-sub { margin: 0 0 20px; color: var(--ink-2); font-size: 14px; }
.dialog-form .field { margin-bottom: 16px; }
.dialog-form .label { font-size: 14px; }
.dialog-form .dialog-foot { margin-top: 22px; }
.pw-field { position: relative; }
.dialog-form .invalid-feedback:not(:empty) { display: block; }   /* input dibungkus .pw-field, jadi bukan saudara langsung */
.pw-field .input { padding-right: 48px; }
.pw-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-3);
}
.pw-eye:hover { background: var(--field); color: var(--ink); }

/* ---------- notifikasi ---------- */
.toasts { position: fixed; z-index: 120; top: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 40px)); }
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: #fff; color: var(--ink); box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  border-left: 5px solid var(--green); animation: toast-in .3s var(--ease);
}
.toast.danger { border-left-color: var(--red); }
.toast i.t-ico { margin-top: 3px; color: var(--green); }
.toast.danger i.t-ico { color: var(--red); }
.toast .t-msg { flex: 1; font-weight: 500; }
.toast .t-x { border: 0; background: transparent; color: var(--ink-3); font-size: 18px; line-height: 1; padding: 0 2px; }
.toast.out { opacity: 0; transform: translateX(20px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   DASHBOARD
   ===================================================================== */
.dash-filter { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 24px; margin-bottom: var(--gap); overflow: visible; }
.dash-filter-fields { display: flex; flex-wrap: wrap; gap: 14px; flex: 1 1 520px; }
.dash-f { display: block; flex: 1 1 170px; max-width: 240px; min-width: 150px; }
.dash-f > span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.dash-f .input { padding: 10px 14px; }
.dash-brand-tetap { padding: 10px 14px; border-radius: var(--r-ctrl); background: var(--field); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-brand-tetap i { margin-right: 6px; color: var(--ink-3); font-size: 12px; }
.dash-filter-act { display: flex; flex-wrap: wrap; gap: 10px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.kpi { display: flex; gap: 14px; align-items: flex-start; padding: 20px 20px; background: var(--paper); border-radius: var(--r-card); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); min-width: 0; }
.kpi-ico { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; font-size: 18px; }
.k-blue  { background: #e6efff; color: var(--accent-deep); }
.k-green { background: var(--green-bg); color: var(--green); }
.k-red   { background: var(--red-bg); color: var(--red); }
.k-amber { background: #fff3da; color: #b7791f; }
.k-slate { background: var(--gray-bg); color: var(--ink-2); }
.kpi-body { min-width: 0; flex: 1; }
.kpi-label { display: block; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.kpi-val { display: block; margin-top: 2px; font-size: clamp(19px, 1.75vw, 24px); font-weight: 700; letter-spacing: -.02em; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-sub { display: block; margin-top: 4px; color: var(--ink-3); font-size: 12px; }
.kpi-dark { background: linear-gradient(135deg, #1e3fae, #2f6bff); color: #fff; }
.kpi-dark .kpi-label, .kpi-dark .kpi-sub { color: rgba(255, 255, 255, .75); }
.kpi-dark .kpi-ico { background: rgba(255, 255, 255, .18); color: #fff; }
.meter { height: 6px; margin-top: 8px; border-radius: 999px; background: var(--gray-bg); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--green); }

/* kartu dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.dash-card { margin-bottom: 0; }
.dash-grid + .dash-card, .dash-card + .dash-card { margin-top: 0; }
.dash-card .card-head { padding-bottom: 4px; }
.dash-head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.dash-note { margin-top: 2px; color: var(--ink-3); font-size: 13px; }
.dash-body { padding: 14px 28px 26px; }
.dash-empty { padding: 34px 10px; text-align: center; color: var(--ink-3); }
.dash-empty i { display: block; margin-bottom: 10px; font-size: 28px; color: #c4c6cc; }
.dash-sub { margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.dash-sub:first-child { margin-top: 0; }
.dash-sub i { margin-right: 6px; }
.dash-chip { margin-top: 14px; padding: 10px 14px; border-radius: var(--r-ctrl); background: var(--field); color: var(--ink-2); font-size: 13px; }
.dash-chip i { margin-right: 8px; color: var(--ink-3); }
.c-red { color: var(--red); }
.c-amber { color: #b7791f; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-table th, .dash-table td { padding: 14px 14px; }
.dash-table th:first-child, .dash-table td:first-child { padding-left: 28px; }
.dash-table th:last-child, .dash-table td:last-child { padding-right: 28px; }
.dash-table .nw { white-space: nowrap; }
.dash-table .cut { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* warna status */
.st-pemberkasan { --st: #8b8d95; } .st-proses { --st: #2f6bff; } .st-draft { --st: #8b5cf6; }
.st-revisi_draft { --st: #e2a11b; } .st-detail_sk { --st: #0f766e; } .st-sk_diserahkan { --st: #7c3aed; }
.st-sk_akta { --st: #0369a1; } .st-hasil_diserahkan { --st: #6d28d9; } .st-kirim_softcopy { --st: #0891b2; }
.st-pelunasan { --st: #c2410c; } .st-kirim_hardcopy { --st: #4f46e5; }
.st-pratinjau { --st: #0ea5b7; } .st-selesai { --st: #12a150; } .st-ditunda { --st: #e2a11b; } .st-dibatalkan { --st: #d92d3a; }
.hbar span.st-pemberkasan, .hbar span.st-proses, .hbar span.st-draft, .hbar span.st-pratinjau,
.hbar span.st-selesai, .hbar span.st-ditunda, .hbar span.st-dibatalkan, .hbar span.st-revisi_draft,
.hbar span.st-detail_sk, .hbar span.st-sk_diserahkan, .hbar span.st-sk_akta, .hbar span.st-hasil_diserahkan,
.hbar span.st-kirim_softcopy, .hbar span.st-pelunasan, .hbar span.st-kirim_hardcopy, .dot { background: var(--st); }
.badge-st.st-revisi_draft { color: #a9760f; }
.badge-st { background: color-mix(in srgb, var(--st) 14%, #fff); color: var(--st); }
.badge-st.st-ditunda { color: #a9760f; }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 10px; border-radius: 50%; }

/* bar horizontal */
.hbars { display: grid; gap: 14px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 14px; }
.hbar-top b { font-variant-numeric: tabular-nums; }
.hbar-top small { margin-left: 4px; color: var(--ink-3); font-weight: 500; }
.hbar { height: 8px; border-radius: 999px; background: var(--field); overflow: hidden; }
.hbar span { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--accent); transition: width .5s var(--ease); }

/* kolom (tren) */
.cols { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: end; }
.col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.col-n { font-size: 15px; font-variant-numeric: tabular-nums; }
.col-track { position: relative; width: 100%; max-width: 54px; height: 170px; border-radius: 12px; background: var(--field); overflow: hidden; }
.col-track span { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 12px; background: #c9d8ff; transition: height .5s var(--ease); }
.col.is-now .col-track span { background: var(--accent); }
.col-l { font-weight: 700; color: var(--ink-2); }
.col-v { margin-top: -4px; color: var(--ink-3); font-size: 11px; white-space: nowrap; }

/* daftar baris & peringkat */
.rows li { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows small, .rank small { display: block; color: var(--ink-3); font-size: 12px; }
.rows-r { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.rank { display: grid; gap: 16px; }
.rank-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.rank-top span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rank-top em { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 10px; border-radius: 50%; background: var(--field); color: var(--ink-2); font-size: 12px; font-style: normal; font-weight: 700; }
.rank-top b { flex: none; font-variant-numeric: tabular-nums; }
.rank small { margin-top: 4px; }

@media (max-width: 1199px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 991px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-body { padding-left: 18px; padding-right: 18px; }
  .dash-filter { padding: 16px 18px; }
}
@media (max-width: 575px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-f { max-width: none; flex-basis: 100%; }
  .col-v { display: none; }
}

/* ---------- responsif ---------- */
@media (max-width: 991px) {
  .sidebar { transform: translateX(calc(-100% - 30px)); width: var(--side-w) !important; }
  body.sb-open .sidebar { transform: none; }
  body.sb-min .nav-link span, body.sb-min .nav-link .chev, body.sb-min .sb-collapse span { display: initial; }
  body.sb-min .nav-item.open > .nav-sub { display: block; }
  body.sb-min .nav-link, body.sb-min .sb-collapse { justify-content: flex-start; padding-inline: 12px; }
  .sb-collapse { display: none; }
  .main, body.sb-min .main { margin-left: 0; }
  #btnMenu { display: inline-grid; }
  .topbar, .page-head, .content, .footer { padding-left: 18px; padding-right: 18px; }
  .page-title { font-size: 24px; }
  .user-meta, .user-chip .chev { display: none; }
  .dropdown-menu { position: fixed; top: 70px; right: 12px; left: 12px; width: auto; }
  .card-head, .pills { padding-left: 18px; padding-right: 18px; }
  .table th, .table td { padding-left: 18px; padding-right: 18px; }
}

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