/* Kform — gaya aplikasi admin & halaman formulir */
:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e3e6ee;
  --border-strong: #cfd4e0;
  --text: #1c2233;
  --text-2: #5b6478;
  --text-3: #8a92a6;
  --primary: #4338ca;
  --primary-2: #3730a3;
  --primary-soft: #eef0ff;
  --ok: #0f7a4a;
  --ok-soft: #e4f6ec;
  --warn: #9a5b00;
  --warn-soft: #fff4de;
  --danger: #c0262d;
  --danger-soft: #fdeceb;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 4px 16px rgba(20, 24, 40, .05);
  --shadow-lg: 0 10px 40px rgba(20, 24, 40, .18);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
code { font-family: Consolas, ui-monospace, monospace; font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.loading { padding: 48px; text-align: center; color: var(--text-3); }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.pre { white-space: pre-line; }
.mt { margin-top: 12px; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.c { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Kontrol dasar ---------- */
.input {
  width: 100%; padding: 8px 11px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67, 56, 202, .15); }
.input:disabled { background: var(--surface-2); color: var(--text-2); }
.input.sm { padding: 5px 8px; font-size: .9rem; }
.input.mono { font-family: Consolas, ui-monospace, monospace; font-size: .82rem; }
textarea.input { resize: vertical; }
select.input { cursor: pointer; }

.fld { display: flex; flex-direction: column; gap: 5px; }
.fld > span, .fld-label { font-weight: 600; font-size: .86rem; color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: .9rem; cursor: pointer;
  white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-ghost { color: var(--danger); border-color: #f1c3c1; }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.sm { padding: 5px 10px; font-size: .82rem; }
.btn.lg { padding: 11px 22px; font-size: 1rem; }
.btn.block { width: 100%; }
.btn.ghost { border-color: transparent; background: transparent; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); cursor: pointer; font-size: 1rem;
  text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn.sm { width: 26px; height: 26px; font-size: .85rem; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.link-btn { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 2px 4px; font-size: .88rem; }
.link-btn:hover { text-decoration: underline; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap;
}
.badge.cat { background: var(--primary-soft); color: var(--primary-2); border-color: #dcdffd; }
.badge.type { background: #f3f4f6; }
.badge.st-published, .badge.pay-paid { background: var(--ok-soft); color: var(--ok); border-color: #c4ead4; }
.badge.st-draft, .badge.pay-pending { background: var(--warn-soft); color: var(--warn); border-color: #f5dfae; }
.badge.st-closed, .badge.pay-rejected { background: var(--danger-soft); color: var(--danger); border-color: #f4c9c6; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.empty { padding: 40px 20px; text-align: center; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.notice { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-2); font-size: .9rem; margin: 10px 0; }
.notice.warn { background: var(--warn-soft); color: var(--warn); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.form-error { color: var(--danger); font-size: .9rem; min-height: 1.2em; }
.big-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 10px; color: var(--text-3); }
.big-icon.ok { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 5px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Toast & modal */
/* Notifikasi tembus klik agar tidak menghalangi tombol di bawahnya (mis. tombol simpan dialog) */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; }
.toast { background: #1f2437; color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-width: 360px; transition: opacity .4s, transform .4s; }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--danger); }
.toast.hide { opacity: 0; transform: translateY(8px); }
.modal-back { position: fixed; inset: 0; background: rgba(18, 22, 36, .45); display: grid; place-items: center; padding: 16px; z-index: 900; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal.wide { max-width: 780px; }
.modal.xwide { max-width: 1100px; }

/* Teks bertautan & tabel informasi */
.rich-in { display: flex; flex-direction: column; gap: 6px; }
.rich-bar { display: flex; gap: 6px; }
.kf-paragraph a, .kf-help a, .fill-desc a, .kf-itable a { color: #1d4ed8; text-decoration: underline; text-underline-offset: 2px; }
.kf-paragraph a:hover, .kf-help a:hover, .fill-desc a:hover, .kf-itable a:hover { color: #1e3a8a; }
.kf-itable-title { font-weight: 700; font-size: 1.02rem; margin-bottom: 8px; }
.kf-itable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.kf-itable th, .kf-itable td { border: 1px solid var(--border-strong); padding: 9px 12px; vertical-align: middle; overflow-wrap: anywhere; }
.kf-itable th { background: var(--surface-2); font-weight: 700; text-align: center; }
.kf-itable.center-rest td:not(:first-child) { text-align: center; }
.kf-itable tbody tr:hover td { background: #fafbff; }
.it-table { border-collapse: collapse; width: 100%; }
.it-table th, .it-table td { padding: 4px; vertical-align: top; border: 1px solid var(--border); min-width: 150px; }
.it-table th { background: var(--surface-2); }
.it-table .it-side { min-width: 0; width: 1%; white-space: nowrap; vertical-align: middle; text-align: center; border: 0; background: transparent; }
.it-colbar { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 2px; }
.it-cell { resize: vertical; font-size: .88rem; min-height: 40px; }
.it-cell.head { font-weight: 700; }
.it-editor { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.it-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.it-sep { width: 1px; height: 22px; background: var(--border-strong); margin: 0 4px; }
.it-cell.merged { background: repeating-linear-gradient(135deg, #f3f4f8, #f3f4f8 6px, #eceef5 6px, #eceef5 12px); color: var(--text-3); text-align: center; font-weight: 700; }
.it-colbar span { display: inline-flex; }
.it-side-btns { display: grid; grid-template-columns: repeat(3, 24px); gap: 2px; }
.it-table .it-side .icon-btn { width: 24px; height: 24px; }

/* Gaya "belang biru" ala jadwal */
.kf-itable.striped { border-collapse: separate; border-spacing: 0; }
.kf-itable.striped th, .kf-itable.striped td { border: 0; border-bottom: 1px solid #c9d3ea; border-right: 1px solid #d5ddef; }
.kf-itable.striped th { background: #dfe6f3; color: #3b4a73; font-weight: 600; text-align: left; }
.kf-itable.striped tbody tr:nth-child(odd) td { background: #e3e6ff; }
.kf-itable.striped tbody tr:nth-child(even) td { background: #fff; }
.kf-itable.striped.center-rest td:not(:first-child) { text-align: left; }
/* Tabel interaktif (Show, Cari, Urutkan) */
.it-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid #c9d3ea; }
.it-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: #c3cfe6; }
.it-show { display: flex; align-items: center; gap: 8px; color: var(--text); }
.it-show .input { width: auto; }
.it-search { position: relative; display: flex; align-items: center; flex: 0 1 300px; }
.it-search-ico { position: absolute; left: 10px; z-index: 1; color: var(--text-3); pointer-events: none; }
.it-search .input { padding-left: 30px; }
.it-wrap .table-scroll { background: #fff; }
.it-wrap .kf-itable { border: 0; }
.kf-itable th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.kf-itable th.sortable:hover { background: #d2dbee; }
.kf-itable th .sort-ico { margin-left: 8px; font-size: .75rem; color: var(--text-3); }
.kf-itable th[aria-sort="ascending"] .sort-ico, .kf-itable th[aria-sort="descending"] .sort-ico { color: var(--primary); }
.it-empty { text-align: center !important; color: var(--text-3); }
.it-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: #eef1f8; font-size: .85rem; color: var(--text-2); }
.it-pager { display: inline-flex; align-items: center; gap: 4px; }
.it-editor .table-scroll { width: 100%; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* Tabel data */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table.click tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #fafbff; }
.data-table th.r { text-align: right; }

/* ---------- Tata letak admin ---------- */
/* Sidebar minimalis: terang, ikon garis, bisa diciutkan (desktop) & laci geser (HP) */
.layout { --sb-w: 248px; display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.content { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px;
  padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--border); z-index: 30;
}
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 6px 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; color: var(--text); text-decoration: none !important; }
.brand.big { font-size: 1.5rem; padding: 0 0 8px; }
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #6366f1, #4338ca); box-shadow: 0 4px 10px rgba(67, 56, 202, .28);
}
.sb-ico { width: 20px; height: 20px; flex: none; display: inline-grid; }
.sb-ico svg { width: 100%; height: 100%; }
.sb-text { white-space: nowrap; }
.sb-toggle, .sb-logout {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-3); cursor: pointer; transition: background .15s, color .15s;
}
.sb-toggle:hover { background: var(--surface-2); color: var(--text); }
.sb-toggle .sb-ico { transition: transform .2s; }
.sb-logout:hover { background: var(--danger-soft); color: var(--danger); }
.sb-create {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border: 0; border-radius: 10px;
  background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(67, 56, 202, .22); transition: background .15s, transform .1s;
}
.sb-create:hover { background: var(--primary-2); }
.sb-create:active { transform: scale(.98); }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 6px 12px; }
.sb-link {
  position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; text-decoration: none !important; transition: background .15s, color .15s;
}
.sb-link:hover { background: var(--surface-2); color: var(--text); }
.sb-link.active { background: var(--primary-soft); color: var(--primary-2); }
.sb-link.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.sb-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--primary-2); background: #e0e3ff; }
.sb-foot .who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sb-foot .who strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.sb-foot .who small { font-size: .75rem; color: var(--text-3); }
.sb-backdrop, .mobile-bar { display: none; }
.main { padding: 28px 32px 48px; min-width: 0; max-width: 1320px; }

@media (min-width: 861px) {
  .mobile-only { display: none !important; }
  .layout.collapsed { --sb-w: 76px; }
  .layout.collapsed .sb-text { display: none; }
  .layout.collapsed .sb-top { flex-direction: column; padding: 2px 0 6px; }
  .layout.collapsed .sb-toggle .sb-ico { transform: rotate(180deg); }
  .layout.collapsed .sb-link, .layout.collapsed .sb-create { justify-content: center; padding: 0; }
  .layout.collapsed .sb-foot { flex-direction: column; padding: 8px 0; border-color: transparent; background: transparent; }
  /* Tooltip label saat menu diciutkan */
  .layout.collapsed [data-tip]:hover::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%);
    padding: 5px 10px; border-radius: 6px; background: #1f2437; color: #fff; font-size: .8rem; font-weight: 600;
    white-space: nowrap; pointer-events: none; z-index: 60; box-shadow: var(--shadow);
  }
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-label { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .8rem; color: var(--text-3); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.recent-list { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 24px !important; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input { width: auto; min-width: 150px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.forms-table { min-width: 1000px; }
.forms-table .cb-col { width: 40px; min-width: 40px; padding-right: 0; }
.forms-table input[type=checkbox] { width: 16px; height: 16px; accent-color: #16a34a; cursor: pointer; vertical-align: middle; }
.forms-table tr.sel td { background: #eefaf1; }
.forms-table tr.inactive .form-link { color: var(--text-2); }
.bulk-bar { display: flex; align-items: center; gap: 8px; min-height: 36px; margin-bottom: 8px; flex-wrap: wrap; }
.switch-wrap { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.slider { position: absolute; inset: 0; background: #cdd2dd; border-radius: 999px; transition: background .2s; }
.slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .slider { background: #16a34a; }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--primary); outline-offset: 2px; }
.sw-label { font-size: .84rem; font-weight: 600; color: var(--text-3); min-width: 58px; }
.sw-label.on { color: #15803d; }
.forms-table td:nth-child(2) { min-width: 280px; }
.forms-table .form-link { font-weight: 600; color: var(--text); }
.forms-table .sub { font-size: .8rem; color: var(--text-3); }
.num-link { font-weight: 700; font-variant-numeric: tabular-nums; }
.recent h3 { margin-bottom: 10px; }
.recent-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.recent-list li { display: flex; flex-direction: column; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.recent-list li:last-child { border-bottom: 0; }
.recent-list a { font-weight: 600; color: var(--text); }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tpl-card { padding: 18px; display: flex; flex-direction: column; }
.tpl-card p { flex: 1; font-size: .9rem; }
.tpl-top { display: flex; gap: 6px; margin-bottom: 10px; }
.tpl-foot { display: flex; align-items: center; justify-content: space-between; }
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tpl-opt { text-align: left; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.tpl-opt small { color: var(--text-3); }
.tpl-opt:hover { border-color: var(--border-strong); }
.tpl-opt.on { border-color: var(--primary); background: var(--primary-soft); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 20% 0%, #e7e9ff 0%, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); padding: 30px; border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }

.settings-sec { margin-bottom: 18px; max-width: 900px; }
.org-grid { display: grid; grid-template-columns: 1fr 220px; gap: 20px; }
.logo-prev { height: 120px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-2); }
.logo-prev img { max-width: 90%; max-height: 100px; }
.user-add { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr 1fr 1fr auto; gap: 8px; margin-top: 14px; }
.tpl-sec { font-size: 1.05rem; margin: 22px 0 12px; }
/* Dialog bagikan respon */
.share-sub { margin: -4px 0 14px; font-weight: 500; overflow-wrap: anywhere; }
.share-dlg { display: flex; flex-direction: column; gap: 16px; }
.share-toggle { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); cursor: pointer; transition: background .2s, border-color .2s; }
.share-toggle.on { background: var(--ok-soft); border-color: #b7e4c7; }
.share-toggle-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.share-toggle-text small { color: var(--text-2); font-size: .85rem; }
.share-link { display: flex; gap: 8px; }
.share-link .input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; background: var(--bg); }
.share-link .btn { flex: none; min-width: 96px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-can { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-size: .9rem; }
.share-can li { display: flex; gap: 8px; align-items: baseline; }
.share-can li::before { flex: none; font-weight: 700; }
.share-can li.yes::before { content: "✓"; color: var(--ok); }
.share-can li.no { color: var(--text-2); }
.share-can li.no::before { content: "✕"; color: var(--danger); }
.share-warn { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--warn-soft); color: var(--warn); font-size: .88rem; }
.share-warn .btn { margin-top: 4px; }
@media (max-width: 640px) {
  .share-link { flex-direction: column; }
  .share-link .btn, .share-actions .btn { width: 100%; justify-content: center; }
  .share-actions { flex-direction: column; }
  .share-can { grid-template-columns: 1fr; }
  .share-toggle { padding: 12px; }
}

.shared-wrap { max-width: 1280px; margin: 0 auto; padding: 20px 16px 8px; display: flex; flex-direction: column; gap: 16px; }
.shared-head { display: flex; align-items: center; gap: 14px; }
.shared-head .badge { margin-left: auto; white-space: nowrap; }
.shared-logo { width: 52px; height: 52px; object-fit: contain; }
.shared-title h1 { font-size: 1.3rem; margin: 2px 0; }
.shared-title { min-width: 0; }
@media (max-width: 640px) { .shared-head { flex-wrap: wrap; } .shared-head .badge { margin-left: 0; } }
.tpl-foot .row { gap: 4px; align-items: center; }
.data-table td.r { white-space: nowrap; }
.data-table td.r .btn + .icon-btn, .data-table td.r .btn + .btn { margin-left: 4px; }
.tpl-access { align-self: flex-start; border: 1px solid var(--border-strong); background: transparent; color: inherit; border-radius: 999px;
  padding: 3px 10px; font-size: .8rem; cursor: pointer; margin-bottom: 8px; }
.tpl-access:hover { border-color: var(--primary); color: var(--primary); }
.tpl-card.tpl-hidden { opacity: .6; }
.acc-modes { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.acc-mode, .acc-user { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.acc-user.locked { cursor: default; opacity: .7; }
.acc-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; padding: 2px; }

/* ---------- Editor ---------- */
.editor { display: flex; flex-direction: column; height: 100vh; }
.ed-top { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ed-name { min-width: 0; max-width: 300px; }
.ed-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-meta { font-size: .78rem; display: flex; align-items: center; gap: 6px; }
.save-ind { color: var(--text-3); }
.save-ind.busy { color: var(--warn); }
.save-ind.err { color: var(--danger); }
.ed-tabs { display: flex; gap: 2px; margin: 0 auto; }
.ed-tabs a { padding: 8px 14px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; text-decoration: none; }
.ed-tabs a:hover { background: var(--surface-2); color: var(--text); }
.ed-tabs a.active { background: var(--primary-soft); color: var(--primary-2); }
.ed-actions { display: flex; gap: 8px; }
.editor-body { flex: 1; min-height: 0; overflow: auto; }

/* Builder */
.builder { display: grid; grid-template-columns: 240px minmax(0, 1fr) 320px; height: 100%; }
.b-palette, .b-props { background: var(--surface); overflow-y: auto; }
.b-palette { border-right: 1px solid var(--border); padding: 16px 12px; }
.b-props { border-left: 1px solid var(--border); }
.b-palette-title { font-weight: 700; }
.b-group { margin-top: 14px; }
.b-group-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; margin-bottom: 6px; }
.b-items { display: grid; grid-template-columns: 1fr; gap: 4px; }
.b-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: grab; text-align: left; font-size: .88rem; color: var(--text); }
.b-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.b-ico { width: 26px; height: 26px; flex: none; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--primary-2); }
.b-main { overflow-y: auto; padding: 28px 24px 80px; }
.b-paper { max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 28px; border-top: 5px solid var(--primary); }
.b-paper-head { margin-bottom: 18px; }
.b-title-in, .b-desc-in { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 4px 8px; margin-left: -8px; font: inherit; color: var(--text); background: transparent; resize: none; overflow: hidden; }
.b-title-in { font-size: 1.5rem; font-weight: 700; }
.b-desc-in { color: var(--text-2); }
.b-title-in:hover, .b-desc-in:hover { border-color: var(--border); }
.b-title-in:focus, .b-desc-in:focus { outline: none; border-color: var(--primary); background: var(--surface-2); }
.b-canvas { min-height: 200px; }
.b-empty { grid-column: 1 / -1; border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 48px 20px; text-align: center; color: var(--text-2); }
.b-card { grid-column: span 2; position: relative; border: 1.5px solid transparent; border-radius: var(--radius); padding: 8px 12px 12px; cursor: pointer; transition: border-color .12s, background .12s; }
.b-card.half { grid-column: span 1; }
.b-card:hover { border-color: var(--border-strong); background: #fcfcfe; }
.b-card.selected { border-color: var(--primary); background: #fbfbff; box-shadow: 0 0 0 3px rgba(67,56,202,.08); }
.b-card.dragging { opacity: .4; }
.b-card.drop-before::before, .b-card.drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--primary); border-radius: 2px; }
.b-card.drop-before::before { top: -7px; }
.b-card.drop-after::after { bottom: -7px; }
.b-card.half.drop-before::before, .b-card.half.drop-after::after { top: 0; bottom: 0; width: 3px; height: auto; }
.b-card.half.drop-before::before { left: -7px; right: auto; }
.b-card.half.drop-after::after { right: -7px; left: auto; }
.b-card .kf-control, .b-card .kf-field { pointer-events: none; }
.b-card .kf-field { margin: 0; }
.b-card-bar { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--text-3); min-height: 26px; margin-bottom: 2px; }
.b-handle { cursor: grab; font-size: 1rem; }
.b-type { font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.b-badge { background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 0 8px; font-weight: 600; }
.b-badge.ok { background: var(--ok-soft); color: var(--ok); }
.b-card-actions { margin-left: auto; display: flex; opacity: 0; transition: opacity .12s; }
.b-card:hover .b-card-actions, .b-card.selected .b-card-actions { opacity: 1; }

.p-empty { padding: 32px 22px; text-align: center; color: var(--text-2); }
.p-summary { display: flex; justify-content: center; gap: 16px; margin-top: 16px; font-size: .88rem; }
.p-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.p-head strong { flex: 1; }
.p-sec { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.p-sec-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; }
.p-row { display: flex; flex-direction: column; gap: 4px; }
.p-label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.p-check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.p-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.p-checks { display: flex; flex-direction: column; gap: 6px; }
.p-foot { padding: 12px 16px; }

.settings-page { max-width: 860px; margin: 0 auto; padding: 24px 20px 60px; display: flex; flex-direction: column; gap: 16px; }
.settings-page section { display: flex; flex-direction: column; gap: 12px; }
.settings-page h2 { margin: 0; }
.link-row { display: flex; gap: 8px; margin-bottom: 8px; }
.share-grid { display: grid; grid-template-columns: 200px 1fr; gap: 20px; margin-top: 10px; align-items: start; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 120px; justify-content: center; }
.qr-box img { image-rendering: pixelated; }
.print-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.print-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none !important; }
.print-opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.print-opt span:last-child { display: flex; flex-direction: column; }
.print-opt small { color: var(--text-2); }

/* Respon */
.resp-page { max-width: 1680px; margin: 0 auto; padding: 22px 20px 60px; }
.det-heading { margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--primary-soft); color: var(--primary-2); }
.det-row { display: grid; grid-template-columns: 220px 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.det-label { color: var(--text-2); font-weight: 600; font-size: .88rem; }
.det-val { min-width: 0; overflow-x: auto; }
.score-box { background: var(--primary-soft); border-radius: var(--radius); padding: 14px; margin: 12px 0; }
.score-box.inline { padding: 8px 14px; }
.score-num { font-size: 2rem; font-weight: 800; color: var(--primary-2); }
.pay-status { display: flex; align-items: center; gap: 10px; background: var(--surface-2); padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 8px; }
.pay-status .input { width: auto; }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.sum-card h4 { margin-bottom: 2px; }
.sum-card .bars, .sum-card .table-scroll, .sum-card .answers, .sum-card p { margin-top: 12px; }
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 38%) 1fr 76px; gap: 10px; align-items: center; font-size: .86rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 999px; min-width: 2px; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.answers { margin: 0; padding-left: 18px; font-size: .9rem; display: flex; flex-direction: column; gap: 4px; }
.matrix-sum td.top { font-weight: 700; color: var(--primary-2); }

/* Tampilan nilai */
.sig-img { max-height: 80px; max-width: 240px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.file-val { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.file-thumb { max-height: 120px; max-width: 200px; border-radius: 6px; border: 1px solid var(--border); }
.doc-table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.doc-table th, .doc-table td { border: 1px solid var(--border-strong); padding: 5px 8px; text-align: left; vertical-align: top; }
.doc-table th { background: var(--surface-2); }
.doc-table .c { text-align: center; }
.stars-val { color: #e59f0b; letter-spacing: 1px; }
.pay-line { display: flex; justify-content: space-between; gap: 20px; max-width: 360px; }
.pay-line.total { font-weight: 700; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }

/* ---------- Elemen formulir ---------- */
.kf-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.kf-field { grid-column: span 2; padding: 8px 0; min-width: 0; }
.kf-field.half { grid-column: span 1; }
.kf-field[hidden] { display: none; }
.kf-t-heading { padding-top: 14px; }
.kf-heading-title { font-size: 1.15rem; margin: 0; padding-bottom: 6px; border-bottom: 2px solid var(--primary-soft); }
.kf-t-heading .kf-help { margin-top: 6px; }
.kf-paragraph { white-space: pre-line; color: var(--text-2); background: var(--surface-2); border-left: 3px solid var(--primary); padding: 10px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.kf-label { display: block; font-weight: 600; margin-bottom: 6px; }
.kf-label .req { color: var(--danger); }
.kf-help { font-size: .84rem; color: var(--text-2); margin: -3px 0 7px; white-space: pre-line; }
.kf-error { color: var(--danger); font-size: .84rem; margin-top: 4px; }
.kf-error:empty { display: none; }
.kf-field.has-error .input, .kf-field.has-error .sig-wrap, .kf-field.has-error .kf-drop { border-color: var(--danger); }
.kf-options { display: flex; flex-direction: column; gap: 6px; }
.kf-options.inline { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; }
.kf-option { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; padding: 3px 0; }
.kf-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.kf-rating { display: flex; align-items: center; gap: 2px; }
.kf-rating .star { border: 0; background: none; font-size: 1.9rem; line-height: 1; color: #d6d9e3; cursor: pointer; padding: 0 2px; }
.kf-rating .star.on { color: #f59e0b; }
.kf-rating .star:hover { transform: scale(1.1); }
.kf-rating-val { margin-left: 10px; color: var(--text-2); font-weight: 600; }
.kf-scale-row { display: flex; gap: 6px; flex-wrap: wrap; }
.kf-scale-row button { min-width: 42px; height: 42px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; }
.kf-scale-row button:hover { border-color: var(--primary); }
.kf-scale-row button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.kf-scale-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-2); margin-top: 6px; max-width: 520px; }
.kf-matrix { width: 100%; border-collapse: collapse; font-size: .9rem; }
.kf-matrix th { font-size: .8rem; color: var(--text-2); padding: 6px; font-weight: 600; text-align: center; }
.kf-matrix td { border-top: 1px solid var(--border); padding: 0; }
.kf-matrix tbody tr:nth-child(odd) { background: var(--surface-2); }
.kf-matrix .row-label { padding: 9px 10px; min-width: 200px; }
.kf-matrix .cell { text-align: center; width: 80px; }
.kf-matrix .cell-hit { display: grid; place-items: center; padding: 10px; cursor: pointer; }
.kf-matrix input { width: 18px; height: 18px; accent-color: var(--primary); }
.kf-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.kf-table th { font-size: .8rem; text-align: left; color: var(--text-2); padding: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.kf-table td { border: 1px solid var(--border); padding: 3px; min-width: 110px; }
.kf-table .num { width: 36px; min-width: 36px; text-align: center; color: var(--text-3); }
.kf-table .act { width: 34px; min-width: 34px; text-align: center; }
.kf-table .input { border-color: transparent; }
.kf-table .input:focus { border-color: var(--primary); }
.kf-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; text-align: center; }
.kf-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.kf-drop strong { color: var(--primary); }
.kf-drop small { color: var(--text-3); }
.kf-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.kf-file-info { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .9rem; }
.kf-file-info:empty { display: none; }
.sig-wrap { position: relative; border: 1.5px solid var(--border-strong); border-radius: var(--radius); background: #fff; height: 170px; max-width: 520px; }
.sig-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; border-radius: var(--radius); }
.sig-hint { position: absolute; left: 0; right: 0; bottom: 30px; text-align: center; color: var(--text-3); pointer-events: none; border-top: 1px dashed var(--border-strong); margin: 0 30px; padding-top: 4px; font-size: .82rem; }
.sig-wrap.signed .sig-hint { opacity: 0; }
.kf-signature .link-btn { margin-top: 4px; padding-left: 0; }
.kf-payment { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kf-pay-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.kf-pay-item:hover { background: var(--surface-2); }
.kf-pay-item input { width: 18px; height: 18px; accent-color: var(--primary); }
.kf-pay-item .lbl { flex: 1; }
.kf-pay-item .price { font-weight: 600; font-variant-numeric: tabular-nums; }
.kf-pay-total { display: flex; justify-content: space-between; padding: 12px 14px; background: var(--primary-soft); color: var(--primary-2); font-size: 1.05rem; }

/* ---------- Halaman pengisian ---------- */
body.fill-page { background: linear-gradient(180deg, #e9ebff 0, #e9ebff 220px, var(--bg) 220px); min-height: 100vh; }
.fill-wrap { max-width: 780px; margin: 0 auto; padding: 32px 16px 16px; }
.fill-card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 30px 34px; border-top: 6px solid var(--primary); }
.fill-card.center { text-align: center; }
.fill-banner { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 22px; }
.fill-banner img { display: block; width: 100%; height: auto; }
/* Banner di builder */
.b-banner { position: relative; margin: -28px -28px 20px; border-bottom: 1px solid var(--border); border-radius: 7px 7px 0 0; overflow: hidden; }
.b-banner img { display: block; width: 100%; height: auto; }
.b-banner.busy { opacity: .5; pointer-events: none; }
.b-banner-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.b-banner:hover .b-banner-actions, .b-banner:focus-within .b-banner-actions { opacity: 1; }
.b-banner-actions .btn { box-shadow: var(--shadow); }
.b-banner-empty {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 22px 16px; border: 0;
  border-bottom: 1.5px dashed var(--border-strong); background: var(--surface-2); color: var(--text-2); font: inherit; cursor: pointer;
}
.b-banner-empty strong { color: var(--primary); }
.b-banner-empty small { color: var(--text-3); }
.b-banner-empty:hover { background: var(--primary-soft); }
.fill-card.center .fill-head { justify-content: center; text-align: left; }
.fill-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.fill-logo { max-height: 52px; max-width: 120px; }
.fill-org { font-weight: 700; }
.fill-code { font-size: .8rem; color: var(--text-3); }
.fill-title { font-size: 1.65rem; margin-bottom: 4px; }
.fill-event { color: var(--primary-2); font-weight: 600; margin-bottom: 8px; }
.fill-desc { color: var(--text-2); white-space: pre-line; }
.fill-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }
.fill-foot { text-align: center; color: var(--text-3); font-size: .82rem; padding: 18px; }
body.embed { background: transparent; }
body.embed .fill-wrap { padding: 0; }
body.embed .fill-foot { display: none; }

/* ---------- Tabel respon (gaya spreadsheet) ---------- */
.row.gap { margin-bottom: 10px; }
.grid-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; padding: 10px 12px; }
.grid-toolbar:empty { display: none; }
.gt-search { position: relative; flex: 0 1 280px; min-width: 180px; }
.gt-search .input { padding-left: 30px; }
.gt-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.btn.active { border-color: var(--primary); color: var(--primary-2); background: var(--primary-soft); }
.btn.success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn.success:hover { background: #15803d; }
.btn.ghost-primary { border-color: transparent; background: var(--primary-soft); color: var(--primary-2); }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: .72rem; }
.count-badge.light { background: rgba(255, 255, 255, .28); }
.sel-pill { display: inline-flex; align-items: center; gap: 6px; background: #2563eb; color: #fff; font-weight: 600; font-size: .88rem; padding: 6px 8px 6px 12px; border-radius: var(--radius-sm); }
.sel-x { border: 0; background: rgba(255, 255, 255, .25); color: #fff; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: .7rem; }
.popover { position: absolute; z-index: 800; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px; }
.stack.sm-gap { gap: 8px; }
.col-list { max-height: 360px; overflow: auto; min-width: 240px; }
.dl-item { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none !important; }
.dl-item:hover { background: var(--surface-2); }
.dl-item span:last-child { display: flex; flex-direction: column; }
.dl-item small { color: var(--text-2); }
.dl-ico { width: 38px; height: 38px; flex: none; border-radius: 8px; background: var(--primary-soft); color: var(--primary-2); display: grid; place-items: center; font-weight: 800; font-size: .78rem; }

.grid-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.grid-wrap { overflow: auto; max-height: max(360px, calc(100vh - 330px)); }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .875rem; }
table.grid th, table.grid td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 0 12px; height: 40px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; background: var(--surface); }
table.grid th { position: sticky; top: 0; z-index: 2; background: #f3f5fa; font-weight: 700; color: var(--text); padding: 0 6px 0 10px; text-align: left; }
table.grid th.wide, table.grid td.wide { max-width: 340px; }
table.grid .sticky-l0 { position: sticky; left: 0; z-index: 1; }
table.grid .sticky-l1 { position: sticky; left: 44px; z-index: 1; box-shadow: 1px 0 0 var(--border); }
table.grid th.sticky-l0, table.grid th.sticky-l1 { z-index: 3; }
table.grid .g-cb { width: 44px; min-width: 44px; max-width: 44px; padding: 0; text-align: center; }
table.grid .g-cb input { width: 16px; height: 16px; accent-color: #16a34a; cursor: pointer; vertical-align: middle; }
table.grid .g-no { width: 76px; min-width: 76px; max-width: 76px; padding: 0 6px; color: var(--text-3); }
.rn { display: inline-block; width: 28px; text-align: right; margin-right: 6px; font-variant-numeric: tabular-nums; }
.star-btn { border: 0; background: none; cursor: pointer; font-size: 1.05rem; color: #b8bfd0; padding: 2px; }
.star-btn:hover { color: #f59e0b; }
.star-btn.on { color: #f59e0b; }
table.grid .g-doc { width: 96px; min-width: 96px; }
.doc-btn { display: inline-grid; place-items: center; width: 28px; height: 26px; margin-right: 4px; border-radius: 6px; border: 0; cursor: pointer; font-size: .68rem; font-weight: 800; text-decoration: none !important; vertical-align: middle; }
.doc-btn.green { background: #dcf5e3; color: #15803d; font-size: .9rem; }
.doc-btn.blue { background: #dbe7ff; color: #1d4ed8; }
.doc-btn:hover { filter: brightness(.94); }
.th-btn { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; padding: 0; height: 40px; text-align: left; }
.th-static { display: flex; align-items: center; gap: 6px; }
.th-ico { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 4px; background: #5b6478; color: #fff; font-size: .62rem; font-weight: 700; padding: 0 3px; flex: none; }
.th-label { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.th-sort { color: var(--text-3); font-size: .8rem; flex: none; }
.th-btn.on .th-sort { color: var(--primary); }
.th-btn:hover .th-label { color: var(--primary-2); }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover td { background: #f8faff; }
table.grid tbody tr.sel td { background: #eefaf1; }
table.grid tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 #16a34a; }
.chip { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; padding: 2px 9px; border-radius: 6px; font-size: .8rem; font-weight: 600; }
.chips { display: inline-flex; gap: 4px; }
.cell-sig { height: 30px; max-width: 120px; vertical-align: middle; background: #fff; }
.cell-file { color: var(--primary); }
.grid-foot { display: flex; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--border); background: #f3f5fa; font-size: .85rem; color: var(--text-2); }
.empty.flat { border: 0; border-radius: 0; }

@media print {
  body { background: #fff; }
  .sidebar, .no-print, .toasts { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; max-width: none; }
  .card, .stat { box-shadow: none; }
  .table-scroll { overflow: visible; }
}

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
  .builder { grid-template-columns: 200px minmax(0, 1fr) 280px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .layout { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 272px; height: auto; z-index: 950;
    transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
  }
  .layout.drawer-open .sidebar { transform: none; }
  .sb-toggle { display: none; }
  .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 940; background: rgba(18, 22, 36, .4); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .layout.drawer-open .sb-backdrop { opacity: 1; pointer-events: auto; }
  .mobile-bar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .main { padding: 20px 16px 40px; }
  .builder { grid-template-columns: 1fr; height: auto; }
  .b-palette { border-right: 0; border-bottom: 1px solid var(--border); }
  .b-items { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .b-props { border-left: 0; border-top: 1px solid var(--border); }
  .b-main { padding: 16px; }
  .b-paper { padding: 18px; }
  .b-banner { margin: -18px -18px 16px; }
  .editor { height: auto; min-height: 100vh; }
  .ed-tabs { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  .ed-actions { margin-left: auto; }
  .org-grid, .share-grid, .print-opts, .user-add { grid-template-columns: 1fr; }
  .sum-grid { grid-template-columns: 1fr; }
  .det-row { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 600px) {
  .kf-fields { grid-template-columns: 1fr; }
  .kf-field, .kf-field.half, .b-card, .b-card.half, .b-empty { grid-column: 1 / -1; }
  .grid2 { grid-template-columns: 1fr; }
  .fill-card { padding: 22px 18px; }
  .fill-wrap { padding: 16px 12px; }
  .toolbar .input { min-width: 0; flex: 1; }
  .link-row { flex-wrap: wrap; }
  /* Dialog: hampir layar penuh di HP, tombol bawah boleh turun baris */
  .modal-back { padding: 8px; align-items: end; }
  .modal, .modal.wide { max-width: none; max-height: calc(100vh - 16px); border-radius: 14px; }
  .modal-body { padding: 16px; }
  .modal-foot { flex-wrap: wrap; padding: 12px 16px; }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
  .modal-foot .grow { display: none; }
  /* Toolbar respon: pencarian selebar layar */
  .gt-search { flex: 1 1 100%; min-width: 0; }
  .ed-actions { flex-wrap: wrap; gap: 6px; }
  /* Dashboard: pencarian selebar layar, filter 2 kolom */
  .toolbar input[type=search] { flex: 1 1 100%; min-width: 0; }
  .toolbar select.input { flex: 1 1 calc(50% - 4px); min-width: 0; max-width: 100%; }
  /* Kartu statistik 2 kolom & lebih ringkas */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 1.35rem; }
}

/* ======================================================================
   TEMA BERWARNA
   Lapisan warna di atas gaya dasar (tata letak tidak berubah).
   Ubah palet cukup di variabel --c-* di bawah ini.
   ====================================================================== */
:root {
  --c-indigo: #4f46e5; --c-violet: #7c3aed; --c-pink: #db2777; --c-amber: #d97706;
  --c-emerald: #059669; --c-sky: #0284c7; --c-rose: #e11d48;
  --grad-main: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #c026d3 100%);
  --grad-warm: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ec4899 100%);
  --primary: #4f46e5; --primary-2: #4338ca; --primary-soft: #eef0ff;
  --bg: #f3f4fb;
}
body { background: radial-gradient(900px 420px at 100% -10%, #efe7ff 0%, transparent 60%),
  radial-gradient(800px 380px at -10% 0%, #e3f0ff 0%, transparent 55%), var(--bg); background-attachment: fixed; }

/* Tombol utama bergradasi */
.btn.primary { background: var(--grad-main); border-color: transparent; box-shadow: 0 3px 10px rgba(99, 70, 229, .28); }
.btn.primary:hover { background: var(--grad-main); filter: brightness(1.08); }
.btn.success { background: linear-gradient(135deg, #10b981, #059669); border-color: transparent; box-shadow: 0 3px 10px rgba(5, 150, 105, .25); }
.btn.success:hover { background: linear-gradient(135deg, #10b981, #059669); filter: brightness(1.08); }
.btn:not(.primary):not(.success):not(.danger):hover { border-color: #c7c9f5; }

/* Sidebar terang: putih → biru muda, aksen hijau */
:root { --grad-sb: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%); }
.sidebar { background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 55%, #e0f2fe 100%); border-right: 1px solid #dbeafe; color: #0f172a; }
.sidebar .brand { color: #0c4a6e; }
.sidebar .brand-mark { background: var(--grad-sb); box-shadow: 0 4px 12px rgba(14, 165, 233, .3); }
.sidebar .sb-label { color: #64748b; }
.sidebar .sb-link { color: #334155; }
.sidebar .sb-link:hover { background: #e0f2fe; color: #0c4a6e; }
.sidebar .sb-link.active { background: #dcfce7; color: #047857; box-shadow: inset 0 0 0 1px #bbf7d0; }
.sidebar .sb-link.active::before { background: #10b981; }
.sidebar .sb-toggle, .sidebar .sb-logout { color: #64748b; }
.sidebar .sb-toggle:hover { background: #e0f2fe; color: #0c4a6e; }
.sidebar .sb-logout:hover { background: var(--danger-soft); color: var(--danger); }
.sidebar .sb-create { background: var(--grad-sb); box-shadow: 0 6px 16px rgba(14, 165, 233, .3); }
.sidebar .sb-create:hover { background: var(--grad-sb); filter: brightness(1.06); }
.sidebar .sb-foot { background: #ffffff; border-color: #dbeafe; }
.sidebar .sb-foot .who small { color: #64748b; }
.sidebar .avatar { background: var(--grad-sb); color: #fff; }
.mobile-bar { background: linear-gradient(90deg, #ffffff, #e0f2fe) !important; border-bottom: 1px solid #dbeafe !important; }
.mobile-bar .brand { color: #0c4a6e; }
.mobile-bar .brand-mark { background: var(--grad-sb); }
.mobile-bar .icon-btn { color: #0c4a6e; }
.mobile-bar .icon-btn:hover { background: #e0f2fe; }

/* Judul halaman dengan aksen gradasi */
.page-head h1 { background: var(--grad-main); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head > div:first-child { position: relative; padding-left: 14px; }
.page-head > div:first-child::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 4px; background: var(--grad-warm); }

/* Kartu statistik berwarna (berganti warna per kartu) */
.stat { position: relative; overflow: hidden; border: 0; color: #fff; box-shadow: 0 6px 18px rgba(30, 27, 75, .12); }
.stat .stat-label, .stat .stat-sub { color: rgba(255, 255, 255, .85); }
.stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.stats > .stat:nth-child(5n+1) { background: linear-gradient(135deg, #6366f1, #4338ca); }
.stats > .stat:nth-child(5n+2) { background: linear-gradient(135deg, #10b981, #047857); }
.stats > .stat:nth-child(5n+3) { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.stats > .stat:nth-child(5n+4) { background: linear-gradient(135deg, #ec4899, #be185d); }
.stats > .stat:nth-child(5n+5) { background: linear-gradient(135deg, #0ea5e9, #0369a1); }

/* Kartu & tabel */
.card { border-color: #e6e7f5; }
.data-table th { background: linear-gradient(180deg, #f5f3ff, #eef0ff); color: #5b55b8; }
.data-table tbody tr:hover { background: #f7f5ff; }
.recent h3 { color: var(--c-violet); }
.recent-list li { border-left: 3px solid #c4b5fd; padding-left: 10px; border-bottom: 0; }
.recent-list li:nth-child(3n+2) { border-left-color: #6ee7b7; }
.recent-list li:nth-child(3n+3) { border-left-color: #fcd34d; }

/* Badge berwarna */
.badge.cat { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.badge.type { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.badge.mine { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; border-color: #fcd34d; }

/* Template: kartu dengan garis warna di atas + efek angkat saat disorot */
.tpl-card { position: relative; overflow: hidden; border-top: 0; transition: transform .15s, box-shadow .15s; }
.tpl-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.tpl-grid > .tpl-card:nth-child(4n+2)::before { background: linear-gradient(90deg, #10b981, #06b6d4); }
.tpl-grid > .tpl-card:nth-child(4n+3)::before { background: linear-gradient(90deg, #f59e0b, #f97316); }
.tpl-grid > .tpl-card:nth-child(4n+4)::before { background: linear-gradient(90deg, #ec4899, #8b5cf6); }
.tpl-card.tpl-mine::before { background: var(--grad-warm) !important; }
.tpl-card.tpl-mine { background: linear-gradient(180deg, #fffbeb 0%, #fff 40%); }
.tpl-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(79, 70, 229, .15); }
.tpl-card h3 { color: #312e81; }
.tpl-section { margin-bottom: 8px; }
.tpl-sec-head { margin: 26px 0 12px; }
.tpl-sec-head .tpl-sec { margin: 0 0 2px; display: flex; align-items: center; gap: 8px; color: #312e81; }
.tpl-sec-head p { margin: 0; }
.count-pill { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--grad-main); color: #fff; font-size: .75rem; font-weight: 700; }
.empty.soft { padding: 22px 18px; background: rgba(255, 255, 255, .6); border-color: #d9d6fb; color: #6b6a9a; }
.tpl-opt.on { border-color: var(--c-violet); background: #f5f3ff; }
.tpl-access { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }

/* Editor formulir */
.ed-top { border-bottom: 0; box-shadow: 0 1px 0 #e6e7f5, 0 3px 0 -1px transparent; position: relative; }
.ed-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--grad-main); }
.ed-tabs a.active { background: var(--grad-main); color: #fff; box-shadow: 0 3px 10px rgba(99, 70, 229, .25); }

/* Kontrol tersegmen (Tabel / Ringkasan) */
.seg button.on { background: var(--grad-main); color: #fff; box-shadow: 0 2px 8px rgba(99, 70, 229, .25); }

/* Toolbar & tabel respon */
.grid-toolbar { background: linear-gradient(180deg, #faf9ff, #fff); }

/* Dialog */
.modal-head { background: linear-gradient(90deg, #f5f3ff, #fdf2f8); border-radius: 12px 12px 0 0; }
.modal-head h3 { color: #3730a3; }

/* Login */
.login-page { background: radial-gradient(700px 500px at 0% 0%, #c7d2fe 0%, transparent 60%),
  radial-gradient(700px 500px at 100% 100%, #fbcfe8 0%, transparent 60%), linear-gradient(135deg, #eef2ff, #fdf4ff); }
.login-card { position: relative; overflow: hidden; padding-top: 36px; }
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--grad-main); }
.login-card .brand-mark { background: var(--grad-warm); }

/* Halaman isian & halaman respon yang dibagikan */
.fill-card { border-top: 0; position: relative; overflow: hidden; }
.fill-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--grad-main); }
.fill-event { color: var(--c-violet); }
.shared-head { background: linear-gradient(135deg, #4f46e5, #7c3aed 60%, #c026d3); color: #fff; border: 0; }
.shared-head .muted, .shared-head small { color: rgba(255, 255, 255, .8); }
.shared-head .badge { background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .3); }
.shared-logo { background: #fff; border-radius: 10px; padding: 4px; }

/* Notifikasi */
.toast { background: linear-gradient(135deg, #312e81, #4c1d95); }
.toast.ok { background: linear-gradient(135deg, #10b981, #047857); }
.toast.error { background: linear-gradient(135deg, #f43f5e, #be123c); }

/* ---------- Editor di HP: daftar elemen buka-tutup, pengaturan isian sebagai lembar bawah ---------- */
.b-palette-toggle, .p-sheet-head, .b-sheet-backdrop { display: none; }
@media (max-width: 860px) {
  .b-palette { padding: 10px 12px; }
  .b-palette-title, .b-palette > p { display: none; }
  .b-palette-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px;
    border: 1.5px dashed #7dd3fc; border-radius: 12px; background: #f0f9ff; color: #0369a1; font: inherit; font-weight: 700; cursor: pointer; }
  .b-palette-toggle .chev { transition: transform .2s; }
  .b-palette.open .b-palette-toggle .chev { transform: rotate(180deg); }
  .b-palette:not(.open) .b-group { display: none; }
  .b-palette.open .b-group:first-of-type { margin-top: 10px; }
  .b-items { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  /* Panel pengaturan isian: tersembunyi, muncul dari bawah saat isian dipilih */
  .b-props { display: none; }
  .builder.sheet-open .b-props { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 960; max-height: 78vh;
    overflow-y: auto; border: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px rgba(15, 23, 42, .25); animation: sheet-up .2s ease-out; }
  .builder.sheet-open .b-sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 955; background: rgba(15, 23, 42, .35); }
  .p-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 2;
    padding: 16px 16px 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .p-sheet-grip { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); }
  /* Kepala editor ringkas */
  .ed-top { gap: 8px; padding: 8px 12px; }
  .ed-name { flex: 1; max-width: none; }
  .ed-actions { width: 100%; margin-left: 0; flex-wrap: nowrap; }
  .ed-actions .btn { flex: 1 1 auto; padding: 6px 8px; font-size: .78rem; }
  .ed-tabs { flex-wrap: nowrap; scrollbar-width: none; }
  .ed-tabs::-webkit-scrollbar { display: none; }
  .ed-tabs a { white-space: nowrap; padding: 7px 12px; font-size: .88rem; flex: none; }
  /* Toolbar respon lebih ringkas */
  .grid-toolbar { gap: 6px; padding: 8px; }
  .grid-toolbar .btn { padding: 6px 10px; font-size: .8rem; }
  .grid-toolbar .grow { display: none; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
[data-theme="dark"] .b-palette-toggle { background: rgba(14, 165, 233, .1); border-color: rgba(125, 211, 252, .45); color: #7dd3fc; }

/* ---------- Kategori formulir (per akun) ---------- */
.cat-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 12px; }
.cat-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 96px auto; align-items: center; gap: 8px; }
.cat-no { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700;
  background: #e0f2fe; color: #0369a1; }
.cat-use { font-size: .8rem; color: var(--text-3); text-align: right; white-space: nowrap; }
.cat-act { display: flex; gap: 2px; }
.cat-act .icon-btn:disabled { opacity: .3; cursor: default; }
.cat-add { display: flex; gap: 8px; }
.cat-add .input { flex: 1; }
[data-theme="dark"] .cat-no { background: rgba(14, 165, 233, .18); color: #7dd3fc; }
@media (max-width: 600px) {
  .cat-row { grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: "no name act" ". use use"; row-gap: 2px;
    padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
  .cat-no { grid-area: no; } .cat-row > .input { grid-area: name; } .cat-act { grid-area: act; } .cat-use { grid-area: use; text-align: left; }
}

/* ---------- Profil & kata sandi ---------- */
.sb-profile { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none !important;
  border-radius: 10px; margin: -4px; padding: 4px; transition: background .15s; }
.sb-profile:hover { background: #e0f2fe; }
.sb-foot.active { border-color: #86efac; box-shadow: inset 0 0 0 1px #bbf7d0; }
.layout.collapsed .sb-profile { flex-direction: column; flex: none; }
[data-theme="dark"] .sb-profile:hover { background: rgba(56, 189, 248, .12); }
[data-theme="dark"] .sb-foot.active { border-color: rgba(16, 185, 129, .45); box-shadow: none; }
.avatar.big { width: 64px; height: 64px; font-size: 1.6rem; }
.profile-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.profile-top h2 { margin: 0 0 4px; font-size: 1.25rem; }
.profile-card .fld { margin-bottom: 12px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 42px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 30px; border: 0; background: transparent;
  cursor: pointer; border-radius: 6px; font-size: 1rem; line-height: 1; }
.pw-eye:hover { background: var(--surface-2); }
.pw-meter { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 2px; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: 6px; transition: width .2s, background .2s; }
.pw-meter[data-level="1"] span { width: 25%; background: #ef4444; }
.pw-meter[data-level="2"] span { width: 50%; background: #f59e0b; }
.pw-meter[data-level="3"] span { width: 75%; background: #0ea5e9; }
.pw-meter[data-level="4"] span { width: 100%; background: #10b981; }
.input.pw-show { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .06em; font-weight: 700; text-align: center; }
@media (max-width: 600px) { .profile-top { flex-direction: column; align-items: flex-start; } }

/* ---------- Pendaftaran & pengelolaan akun ---------- */
.auth-switch { text-align: center; margin: 2px 0 0; font-size: .9rem; color: var(--text-2); }
.auth-switch a { font-weight: 700; }
.login-card.reg-card { max-width: 480px; gap: 12px; }
.reg-title { font-size: 1.15rem; margin: 0 0 2px; }
.reg-card .fld small.muted { font-size: .78rem; margin-top: -2px; }
.reg-card .kf-error { margin-top: 0; }
.input.bad { border-color: var(--danger); }
.login-page { padding: 24px 16px; }
.sb-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: #f97316; color: #fff; font-size: .72rem; font-weight: 700; box-shadow: 0 2px 6px rgba(249, 115, 22, .35); }
.layout.collapsed .sb-count { position: absolute; top: 4px; right: 10px; margin: 0; min-width: 16px; height: 16px; font-size: .62rem; padding: 0 4px; }
.pending-sec { border: 1px solid #fed7aa; background: linear-gradient(180deg, #fff7ed, var(--surface) 70%); }
.pending-list { display: flex; flex-direction: column; gap: 8px; }
.pending-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.pending-who { display: flex; flex-direction: column; min-width: 0; }
.settings-sec.wide { max-width: none; }
.users-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.users-head h2 { margin: 0; }
.user-filter { flex-wrap: wrap; }
.users-table td { vertical-align: middle; }
.users-table tr.u-inactive td:not(:last-child):not(:nth-last-child(3)) { opacity: .55; }
.users-table tr.u-pending td { background: rgba(249, 115, 22, .05); }
.badge.role-admin { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
[data-theme="dark"] .pending-sec { border-color: rgba(249, 115, 22, .35); background: linear-gradient(180deg, rgba(249, 115, 22, .08), var(--surface) 70%); }
[data-theme="dark"] .badge.role-admin { background: rgba(14, 165, 233, .15); color: #7dd3fc; border-color: rgba(14, 165, 233, .35); }
@media (max-width: 600px) {
  /* Tabel pengguna menjadi kartu agar saklar status & tombol terjangkau tanpa geser */
  .users-table, .users-table tbody { display: block; }
  .users-table thead { display: none; }
  .users-table tr { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 12px; margin-bottom: 10px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .users-table td { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 0; border: 0 !important; opacity: 1 !important; }
  .users-table td[data-label]::before { content: attr(data-label); color: var(--text-3); font-size: .8rem; font-weight: 600; flex: none; }
  .users-table td.u-name { display: block; font-size: 1rem; padding-bottom: 4px; border-bottom: 1px solid var(--border) !important; margin-bottom: 2px; }
  .users-table td.u-actions { justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--border) !important; margin-top: 2px; }
  .users-table td.u-actions:empty { display: none; }
  .users-table tr.u-inactive { opacity: .75; }
  .users-table td .row { justify-content: flex-end; }
  .table-scroll:has(.users-table) { overflow: visible; }
  .pending-item .row { width: 100%; }
  .pending-item .row .btn { flex: 1; }
  .users-head { flex-direction: column; align-items: stretch; }
}

/* ---------- Tombol pengganti tema ---------- */
.theme-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: transparent;
  color: inherit; cursor: pointer; font: inherit; }
.theme-ico { font-size: 1.05rem; line-height: 1; width: 20px; text-align: center; }
.sb-theme { height: 38px; padding: 0 12px; border-radius: 10px; justify-content: flex-start; font-weight: 600; font-size: .88rem; color: #334155; margin-top: auto; }
.sb-theme:hover { background: #e0f2fe; color: #0c4a6e; }
.sb-theme + .sb-foot { margin-top: 0; }
.layout.collapsed .sb-theme { justify-content: center; padding: 0; }
.login-page { position: relative; }
.login-theme { position: absolute; top: 16px; right: 16px; padding: 7px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: .85rem; font-weight: 600; color: var(--text-2); }
.theme-btn.foot { color: var(--text-3); font-size: .82rem; padding: 2px 6px; border-radius: 6px; vertical-align: middle; }
.theme-btn.foot:hover { color: var(--text); background: var(--surface-2); }
.theme-btn.on-color { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; flex: none; }
.theme-btn.on-color:hover { background: rgba(255, 255, 255, .3); }
.shared-head .theme-btn.on-color { margin-left: 4px; }

/* ======================================================================
   MODE GELAP  (html[data-theme="dark"])
   ====================================================================== */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220; --surface: #111a2b; --surface-2: #17223a;
  --border: #24324b; --border-strong: #31415f;
  --text: #e6eaf2; --text-2: #a7b2c7; --text-3: #7d899f;
  --primary: #818cf8; --primary-2: #a5b4fc; --primary-soft: rgba(129, 140, 248, .15);
  --ok: #34d399; --ok-soft: rgba(16, 185, 129, .15);
  --warn: #fbbf24; --warn-soft: rgba(245, 158, 11, .14);
  --danger: #f87171; --danger-soft: rgba(239, 68, 68, .15);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .55);
}
[data-theme="dark"] body { background: radial-gradient(900px 420px at 100% -10%, rgba(124, 58, 237, .16) 0%, transparent 60%),
  radial-gradient(800px 380px at -10% 0%, rgba(14, 165, 233, .12) 0%, transparent 55%), var(--bg); }

/* Sidebar & bilah HP: biru gelap dengan aksen hijau */
[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #0f1b2e 0%, #0c2236 60%, #0a2a3a 100%); border-right-color: #1e3350; color: var(--text); }
[data-theme="dark"] .sidebar .brand { color: #e0f2fe; }
[data-theme="dark"] .sidebar .sb-label { color: #64809f; }
[data-theme="dark"] .sidebar .sb-link, [data-theme="dark"] .sb-theme { color: #b9c7da; }
[data-theme="dark"] .sidebar .sb-link:hover, [data-theme="dark"] .sb-theme:hover { background: rgba(56, 189, 248, .12); color: #e0f2fe; }
[data-theme="dark"] .sidebar .sb-link.active { background: rgba(16, 185, 129, .16); color: #6ee7b7; box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .3); }
[data-theme="dark"] .sidebar .sb-toggle, [data-theme="dark"] .sidebar .sb-logout { color: #8aa0bb; }
[data-theme="dark"] .sidebar .sb-toggle:hover { background: rgba(56, 189, 248, .12); color: #e0f2fe; }
[data-theme="dark"] .sidebar .sb-foot { background: rgba(255, 255, 255, .04); border-color: #1e3350; }
[data-theme="dark"] .sidebar .sb-foot .who small { color: #8aa0bb; }
[data-theme="dark"] .mobile-bar { background: linear-gradient(90deg, #0f1b2e, #0c2236) !important; border-bottom-color: #1e3350 !important; }
[data-theme="dark"] .mobile-bar .brand, [data-theme="dark"] .mobile-bar .icon-btn { color: #e0f2fe; }
[data-theme="dark"] .mobile-bar .icon-btn:hover { background: rgba(56, 189, 248, .12); }
[data-theme="dark"] .layout.collapsed [data-tip]:hover::after { background: #e6eaf2; color: #0b1220; }

/* Judul & teks berwarna dibuat lebih terang */
[data-theme="dark"] .page-head h1 { background: linear-gradient(135deg, #a5b4fc, #c4b5fd 55%, #f0abfc); -webkit-background-clip: text; background-clip: text; }
[data-theme="dark"] .tpl-card h3, [data-theme="dark"] .tpl-sec-head .tpl-sec, [data-theme="dark"] .modal-head h3 { color: #c7d2fe; }
[data-theme="dark"] .recent h3 { color: #c4b5fd; }
[data-theme="dark"] .fill-event { color: #c4b5fd; }

/* Kartu, tabel, badge */
[data-theme="dark"] .card { border-color: var(--border); }
[data-theme="dark"] .btn:not(.primary):not(.success):not(.danger):hover { border-color: #4b5d82; background: var(--surface-2); }
[data-theme="dark"] .btn.danger-ghost { border-color: rgba(248, 113, 113, .4); }
[data-theme="dark"] .data-table th { background: #16213a; color: #a5b4fc; }
[data-theme="dark"] .data-table tbody tr:hover, [data-theme="dark"] .kf-itable tbody tr:hover td { background: #17223a; }
[data-theme="dark"] .badge { border-color: var(--border); }
[data-theme="dark"] .badge.cat { background: rgba(139, 92, 246, .18); color: #c4b5fd; border-color: rgba(139, 92, 246, .35); }
[data-theme="dark"] .badge.type { background: rgba(14, 165, 233, .15); color: #7dd3fc; border-color: rgba(14, 165, 233, .35); }
[data-theme="dark"] .badge.mine { background: rgba(245, 158, 11, .18); color: #fcd34d; border-color: rgba(245, 158, 11, .4); }
[data-theme="dark"] .badge.st-published, [data-theme="dark"] .badge.pay-paid { border-color: rgba(52, 211, 153, .35); }
[data-theme="dark"] .badge.st-draft, [data-theme="dark"] .badge.pay-pending { border-color: rgba(251, 191, 36, .35); }
[data-theme="dark"] .badge.st-closed, [data-theme="dark"] .badge.pay-rejected { border-color: rgba(248, 113, 113, .35); }
[data-theme="dark"] .tpl-card.tpl-mine { background: linear-gradient(180deg, rgba(245, 158, 11, .1) 0%, var(--surface) 45%); }
[data-theme="dark"] .tpl-card:hover { box-shadow: 0 12px 28px rgba(0, 0, 0, .45); }
[data-theme="dark"] .tpl-opt.on { background: rgba(139, 92, 246, .14); }
[data-theme="dark"] .tpl-access { background: rgba(139, 92, 246, .14); border-color: rgba(139, 92, 246, .35); color: #c4b5fd; }
[data-theme="dark"] .empty.soft { background: rgba(255, 255, 255, .03); border-color: var(--border-strong); color: var(--text-2); }
[data-theme="dark"] .recent-list li { border-left-color: rgba(167, 139, 250, .6); }
[data-theme="dark"] .forms-table tr.sel td, [data-theme="dark"] table.grid tbody tr.sel td { background: rgba(16, 185, 129, .1); }
[data-theme="dark"] .slider { background: #3a4866; }
[data-theme="dark"] .sw-label.on { color: var(--ok); }
[data-theme="dark"] .avatar { background: rgba(129, 140, 248, .2); }

/* Dialog, toolbar, editor */
[data-theme="dark"] .modal-back { background: rgba(0, 0, 0, .6); }
[data-theme="dark"] .modal-head { background: linear-gradient(90deg, rgba(129, 140, 248, .1), rgba(236, 72, 153, .07)); }
[data-theme="dark"] .grid-toolbar { background: var(--surface); }
[data-theme="dark"] .ed-top { box-shadow: 0 1px 0 var(--border); }
[data-theme="dark"] .b-card:hover { background: var(--surface-2); }
[data-theme="dark"] .b-card.selected { background: rgba(129, 140, 248, .08); }
[data-theme="dark"] .share-toggle.on { border-color: rgba(52, 211, 153, .35); }
[data-theme="dark"] .notice { color: var(--primary-2); }

/* Tabel respon (grid) */
[data-theme="dark"] table.grid th, [data-theme="dark"] .grid-foot { background: #16213a; }
[data-theme="dark"] table.grid tbody tr:hover td { background: #17223a; }
[data-theme="dark"] .doc-btn.green { background: rgba(16, 185, 129, .18); color: #6ee7b7; }
[data-theme="dark"] .doc-btn.blue { background: rgba(59, 130, 246, .2); color: #93c5fd; }
[data-theme="dark"] .th-ico { background: #3a4866; }
[data-theme="dark"] .star-btn { color: #55617a; }

/* Isian formulir */
[data-theme="dark"] .kf-paragraph a, [data-theme="dark"] .kf-help a, [data-theme="dark"] .fill-desc a, [data-theme="dark"] .kf-itable a { color: #93c5fd; }
[data-theme="dark"] .kf-rating .star { color: #3a4866; }
[data-theme="dark"] .kf-itable.striped th { background: #1c2a45; color: #c7d2fe; }
[data-theme="dark"] .kf-itable.striped th, [data-theme="dark"] .kf-itable.striped td { border-bottom-color: #2a3a58; border-right-color: #2a3a58; }
[data-theme="dark"] .kf-itable.striped tbody tr:nth-child(odd) td { background: #18233b; }
[data-theme="dark"] .kf-itable.striped tbody tr:nth-child(even) td { background: var(--surface); }
[data-theme="dark"] .it-wrap { border-color: #2a3a58; }
[data-theme="dark"] .it-bar { background: #1c2a45; }
[data-theme="dark"] .it-wrap .table-scroll { background: var(--surface); }
[data-theme="dark"] .kf-itable th.sortable:hover { background: #24365a; }
[data-theme="dark"] .it-foot { background: #16213a; }
[data-theme="dark"] .it-cell.merged { background: repeating-linear-gradient(135deg, #17223a, #17223a 6px, #1b2843 6px, #1b2843 12px); }
[data-theme="dark"] body.fill-page { background: linear-gradient(180deg, #151d3a 0, #151d3a 220px, var(--bg) 220px); }
[data-theme="dark"] .fill-banner { background: var(--surface); }
/* Tanda tangan tetap berlatar putih agar goresan hitam terlihat */
[data-theme="dark"] .sig-wrap, [data-theme="dark"] .sig-img, [data-theme="dark"] .cell-sig { background: #fff; }

/* Login & halaman tautan respon */
[data-theme="dark"] .login-page { background: radial-gradient(700px 500px at 0% 0%, rgba(79, 70, 229, .35) 0%, transparent 60%),
  radial-gradient(700px 500px at 100% 100%, rgba(219, 39, 119, .22) 0%, transparent 60%), var(--bg); }
[data-theme="dark"] .shared-logo { background: #fff; }
[data-theme="dark"] .toast { background: linear-gradient(135deg, #1e293b, #334155); }

/* ======================================================================
   HALAMAN MASUK & DAFTAR — foto + warna biru / hijau / putih
   ====================================================================== */
:root { --grad-bg: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%); }
.login-page {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 460px); justify-content: center; align-items: center;
  column-gap: 40px; place-items: initial; min-height: 100vh; padding: 40px 48px; position: relative;
  background: radial-gradient(700px 480px at 0% 0%, #e0f2fe 0%, transparent 65%),
    radial-gradient(700px 480px at 100% 100%, #dcfce7 0%, transparent 65%), #ffffff;
}
/* Panel foto: kartu membulat, tidak memenuhi layar */
.login-hero { position: sticky; top: 40px; align-self: center; justify-self: end; width: 100%; max-width: 620px;
  aspect-ratio: 4 / 3.4; max-height: calc(100vh - 80px); overflow: hidden; border-radius: 24px; background: #0c4a6e;
  box-shadow: 0 24px 60px rgba(14, 116, 144, .22), 0 0 0 6px rgba(255, 255, 255, .7); }
.login-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% center; }
.login-hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14, 165, 233, .18) 0%, rgba(8, 47, 73, .15) 40%, rgba(6, 40, 60, .88) 100%),
    linear-gradient(90deg, rgba(16, 185, 129, .18), transparent 60%); }
.login-hero-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 26px 30px; color: #fff; }
.login-hero-text h2 { font-size: 1.5rem; line-height: 1.25; margin: 10px 0 6px; max-width: 480px; text-shadow: 0 2px 12px rgba(0, 0, 0, .3); }
.login-hero-text p { font-size: .9rem; }
.login-hero-text .brand.big { font-size: 1.2rem; }
.login-points li { font-size: .78rem !important; padding: 4px 10px !important; }
.login-hero-text p { max-width: 500px; color: rgba(255, 255, 255, .9); margin-bottom: 14px; }
.brand.light { color: #fff; padding: 0; }
.login-points { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.login-points li { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3);
  backdrop-filter: blur(4px); font-size: .85rem; font-weight: 600; }
.login-points li::before { content: "✓ "; color: #6ee7b7; }
/* Kartu form */
.login-page > .login-card { justify-self: start; align-self: center; margin: 0; border: 1px solid #e0f2fe;
  box-shadow: 0 20px 50px rgba(14, 116, 144, .14); }
.login-card::before { background: var(--grad-bg); }
.login-page .brand-mark { background: var(--grad-bg) !important; box-shadow: 0 4px 12px rgba(14, 165, 233, .3); }
.login-card .brand { color: #0c4a6e; }
.login-page .btn.primary { background: var(--grad-bg); box-shadow: 0 4px 14px rgba(14, 165, 233, .3); }
.login-page .btn.primary:hover { background: var(--grad-bg); filter: brightness(1.06); }
.login-page .input:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14, 165, 233, .18); }
.login-page a { color: #0284c7; }
.login-page .notice { background: #e0f2fe; color: #075985; }
.login-page .notice.warn { background: var(--warn-soft); color: var(--warn); }
.login-page .reg-title { color: #0c4a6e; }
.login-page .big-icon.ok { background: #dcfce7; color: #059669; }
.login-theme { z-index: 5; }
/* Tablet & HP: foto jadi banner di atas, kartu menumpuk sedikit di atasnya */
@media (max-width: 900px) {
  .login-page { grid-template-columns: minmax(0, 1fr); align-content: start; justify-items: center; padding: 64px 16px 28px; row-gap: 0; }
  .login-hero { position: relative; top: 0; justify-self: center; width: 100%; max-width: 460px; aspect-ratio: auto; height: 170px;
    border-radius: 18px; box-shadow: 0 12px 30px rgba(14, 116, 144, .2); }
  .login-hero img { object-position: 30% 30%; }
  .login-hero-text { padding: 14px 18px 38px; }
  .login-page > .login-card { margin-top: -20px !important; }
  .login-hero-text h2 { font-size: 1.02rem; margin: 0; }
  .login-hero-text p, .login-points, .login-hero-text .brand { display: none; }
  .login-page > .login-card { justify-self: center; margin: -26px 0 0; max-width: 440px; width: calc(100% - 20px); z-index: 1; }
}
[data-theme="dark"] .login-hero { box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 0 6px rgba(255, 255, 255, .05); }
/* Mode gelap */
[data-theme="dark"] .login-page { background: radial-gradient(600px 420px at 100% 0%, rgba(14, 165, 233, .16) 0%, transparent 65%),
  radial-gradient(600px 420px at 100% 100%, rgba(16, 185, 129, .12) 0%, transparent 65%), var(--bg); }
[data-theme="dark"] .login-page > .login-card { border-color: var(--border); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
[data-theme="dark"] .login-card .brand, [data-theme="dark"] .login-page .reg-title { color: #e0f2fe; }
[data-theme="dark"] .login-page a { color: #7dd3fc; }
[data-theme="dark"] .login-page .notice { background: rgba(14, 165, 233, .14); color: #bae6fd; }
[data-theme="dark"] .login-page .big-icon.ok { background: rgba(16, 185, 129, .16); color: #6ee7b7; }
