/* OfficeHub: gaya bersama untuk semua halaman */

@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url("fonts/plus-jakarta-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-display: swap; src: url("fonts/plus-jakarta-sans-500.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url("fonts/plus-jakarta-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url("fonts/plus-jakarta-sans-700.woff2") format("woff2"); }

:root {
  --bg: #f3f3ee;
  --surface: #ffffff;
  --surface-2: #f6f6f1;
  --line: #ebebe4;
  --ink: #1d1d27;
  --muted: #868694;
  --sidebar: #1f1f2b;
  --sidebar-ink: #c9c9d4;

  --lime: #d9f27d;
  --lime-strong: #c4e35a;
  --lime-ink: #1d1d27;
  --lav: #e6e4fb;
  --lav-ink: #5a54c8;
  --peach: #fde4d4;
  --peach-ink: #b8541f;
  --cream: #fff1c9;
  --cream-ink: #8a5a00;
  --rose: #fde2e2;
  --rose-ink: #c22b2b;
  --grey: #ececf1;
  --sky: #ddeffa;
  --sky-ink: #1f6e9c;

  --warn: #f2a516;
  --alarm: #e5484d;
  --ok: #8fc31f;

  --kraft: #d6b07e;
  --kraft-dark: #a07a4b;
  --kraft-tape: #ead1a6;
  --wood: #a8875f;
  --wood-dark: #7a5c3a;

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(29, 29, 39, 0.04), 0 6px 20px rgba(29, 29, 39, 0.05);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lav-ink); outline-offset: 2px; }
a { color: var(--lav-ink); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Kerangka: sidebar + konten ---------- */

.app {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 20px 28px 20px 20px;
}
.sidebar {
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 16px 16px;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  border-radius: var(--radius-lg);
  overflow-y: auto;   /* menu panjang (pohon Dashboard): seluruh sidebar yang digulir */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
.sidebar > * { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 8px; padding: 0 4px; color: #fff; text-decoration: none; }
.brand .logo {
  display: grid; place-items: center;
  flex: none;
  width: 44px; height: 48px;
}
.brand .logo img { display: block; max-width: 100%; max-height: 100%; }
.brand strong { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--sidebar-ink); letter-spacing: 0; white-space: nowrap; }

.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sidebar-ink);
  text-decoration: none;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.side-nav a:hover, .side-nav button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); color: #fff; }
.side-nav a[aria-current="page"] { background: var(--lime); color: var(--lime-ink); font-weight: 600; }
.side-nav button:disabled { opacity: 0.45; cursor: not-allowed; }

.broker { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; font-size: 12px; font-weight: 500; }
.broker .dot { flex: none; width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: #8a8f95; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6); }
.broker .text { overflow-wrap: anywhere; }
.broker[data-state="connected"] .dot { background: #2f9e44; }
.broker[data-state="connecting"] .dot { background: var(--warn); }
.broker[data-state="error"] .dot { background: var(--alarm); }
.broker[data-state="error"] .text { color: var(--rose-ink); font-weight: 600; }

.content { min-width: 0; padding: 4px 0 40px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin: 4px 0 24px; }
.topbar h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.topbar .sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.topbar .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.search {
  display: flex; align-items: center; gap: 8px;
  min-width: 240px;
  padding: 0 16px;
  height: 42px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search:focus-within { outline: 3px solid var(--lav); }

.pill-select {
  height: 42px;
  padding: 0 38px 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231d1d27' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center;
  box-shadow: var(--shadow);
  font-weight: 500;
  appearance: none;
  cursor: pointer;
}

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 24px; align-items: start; }
.rail { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 1280px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; gap: 16px; padding: 12px 16px; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; }
  .search { min-width: 0; flex: 1; }
  /* Menu baru tampil setelah dibungkus panel FAB (assets/auth.js); sebelum itu disembunyikan agar halaman tidak melompat. */
  .sidebar > .side-nav, .sidebar > .side-user { display: none; }
  #screenSelect { flex: 1 1 100%; }   /* Dashboard OTC: selebar baris sejak awal (tidak mendorong tombol setelah terisi) */
}

/* ---------- Komponen dasar ---------- */

.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.section-title h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.section-title .spacer { flex: 1; }

.ico {
  display: inline-grid; place-items: center;
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--lav);
  color: var(--lav-ink);
}
.ico.sq { border-radius: 12px; }
.ico.lime { background: var(--lime); color: var(--lime-ink); }
.ico.lav { background: var(--lav); color: var(--lav-ink); }
.ico.peach { background: var(--peach); color: var(--peach-ink); }
.ico.cream { background: var(--cream); color: var(--cream-ink); }
.ico.rose { background: var(--rose); color: var(--rose-ink); }
.ico.grey { background: var(--grey); color: var(--muted); }
.ico.sky { background: var(--sky); color: var(--sky-ink); }

.pill {
  display: inline-flex; align-items: center;
  flex: none;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--grey);
  color: var(--muted);
}
.pill.lime { background: var(--lime); color: var(--lime-ink); }
.pill.lav { background: var(--lav); color: var(--lav-ink); }
.pill.sky { background: var(--sky); color: var(--sky-ink); }
.pill.peach { background: var(--peach); color: var(--peach-ink); }
.pill.cream { background: var(--cream); color: var(--cream-ink); }
.pill.rose { background: var(--rose); color: var(--rose-ink); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.btn.primary:hover { background: var(--lime-strong); border-color: var(--lime-strong); }
.btn.dark { background: var(--sidebar); border-color: var(--sidebar); color: #fff; }
.btn.dark:hover { background: #33334a; }
.btn.danger { color: var(--rose-ink); border-color: var(--rose); }
.btn.danger:hover { background: var(--rose); }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn.icon { width: 34px; height: 34px; padding: 0; justify-content: center; }
.btn svg.i { width: 16px; height: 16px; }

.notice {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--cream-ink);
  font-weight: 500;
}
.muted-note { margin: 0; color: var(--muted); font-size: 13px; }
.empty {
  padding: 36px 28px;
  max-width: 640px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.empty h2 { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.empty p { margin: 0; color: var(--muted); }

/* ---------- KPI ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 14px; margin: 0 0 28px; }
.kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 18px; }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi strong { display: block; font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: var(--muted); font-weight: 500; }
button.kpi { width: 100%; border: 2px solid transparent; text-align: left; cursor: pointer; }
button.kpi:hover { border-color: var(--line); }
button.kpi[aria-selected="true"] { border-color: var(--ink); }

/* ---------- Panel samping ---------- */

.rail-card { padding: 20px; }
.rail-card .section-title h2 { font-size: 17px; }
.alarm-scope { margin: -8px 0 12px; font-size: 12px; color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
}
.list-item:hover { background: #efefe8; }
.list-item .txt { flex: 1; min-width: 0; }
.list-item .t { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .s { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .ico { width: 38px; height: 38px; }
.list-empty { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-size: 13px; }

details.log summary { cursor: pointer; font-weight: 700; font-size: 15px; list-style: none; display: flex; align-items: center; gap: 10px; }
details.log summary::-webkit-details-marker { display: none; }
details.log summary .pill { margin-left: auto; }
.log-list { margin: 14px 0 0; padding: 0; list-style: none; max-height: 360px; overflow: auto; }
.log-list li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; }
.log-list .meta { color: var(--muted); font-weight: 500; }
.log-list .meta em { font-style: normal; color: var(--cream-ink); }
.log-list pre { margin: 4px 0 0; white-space: pre-wrap; word-break: break-all; font-family: Consolas, "Courier New", monospace; font-size: 11px; color: var(--ink); }

/* ---------- Dialog dan form ---------- */

/* Lebar pop-up seragam (12-11): sm = konfirmasi / ringkas, md = form, lg = semua pop-up rincian, xl = editor besar. */
:root { --dlg-sm: min(560px, calc(100vw - 32px)); --dlg-md: min(720px, calc(100vw - 32px));
  --dlg-lg: min(960px, calc(100vw - 32px)); --dlg-xl: min(1240px, calc(100vw - 32px)); }
dialog {
  width: var(--dlg-md);
  max-height: calc(100vh - 32px);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(29, 29, 39, 0.25);
}
dialog::backdrop { background: rgba(31, 31, 43, 0.45); }
/* Semua pop-up (12-11): kontainer tidak ikut menggulir. Yang menggulir isinya (.dlg-body / .d-body), diberi jarak dari
   tepi atas dan kanan supaya batang gulir tidak memotong sudut membulat; tombol di bawah tetap terlihat. */
dialog[open]:not(.tp-dlg) { display: flex; flex-direction: column; overflow: hidden; }
dialog > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
dialog > .dlg-body, dialog > form > .dlg-body, dialog > .d-body {
  flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent;
}
dialog > .dlg-body:first-child, dialog > form > .dlg-body:first-child { margin: 10px 6px 0 0; padding-top: 14px; padding-right: 20px; }
dialog > .d-body { margin-right: 6px; }
dialog > .dlg-actions, dialog > form > .dlg-actions, dialog > .dlg-error, dialog > form > .dlg-error, dialog > .d-head { flex: none; }
.dlg-body { padding: 24px 26px 8px; }
.dlg-body h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.dlg-body h3 { margin: 26px 0 6px; font-size: 15px; font-weight: 700; }
.dlg-body h4 { margin: 20px 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.dlg-body p.hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; }
.field label, .field legend { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field textarea, .field select {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--lav-ink); background: var(--surface); }
.field input:disabled, .field select:disabled { color: var(--muted); opacity: 0.7; }
.field textarea { min-height: 72px; resize: vertical; }
.field .err { color: var(--rose-ink); font-size: 12px; font-weight: 500; }
.field .help { color: var(--muted); font-size: 12px; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.radios { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.radios label, label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--sidebar); width: 16px; height: 16px; }
.calib { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.calib select { flex: 1; min-width: 160px; }
.profile { padding: 14px; border-radius: var(--radius); background: var(--lav); }
.profile label:first-child { color: var(--lav-ink); }
.preview { grid-column: 1 / -1; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); font-size: 13px; }
.preview .row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.preview .row span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.preview .warnline { color: var(--cream-ink); background: var(--cream); padding: 6px 10px; border-radius: 8px; margin-top: 8px; }
.dlg-error { margin: 12px 26px 0; color: var(--rose-ink); font-weight: 600; }
.dlg-error:empty { display: none; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 26px 24px; }

/* ---------- Master data ---------- */

.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.segmented button { padding: 8px 18px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; cursor: pointer; color: var(--muted); }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-selected="true"] { background: var(--sidebar); color: #fff; }

.table-card { padding: 8px 8px 4px; overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; vertical-align: middle; }
table.data th { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--line); }
table.data td { border-bottom: 1px solid var(--line); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tbody tr:hover td:first-child { border-radius: 12px 0 0 12px; }
table.data tbody tr:hover td:last-child { border-radius: 0 12px 12px 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Urut kolom (assets/common.js): klik judul untuk naik, klik lagi untuk turun. */
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover, table.data th.sortable:focus-visible { color: var(--ink); }
table.data th.sortable::after { content: "\2195"; display: inline-block; margin-left: 4px; opacity: 0; font-size: 11px; }
table.data th.sortable:hover::after { opacity: 0.45; }
table.data th[aria-sort]::after { opacity: 1; color: var(--ink); }
table.data th[aria-sort="ascending"]::after { content: "\25B2"; font-size: 9px; }
table.data th[aria-sort="descending"]::after { content: "\25BC"; font-size: 9px; }
table.data td.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; }
table.data td.actions { white-space: nowrap; text-align: right; }
table.data td.actions .btn + .btn { margin-left: 6px; }

/* Pagination tabel (assets/common.js, tabel bertanda data-page + dialog Ambil dari Historian) */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.pager-info { font-variant-numeric: tabular-nums; }
.pager-size { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.pager-size .pill-select { height: 32px; padding: 0 32px 0 12px; background-position: right 12px center; box-shadow: none;
  border: 1px solid var(--line); font-size: 12px; }
.pager-pages { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager-pages .btn { min-width: 32px; justify-content: center; padding: 5px 8px; font-variant-numeric: tabular-nums; }
.pager-pages .btn[aria-current] { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); font-weight: 700; }
.pager-gap { padding: 0 4px; }
.pager-info + .pager-pages { margin-left: auto; }   /* ukuran tetap (data-page-size): tanpa pilihan baris per halaman */
table.data .empty-row td { color: var(--muted); text-align: center; padding: 36px 12px; }
.cell-main { display: flex; align-items: center; gap: 12px; }
.cell-main .ico { width: 36px; height: 36px; }
.cell-main strong { display: block; font-weight: 600; }
.cell-main small { display: block; color: var(--muted); font-size: 12px; }
.count-btn { padding: 3px 12px; border: 0; border-radius: 999px; background: var(--surface-2); font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.count-btn:hover { background: var(--lime); }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--grey); color: var(--muted); }
.tag.custom { background: var(--lav); color: var(--lav-ink); }
.tag.on { background: var(--lime); color: var(--lime-ink); }
td .status-note { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
td .status-note.warn { color: var(--warn); font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 16px; }
.toolbar .spacer { flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--sidebar);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 10;
}
.toast.error { background: var(--alarm); }

.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; font-size: 14px; }
.kv dt, .kv dd { padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); padding-right: 16px; }
.kv dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kv dd.warn { color: var(--cream-ink); }
.kv dd.alarm { color: var(--rose-ink); }
/* ---------- Dropdown (Chrome/Edge 135+: daftar pilihan bisa diberi gaya; browser lain memakai tampilan bawaan) ---------- */
@supports (appearance: base-select) {
  select:not([size]),
  select:not([size])::picker(select) { appearance: base-select; }
  select:not([size]) { display: inline-flex; align-items: center; gap: 8px; }
  .field select:not([size]) { display: flex; }
  select:not([size])::picker-icon {
    content: "";
    flex: none;
    width: 12px;
    height: 12px;
    margin-left: auto;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23868694' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat center / 12px;
    transition: rotate 0.15s;
  }
  select:not([size]):open::picker-icon { rotate: 180deg; }
  .pill-select::picker-icon { display: none; }

  select:not([size])::picker(select) {
    margin-top: 6px;
    padding: 6px;
    max-height: min(360px, 60vh);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 14px 36px rgba(29, 29, 39, 0.14), 0 2px 6px rgba(29, 29, 39, 0.06);
    opacity: 0;
    translate: 0 -4px;
    transition: opacity 0.14s, translate 0.14s, display 0.14s allow-discrete, overlay 0.14s allow-discrete;
  }
  select:not([size]):open::picker(select) { opacity: 1; translate: 0 0; }
  @starting-style { select:not([size]):open::picker(select) { opacity: 0; translate: 0 -4px; } }

  select:not([size]) option {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
  }
  select:not([size]) option::checkmark { display: none; }
  select:not([size]) option:hover,
  select:not([size]) option:focus-visible { background: var(--surface-2); outline: 0; }
  select:not([size]) option:checked { background: var(--lime); font-weight: 600; }
  select:not([size]) option:disabled { color: var(--muted); cursor: default; }
  /* Judul grup (label optgroup) kecil dan abu-abu; opsi di dalamnya kembali ke gaya normal */
  select:not([size]) optgroup { padding: 4px 0 0; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
  select:not([size]) optgroup option { margin-top: 2px; text-transform: none; letter-spacing: 0; }
  select:not([size]) optgroup + optgroup { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  select::picker(select), select::picker-icon { transition: none; }
}

/* ---------- Dialog pengaturan: dua kolom, tombol di header ---------- */
dialog.settings { width: var(--dlg-xl); }
dialog.settings[open] { display: flex; flex-direction: column; }
dialog.settings form { display: flex; flex-direction: column; min-height: 0; }
.dlg-head { display: flex; align-items: flex-start; gap: 16px; padding: 22px 26px 16px; border-bottom: 1px solid var(--line); }
.dlg-head > div:first-child { flex: 1; min-width: 0; }
.dlg-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.dlg-head p.hint { margin: 0; color: var(--muted); font-size: 13px; }
.dlg-head-actions { display: flex; gap: 10px; flex: none; }
dialog.settings .dlg-error { margin: 12px 26px 0; }
.settings-body { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; padding: 6px 26px 24px; }
.settings-col > h3:first-child { margin-top: 18px; }
.settings-col + .settings-col { padding-left: 32px; margin-left: -1px; border-left: 1px solid var(--line); }
@media (max-width: 900px) {
  .settings-body { grid-template-columns: minmax(0, 1fr); }
  .settings-col + .settings-col { padding-left: 0; border-left: 0; margin-left: 0; margin-top: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
  .dlg-head { flex-wrap: wrap; }
  .dlg-head-actions { width: 100%; justify-content: flex-end; }
}

/* ---------- Login dan pengguna ---------- */
/* Menu yang butuh role tertentu disembunyikan sampai role pengguna diketahui (lihat assets/auth.js). */
html:not([data-role]) [data-min-role] { visibility: hidden; }

.side-user {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: auto;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.side-user .me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--lime-ink);
  font-size: 12px; font-weight: 700;
}
.side-user .who { flex: 1; min-width: 0; }
.side-user .who strong, .side-user .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who strong { font-size: 13px; }
.side-user .who small { font-size: 11px; color: var(--sidebar-ink); }
.side-user .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.user-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 8px;
  border: 0; border-radius: 9px;
  background: rgba(255, 255, 255, 0.08); color: var(--sidebar-ink);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.user-btn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.user-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.side-ver { margin-top: -2px; font-size: 11px; color: var(--sidebar-ink); opacity: 0.75; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .side-user { margin-top: 0; width: 100%; }
}

/* ---------- Menu FAB (layar sempit) ----------
   Di layar lebar .side-menu tidak membentuk kotak sendiri, jadi sidebar tampil seperti biasa. */
.side-menu { display: contents; }
.fab, .fab-scrim { display: none; }
@media (max-width: 900px) {
  .app { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .side-menu {
    display: flex; flex-direction: column; gap: 10px;
    position: fixed; z-index: 60;
    right: 16px; bottom: calc(92px + env(safe-area-inset-bottom));
    width: min(300px, calc(100vw - 32px));
    max-height: calc(100dvh - 124px);
    overflow-y: auto;
    padding: 10px;
    border-radius: var(--radius-lg);
    background: var(--sidebar);
    box-shadow: 0 18px 48px rgba(20, 20, 32, 0.35);
    transform-origin: bottom right;
    opacity: 0; visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  }
  .nav-open .side-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .side-menu .side-nav { gap: 2px; }
  .side-menu .side-nav a, .side-menu .side-nav button { padding: 12px 16px; }
  .fab {
    display: grid; place-items: center;
    position: fixed; z-index: 61;
    right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
    width: 60px; height: 60px;
    border: 0; border-radius: 20px;
    background: var(--lime); color: var(--lime-ink);
    box-shadow: 0 10px 24px rgba(20, 20, 32, 0.28), 0 2px 6px rgba(20, 20, 32, 0.18);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
  }
  .fab:active { transform: scale(0.94); }
  .nav-open .fab { background: var(--sidebar); color: #fff; }
  .fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  .fab-scrim {
    display: block;
    position: fixed; inset: 0; z-index: 59;
    background: rgba(20, 20, 32, 0.38);
    opacity: 0; visibility: hidden;
    transition: opacity 0.18s ease, visibility 0s linear 0.18s;
  }
  .nav-open .fab-scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
}
@media (prefers-reduced-motion: reduce) {
  .side-menu, .fab-scrim, .fab { transition: none; }
}

dialog.pw-dialog { width: var(--dlg-sm); }

.cell-main .avatar { width: 36px; height: 36px; background: var(--lav); color: var(--lav-ink); }
.role-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 640px; margin-bottom: 20px; }
.role-kpis .kpi { flex-direction: row; align-items: center; gap: 14px; }
.role-kpis .ico { width: 40px; height: 40px; }
label.check.field { flex-direction: row; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.login-wrap { width: min(420px, 100%); }
.login-card { overflow: hidden; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow), 0 20px 50px rgba(29, 29, 39, 0.08); }
.login-brand { display: flex; align-items: center; gap: 14px; padding: 26px 28px; background: var(--sidebar); color: #fff; }
.login-brand img { width: 48px; height: auto; }
.login-brand strong { display: block; font-size: 20px; font-weight: 700; }
.login-brand small { display: block; font-size: 12px; color: var(--sidebar-ink); }
.login-form { display: flex; flex-direction: column; gap: 14px; padding: 26px 28px 28px; }
.login-form h1 { margin: 0; font-size: 22px; font-weight: 700; }
.login-form .hint { margin: -8px 0 4px; color: var(--muted); font-size: 13px; }
.login-form .dlg-error { margin: 0; }
.login-submit { justify-content: center; padding: 11px 16px; font-size: 14px; }
.login-ver { margin: 14px 0 0; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.login-ver:empty { display: none; }

/* Checklist aturan password (assets/password-policy.js) */
.pw-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 6px; }
.pw-rules li::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #c9c9c0; box-sizing: border-box; }
.pw-rules li.ok { color: #4f7a0a; }
.pw-rules li.ok::before {
  border: 0;
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
}


/* ---------- Halaman Pengaturan ---------- */
/* Pengaturan: daftar bagian di kiri, satu bagian tampil (settings.html showSection) */
.set-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.set-tabs {
  position: sticky; top: 20px;
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px; border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow);
}
.set-tab {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 6px 12px;
  border-radius: 14px;
  color: var(--ink); text-decoration: none;
}
.set-tab:hover { background: var(--surface-2); }
.set-tab[aria-selected="true"] { background: var(--lime); color: var(--lime-ink); }
.set-tab svg.i { flex: none; width: 16px; height: 16px; }
.set-tab .t { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.25; }
.set-tab b { font-size: 13px; font-weight: 600; }
.set-tab small { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--muted); }
.set-tab small::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #8a8f95; }
.set-tab small[data-tone="ok"]::before { background: #2f9e44; }
.set-tab small[data-tone="wait"]::before { background: var(--warn); }
.set-tab small[data-tone="bad"]::before { background: var(--alarm); }
.set-tab small[data-tone="bad"] { color: var(--rose-ink); }
.set-tab[aria-selected="true"] small { color: var(--lime-ink); }
.set-main > .set-card { margin-bottom: 0; }
.bk-last { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.bk-last li { flex-wrap: wrap; margin: 0; }
.bk-last li > .text { flex: 1 1 0; min-width: 0; }
.bk-last .set-detail { flex-basis: 100%; padding-left: 17px; color: var(--muted); font-weight: 500; overflow-wrap: anywhere; }
.bk-last [data-state="off"] .dot { background: #8a8f95; }
.bk-files td.mono { overflow-wrap: anywhere; }
@media (max-width: 1100px) {   /* layar sempit: deretan tab di atas, bisa digeser */
  .set-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .set-tabs { position: static; flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: thin; }
  .set-tab { flex: none; padding-right: 16px; }
}
.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.set-card { margin: 0 0 24px; padding: 22px 26px 26px; scroll-margin-top: 16px; }
.set-head { display: flex; align-items: flex-start; gap: 14px; }
.set-title { flex: 1; min-width: 0; }
.set-title h2 { margin: 0 0 4px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.set-title p { margin: 0; color: var(--muted); font-size: 13px; max-width: 760px; }
.set-actions { display: flex; flex-wrap: wrap; gap: 10px; flex: none; }
.set-status { flex-wrap: wrap; margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); }
.set-status > .text { flex: 1 1 0; min-width: 0; }   /* tetap di samping titik walau baris detail ikut turun */
.set-status .set-detail { flex-basis: 100%; padding-left: 17px; color: var(--muted); font-weight: 500; overflow-wrap: anywhere; }
.set-status[data-state="off"] .dot, .set-status[data-state="idle"] .dot { background: #8a8f95; }
.set-card .dlg-error:not(:empty) { margin-top: 12px; }
.set-body h3 { margin: 22px 0 10px; font-size: 15px; font-weight: 700; }
.set-body h4 { margin: 18px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.set-body p.hint { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.set-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; }
.set-split > div + div { padding-left: 32px; border-left: 1px solid var(--line); }

/* Menu & tombol per hak (data-perm) sebelum assets/auth.js selesai: hak dari kunjungan terakhir disembunyikan lewat
   <style id="permStyle"> (auth.js); tanpa cache sama sekali, elemen ber-hak tidak terlihat dulu. */
html:not([data-perms]) [data-perm],
html:not([data-perms]) [data-min-role] { visibility: hidden; }

/* ---------- Tombol mode terang/gelap (assets/theme.js) ---------- */

.theme-btn {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); color: var(--sidebar-ink);
  cursor: pointer;
}
.theme-btn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.theme-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .t-sun, [data-theme="dark"] .theme-btn .t-moon { display: none; }
[data-theme="dark"] .theme-btn .t-sun { display: block; }
.login-brand .theme-btn { margin-left: auto; align-self: flex-start; }

/* ---------- Mode gelap ----------
   Token warna diganti; aturan yang memakai warna tetap (bukan token) disesuaikan di bawahnya.
   Hijau lime menjadi hijau gelap dengan teks lime terang, sehingga teks var(--ink) di atasnya tetap terbaca. */

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121218;
  --surface: #1c1c25;
  --surface-2: #24242f;
  --line: #31313e;
  --ink: #ececf2;
  --muted: #9a9aab;
  --sidebar: #0b0b10;
  --sidebar-ink: #c9c9d4;

  --lime: #34461a;
  --lime-strong: #45601f;
  --lime-ink: #dcf28f;
  --lav: #2c2a52;
  --lav-ink: #b2adff;
  --peach: #452a1b;
  --peach-ink: #ffb183;
  --cream: #3b3117;
  --cream-ink: #f2c75f;
  --rose: #47201f;
  --rose-ink: #ff8f8c;
  --grey: #2c2c38;
  --sky: #18334a;
  --sky-ink: #85c8f2;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] .side-nav a[aria-current="page"] { background: var(--lime-strong); }
[data-theme="dark"] .btn.dark, [data-theme="dark"] .segmented button[aria-selected="true"] { background: #3b3b4f; border-color: #3b3b4f; }
[data-theme="dark"] .btn.dark:hover { background: #4a4a62; }
[data-theme="dark"] .toast, [data-theme="dark"] .chart-tip, [data-theme="dark"] .tl-tip, [data-theme="dark"] .gt-tip { background: #34344a; color: #fff; }
[data-theme="dark"] input[type="radio"], [data-theme="dark"] input[type="checkbox"] { accent-color: #8fc31f; }
[data-theme="dark"] .sensor.selected { outline-color: var(--lav-ink); }
[data-theme="dark"] dialog { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line); }
[data-theme="dark"] dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
[data-theme="dark"] .login-card { box-shadow: var(--shadow), 0 0 0 1px var(--line); }

[data-theme="dark"] .line-block { background: #0d0d12; }
[data-theme="dark"] .list-item:hover { background: var(--surface-2); }
[data-theme="dark"] .num.warn { color: #f2b84b; }
[data-theme="dark"] .sensor.no-sensor { box-shadow: var(--shadow), inset 0 0 0 1.5px #3a3a48; }
[data-theme="dark"] .scene .full-line { border-top-color: #5a5a6c; }
[data-theme="dark"] .dropzone:hover, [data-theme="dark"] .dropzone.over { background: #1f2a12; }
[data-theme="dark"] .preview-table td.pos, [data-theme="dark"] .pw-rules li.ok { color: #a8d65a; }
[data-theme="dark"] .pw-rules li::before { border-color: #5a5a6c; }
[data-theme="dark"] .ign-result.ok { background: #1f2a12; color: #b9e27a; }
[data-theme="dark"] .ign-result td { border-top-color: rgba(255, 255, 255, 0.08); }

[data-theme="dark"] .count-btn:hover { color: var(--lime-ink); }

/* Dropdown dengan kotak cari (assets/select-search.js) */
.ss-pop { position: fixed; z-index: 1000; display: flex; flex-direction: column; min-height: 120px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 16px 40px rgba(29, 29, 39, 0.22); }
.ss-search { width: 100%; margin-bottom: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13px; }
.ss-search:focus { outline: 0; border-color: var(--lav-ink); }
.ss-list { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.ss-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ss-item { padding: 7px 10px; border-radius: 8px; font-size: 13px; line-height: 1.35; cursor: pointer; overflow-wrap: anywhere; }
.ss-item.active { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.ss-item.selected { font-weight: 700; }
.ss-item.selected::before { content: "✓ "; color: var(--lime-ink); }
.ss-item.disabled { color: var(--muted); opacity: .55; cursor: default; }
.ss-empty { padding: 10px; font-size: 13px; color: var(--muted); }
select.ss-open { border-color: var(--lav-ink); }

/* Menu samping berkelompok (assets/nav.js) */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 10px; }
.side-nav .nav-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px 6px 16px; border-radius: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(201, 201, 212, .62); }
.side-nav .nav-head:hover { background: transparent; color: #fff; }
.side-nav .nav-head .i { width: 13px; height: 13px; transition: transform .15s ease; }
.nav-head[aria-expanded="true"] .i { transform: rotate(90deg); }
.nav-items { display: flex; flex-direction: column; gap: 4px; }
.nav-items > a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Daftar dengan kotak cari: pilihan bertingkat (data-depth) */
.ss-item.ss-sub { position: relative; }
.ss-item.ss-sub::after { content: ""; position: absolute; left: var(--ss-indent, 12px); top: 50%; width: 8px; border-top: 1px solid var(--muted); opacity: .45; }

/* Application Setting > Role & Akses: matriks hak x role */
.rl-wrap { overflow: auto; max-height: calc(100vh - 220px); }
.rl-matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.rl-matrix th, .rl-matrix td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.rl-matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); vertical-align: top; }
.rl-matrix .rl-perm { position: sticky; left: 0; z-index: 1; min-width: 260px; max-width: 360px; background: var(--surface); font-weight: 500; }
.rl-matrix thead .rl-perm { z-index: 3; }
.rl-role { min-width: 130px; text-align: center !important; }
.rl-role strong { display: block; font-size: 13px; }
.rl-role small { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 500; color: var(--muted); }
.rl-dirty { display: none; margin: 4px auto 0; font-size: 10.5px; }
.rl-role.dirty .rl-dirty { display: inline-flex; }
.rl-acts { display: inline-flex; gap: 4px; }
.rl-lock { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); }
.rl-lock .i { width: 12px; height: 12px; }
.rl-copy { margin-top: 6px; }
.rl-group th { padding-top: 16px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); position: static; }
.rl-cell { text-align: center !important; }
.rl-mark { font-weight: 700; color: var(--muted); }
.rl-mark.on { color: var(--lime-ink); }
.rl-tag { margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.rl-note { margin-top: 10px; }

/* ---------- Pengaturan > Log audit ---------- */
.au-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 14px; }
.au-filters .search { flex: 1 1 240px; box-shadow: none; background: var(--surface-2); }
.au-filters select, .au-filters input[type="date"] { height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.au-filters label.check { font-size: 13px; }
.au-wrap { overflow-x: auto; }
table.au td { vertical-align: top; }
table.au tbody tr[data-i] { cursor: pointer; }
table.au td.t { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.au td small { display: block; color: var(--muted); font-size: 12px; }
table.au td.c { max-width: 340px; }
table.au td.c span { display: block; overflow-wrap: anywhere; }
table.au td.c .more { color: var(--muted); font-size: 12px; }
table.au td.ip { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.au-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-top: 12px;
  color: var(--muted); font-size: 12.5px; }
.au-pages { display: flex; gap: 8px; align-items: center; color: var(--ink); }
dialog.au-dlg { width: var(--dlg-lg); }
.au-kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 14px; margin: 12px 0; font-size: 13px; }
.au-kv span { color: var(--muted); }
.au-kv b { overflow-wrap: anywhere; }
.au-diff { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 13px; }
.au-diff th, .au-diff td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.au-diff th { color: var(--muted); font-size: 12px; font-weight: 600; }
.au-diff td.old { color: var(--muted); text-decoration: line-through; }
.au-notes { margin: 12px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
/* Layar sempit: satu catatan = satu blok bertumpuk (tanpa geser ke samping). */
@media (max-width: 720px) {
  table.au thead { display: none; }
  table.au, table.au tbody, table.au tr, table.au td { display: block; width: 100%; }
  table.au tr[data-i] { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  table.au td { padding: 0; border: 0; max-width: none; }
  table.au td.t { grid-column: 1; }
  table.au td.r { grid-column: 2; grid-row: 1; }
  table.au td.u, table.au td.a, table.au td.o, table.au td.c, table.au td.ip { grid-column: 1 / -1; }
  table.au td.t small, table.au td.u small { display: inline; margin-left: 6px; }
}

/* ---------- Perangkat superadmin (login + Pengaturan) ---------- */
.dv-code { display: flex; justify-content: center; gap: 10px; margin: 6px 0 4px; font-size: 34px; font-weight: 700; letter-spacing: 4px;
  font-variant-numeric: tabular-nums; }
.dv-code span { padding: 10px 14px; border-radius: 14px; background: var(--surface-2); }
.dv-center { text-align: center; }
.dv-wait { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2);
  font-size: 13px; line-height: 1.5; }
.dv-wait[hidden] { display: none; }
.dv-wait .spin { flex: none; width: 16px; height: 16px; margin-top: 2px; border: 2px solid var(--line); border-top-color: var(--ink);
  border-radius: 50%; animation: dv-spin 1s linear infinite; }
@keyframes dv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dv-wait .spin { animation: none; } }
.dv-who { margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); font-size: 13px; }
.dv-who b { display: block; font-size: 14px; }
.login-submit.dv-back { margin-top: 8px; }
.dv-req { margin: 0 0 18px; padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--warn) 14%, transparent); }
.dv-req[hidden] { display: none; }
.dv-req h3 { margin: 0 0 8px; font-size: 14px; }
.dv-req-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 6px 0;
  font-size: 13px; }
.dv-req-row small, table.dv td small { display: block; color: var(--muted); font-size: 12px; }
.dv-req-row .code { font-size: 20px; font-weight: 700; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.dv-req-row .btns { display: flex; gap: 8px; }
table.dv td { vertical-align: top; }
.dv-note { margin-top: 12px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
/* Pengaturan > Kinerja server */
table.pf td small { display: block; color: var(--muted); font-size: 12px; }
table.pf td.pf-slow { color: var(--rose-ink); font-weight: 700; }
table.pf td.num { white-space: nowrap; }
#perf .kv { grid-template-columns: minmax(0, 1fr) auto; }
#perf .kv dd { white-space: nowrap; }
#perf .kv dt small { display: block; font-size: 12px; overflow-wrap: anywhere; }
.pf-notes { margin: 16px 0 0; }
dialog.dv-dlg { width: var(--dlg-sm); }
@media (max-width: 720px) {
  .dv-req-row { grid-template-columns: minmax(0, 1fr) auto; }
  .dv-req-row .btns { grid-column: 1 / -1; }
}

/* ---------- Layar sentuh (tablet / ponsel) ----------
   Target sentuh minimal 40-44 px (sarung tangan, layar di line). Hanya untuk pointer kasar; tampilan mouse tetap. */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; }
  .btn.icon { width: 44px; height: 44px; }
  .user-btn { min-height: 40px; }
  .theme-btn { width: 40px; height: 40px; }
  .side-nav .nav-head { min-height: 40px; }
  .live { height: 40px; }
  .segmented button { min-height: 40px; }
  label.check, .radios label { min-height: 40px; }
  .rl-matrix input[type="checkbox"] { width: 28px; height: 28px; }   /* matriks padat: 28 px (bukan 40) */
  .mat-chip { min-height: 40px; }
  a.line-sku, a.empty-chip, .todo-chip { display: inline-flex; align-items: center; min-height: 40px; }
  .md-tab { height: 44px; }
  .count-btn { min-width: 40px; min-height: 40px; }
  details > summary { box-sizing: border-box; min-height: 40px; padding-block: 10px; }
  /* Tautan di dalam teks: area sentuh diperluas tanpa mengubah tampilan. */
}

/* ---------- Micro animation (16-11, rasa "lebih terasa"; logika di assets/motion.js) ----------
   Satu set token untuk semua halaman. Hanya opacity / transform / warna / ukuran isi, supaya ringan di TV dan PC lama.
   Dimatikan oleh Windows "kurangi gerakan" atau ?gerak=0 (kelas z-still di <html>). */
:root { --m-fast: 160ms; --m-base: 280ms; --m-slow: 900ms; --m-ease: cubic-bezier(.2, .7, .2, 1);
        --m-ease-bar: cubic-bezier(.34, 1.4, .64, 1); --m-shift: 14px; --m-pop: 1.06;
        --m-flash: color-mix(in srgb, var(--sky-ink) 27%, var(--surface)); }
@property --pct { syntax: "<number>"; inherits: true; initial-value: 0; }

/* A. sorot nilai berubah: z-flash dipasang sesaat, lalu latar pudar kembali */
.w, .m-row, .kpi, .chip, .ring, .z-flash-text { transition: background-color var(--m-slow) var(--m-ease), box-shadow var(--m-slow) var(--m-ease); }
.w { transition: background-color var(--m-slow) var(--m-ease), box-shadow 0.25s, transform 0.25s; }
.z-flash { background-color: var(--m-flash) !important; transition: none !important; }
.ring.z-flash { background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--m-flash) 0) !important; }
.z-flash-text { border-radius: 6px; }
.z-flash.z-flash-text { box-shadow: 0 0 0 4px var(--m-flash); }
.z-flash .w-val, .z-flash .m-v, .kpi.z-flash strong, .chip.z-flash .num, .z-flash.z-flash-text { animation: z-pop var(--m-base) var(--m-ease) 1; }
@keyframes z-pop { 40% { transform: scale(var(--m-pop)); } }
.w-val, .kpi strong, .chip .num { transform-origin: left center; }
.m-v { transform-origin: right center; }

/* B. status berganti: warna bertransisi + satu denyut */
.pill, .w-state, .lamp, .m-state { transition: background-color var(--m-base) var(--m-ease), color var(--m-base) var(--m-ease); }
.z-ping { animation: z-ping var(--m-slow) var(--m-ease) 1; }
@keyframes z-ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lamp, var(--ring-color, currentColor)) 55%, transparent); }
  100% { box-shadow: 0 0 0 var(--m-shift) transparent; }
}

/* C. umpan balik aksi */
.btn { transition: transform var(--m-fast) var(--m-ease), background-color var(--m-fast), border-color var(--m-fast), opacity var(--m-fast); }
.btn:active:not(:disabled) { transform: scale(0.95); }
.btn.z-busy::after { content: ""; flex: none; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: z-spin 0.7s linear infinite; }
@keyframes z-spin { to { transform: rotate(360deg); } }
.toast:not([hidden]) { animation: z-toast var(--m-base) var(--m-ease) 1; }
@keyframes z-toast { from { opacity: 0; transform: translate(-50%, var(--m-shift)); } }
.toast.ok { display: flex; align-items: center; gap: 8px; }
.toast.ok[hidden] { display: none; }
.toast.ok::before { content: ""; flex: none; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: z-check var(--m-slow) var(--m-ease) 1; }
@keyframes z-check { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* D. level & progress bergerak ke nilai baru */
.tank i { transition: height var(--m-slow) var(--m-ease-bar), width var(--m-slow) var(--m-ease-bar); }
.scene .stack { transition: height var(--m-slow) var(--m-ease-bar); }
.ring { transition: --pct var(--m-slow) var(--m-ease-bar), background-color var(--m-slow) var(--m-ease), box-shadow var(--m-slow) var(--m-ease); }
.c-bar b, .c-meter i, .fd-bar i, .st-bar i { transition: width var(--m-slow) var(--m-ease-bar); }
[data-flash-box], [data-flash-key] { transition: background-color var(--m-slow) var(--m-ease), box-shadow var(--m-slow) var(--m-ease); }
.cw-conn .dot.ok { --lamp: var(--ok); } .cw-conn .dot.warn { --lamp: var(--warn); } .cw-conn .dot.alarm { --lamp: var(--alarm); }

/* E. muncul seragam: dialog, toast (di atas), panel tab */
dialog[open]:not(.tp-dlg) { animation: z-dlg var(--m-base) var(--m-ease) 1; }
dialog[open]:not(.tp-dlg)::backdrop { animation: z-fade var(--m-base) ease 1; }
dialog.tp-dlg[open] { animation-duration: var(--m-base); }
.z-in { animation: z-in var(--m-base) var(--m-ease) 1; }
@keyframes z-dlg { from { opacity: 0; transform: translateY(var(--m-shift)) scale(0.98); } }
@keyframes z-fade { from { opacity: 0; } }
@keyframes z-in { from { opacity: 0; transform: translateY(calc(var(--m-shift) / 2)); } }

/* F. grafik / Gantt tergambar dari kiri saat dibuka (zMotion.drawOnce), tidak saat refresh */
.z-draw { animation: z-draw calc(var(--m-slow) * 1.3) var(--m-ease) 1; }
@keyframes z-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Tanpa gerak: Windows "kurangi gerakan", ?gerak=0 */
:root.z-still .z-flash, :root.z-still .z-ping, :root.z-still .z-draw, :root.z-still .z-in, :root.z-still .z-busy::after,
:root.z-still .toast, :root.z-still .toast.ok::before, :root.z-still dialog[open], :root.z-still dialog[open]::backdrop,
:root.z-still .z-flash .w-val, :root.z-still .z-flash .m-v { animation: none !important; }
:root.z-still .tank i, :root.z-still .scene .stack, :root.z-still .ring, :root.z-still .c-bar b, :root.z-still .c-meter i,
:root.z-still .fd-bar i, :root.z-still .st-bar i, :root.z-still [data-flash-box], :root.z-still [data-flash-key], :root.z-still .btn, :root.z-still .pill, :root.z-still .w-state, :root.z-still .lamp, :root.z-still .m-state,
:root.z-still .w, :root.z-still .m-row, :root.z-still .kpi, :root.z-still .chip { transition: none !important; }
:root.z-still .btn:active { transform: none; }

/* ---------- Starter kit: tabel data umum + import CSV ---------- */
table.data td small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; font-weight: 500; }
table.data td.row-actions { white-space: nowrap; text-align: right; }
table.data td.row-actions .btn + .btn { margin-left: 6px; }
.card-title { margin: 4px 8px 12px; font-size: 15px; }
.imp-errors { margin: 10px 0 0; padding-left: 18px; max-height: 180px; overflow: auto; font-size: 12.5px; color: var(--rose-ink); }
.imp-errors:empty { display: none; }

/* ---------- Modul 0: PIN, pengguna (hak tambahan, import), Role & Akses (cara masuk), Aturan ---------- */
.pin-input { letter-spacing: .5em; font-variant-numeric: tabular-nums; font-size: 18px !important; text-align: center; }
.u-extra { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.u-extra .rl-tag { margin-left: 0; white-space: normal; }
table.u-table td .status-note { max-width: 230px; white-space: normal; }
table.u-table td .cell-main strong { white-space: nowrap; }
.u-login { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.u-login svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.role-kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 900px; }
dialog.u-dialog { width: var(--dlg-lg); }
.u-sec { grid-column: 1 / -1; margin: 10px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.u-sec h3 { margin: 0 0 4px; font-size: 14px; }
.u-sec > p { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.u-perms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; }
.u-perms label.check { font-size: 13px; font-weight: 500; }
.u-perms label.check.from-role { color: var(--muted); }
.u-perms label.check small { margin-left: 2px; font-size: 11px; color: var(--muted); }
.u-pin { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.u-pin code { font-size: 16px; font-weight: 700; letter-spacing: .2em; }
.dlg-actions .left { margin-right: auto; }
.imp-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 16px 0 4px; }
.imp-sum > div { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.imp-sum strong { display: block; font-size: 20px; }
.imp-sum span { font-size: 12px; color: var(--muted); }
.imp-sum .ok { background: var(--lime); }
.imp-sum .ok strong, .imp-sum .ok span { color: var(--lime-ink); }
.imp-sum .bad { background: var(--rose); }
.imp-sum .bad strong, .imp-sum .bad span { color: var(--rose-ink); }
.imp-warn { display: flex; gap: 12px; margin: 16px 0 6px; padding: 12px 14px; border-radius: 12px; background: var(--cream);
  color: var(--cream-ink); font-size: 13px; line-height: 1.5; }
.imp-warn svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rl-cell select.rl-login, .rl-cell input.rl-idle { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.rl-cell input.rl-idle { width: 76px; text-align: center; }
.rl-group-note { margin-left: 6px; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.at-group { padding: 14px 0; border-top: 1px solid var(--line); }
.at-group:first-child { margin-top: 18px; padding-top: 0; border-top: 0; }
.at-group h3 { margin: 0 0 10px; font-size: 14px; }
.at-group .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .at-group .fields { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .u-perms { grid-template-columns: 1fr; }
  .role-kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Modul 1: Master data (master.html) ---------- */
.md-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 18px; }
.md-bar .spacer { flex: 1; }
.md-bar .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.md-tabs button { display: inline-flex; align-items: center; gap: 8px; }
.md-tabs .n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
  font-size: 11px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.md-tabs button[aria-selected="true"] .n { background: rgba(255, 255, 255, .18); color: #fff; }
.md-table .by { display: block; font-size: 11.5px; color: var(--muted); }
.md-table tr.off td:not(.actions) { color: var(--muted); }
.md-label { display: inline-block; padding: 2px 8px; border-radius: 8px; background: var(--surface-2); font-size: 12px; white-space: nowrap; }
.md-count { font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--line); }
.md-count:hover { border-bottom-color: currentColor; }
.md-zero { color: var(--muted); }
dialog.md-dialog { width: var(--dlg-sm); }
dialog.md-dialog.wide { width: var(--dlg-md); }
.md-preview { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); font-size: 13px; }
.md-preview span { color: var(--muted); }
.md-preview b { font-weight: 600; overflow-wrap: anywhere; }
.md-note { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.imp-warn.md-inline { grid-column: 1 / -1; margin: 4px 0 0; }
.home-card { max-width: 760px; }
.home-card h2 { margin: 0 0 6px; font-size: 19px; }
.home-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.md-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.md-tabs button { flex: none; }
@media (max-width: 720px) {   /* HP: tab bisa digeser di tempat, kotak cari selebar layar */
  .md-bar .spacer { display: none; }
  .md-bar .controls { width: 100%; }
  .md-bar .search { flex: 1 1 100%; width: auto; }
}
.md-table td:first-child strong { overflow-wrap: anywhere; }   /* nama panjang tanpa spasi tidak mendorong kolom lain */
.md-table td:first-child { min-width: 160px; }
.md-table td.when { white-space: nowrap; }

/* ---------- Modul 2: Email (email.html) ---------- */
.em-fields { margin-top: 18px; }
.em-secret { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 42px; }
.em-test { display: flex; flex-wrap: wrap; gap: 10px; }
.em-test input { flex: 1 1 240px; max-width: 360px; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit; }
.em-result { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.em-result svg.i { flex: none; width: 16px; height: 16px; color: #2f9e44; }
.em-result.bad { color: var(--rose-ink); }
.em-result.bad svg.i { color: var(--alarm); }
.em-filter { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 12px; }
.em-table td small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.em-table td.when { white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.em-table td.actions { white-space: nowrap; text-align: right; }
.em-table td:nth-child(2) { min-width: 200px; }
.em-table td:nth-child(2) strong { font-weight: 600; }
.em-table td .status-note { max-width: 220px; white-space: normal; }
.tag.warn { background: var(--cream); color: var(--cream-ink); }
.tag.bad { background: var(--rose); color: var(--rose-ink); }
dialog.em-dialog { width: var(--dlg-md); }
.em-pick { display: grid; gap: 6px; margin: 6px 0 12px; }
.em-pick label { font-size: 13px; font-weight: 600; }
.em-pick .help { color: var(--muted); font-size: 12px; }
.em-kv { margin: 6px 0 14px; font-size: 13px; }
.em-kv:empty { display: none; }
.em-kv dd { text-align: left; font-weight: 500; }
.em-frame { display: block; width: 100%; height: 540px; border: 1px solid var(--line); border-radius: 12px; background: #f3f3ee; }

/* ---------- Modul 3: Lampiran (assets/lampiran.js; daftar di detail permintaan; Cadangan lampiran di Pengaturan) ---------- */
.lp-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--line);
  border-radius: 16px; background: var(--surface-2); text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.lp-drop:hover, .lp-drop:focus-visible { border-color: var(--ink); outline: none; }
.lp-drop.over { border-color: var(--ink); background: var(--surface); }
.lp-drop svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lp-drop b { color: var(--ink); font-size: 14px; }
.lp-drop .lp-pick { margin-top: 6px; }
.lp-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 12px 2px 8px; font-size: 12.5px; color: var(--muted); }
.lp-meta b { color: var(--ink); }
.lp-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.lp-list:empty { margin: 0; }
.lp-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.lp-item.bad { border-color: var(--rose); background: var(--rose); }
.lp-ext { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--surface-2);
  font-size: 10.5px; font-weight: 800; letter-spacing: .03em; color: var(--muted); }
.lp-ext.pdf { background: #fde2e2; color: #a12a2a; }
.lp-ext.doc { background: #ddeffa; color: #1f5a85; }
.lp-ext.img { background: #e8f5d0; color: #3d5c12; }
[data-theme="dark"] .lp-ext.pdf { background: #4a2226; color: #f3b3b3; }
[data-theme="dark"] .lp-ext.doc { background: #1d3446; color: #a9d4f5; }
[data-theme="dark"] .lp-ext.img { background: #2c3d17; color: #cfe8a1; }
.lp-name { min-width: 0; }
.lp-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.lp-name small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.lp-item.bad .lp-name small { color: var(--rose-ink); font-weight: 600; }
.lp-bar { height: 5px; margin-top: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.lp-bar span { display: block; height: 100%; border-radius: 999px; background: var(--ink); transition: width .2s ease; }
.z-still .lp-bar span { transition: none; }
.lp-ok { display: inline-flex; align-items: center; gap: 4px; color: #2f7d3a; font-weight: 600; }
[data-theme="dark"] .lp-ok { color: #7bc98a; }
.bk-lamp { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.bk-lamp h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.bk-lamp .hint { margin: 0 0 12px; }
.bk-lamp-fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-top: 14px; }
.lp-kv { margin: 16px 0 14px; }
@media (max-width: 720px) { .bk-lamp-fields { grid-template-columns: 1fr; } }

/* ---------- Modul 4: Permintaan (permintaan-baru.html, permintaan-saya.html, detail.html) ---------- */
.rq-card { padding: 22px 26px 24px; margin-bottom: 20px; }
.rq-card h2 { margin: 0 0 4px; font-size: 17px; }
.rq-card > .sub2 { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.rq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.rq-grid .wide { grid-column: 1 / -1; }
.rq-grid .field input, .rq-grid .field select { width: 100%; }
.rq-note { background: var(--surface-2); box-shadow: none; }
.rq-note p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.rq-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.rq-actions .rq-error { flex: 1 1 100%; margin: 0 0 4px; text-align: right; }
.rq-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rq-head h1 { margin: 0; }
.pill.warn { background: var(--cream); color: var(--cream-ink); }
.pill.ok { background: var(--lime); color: var(--lime-ink); }
.pill.bad { background: var(--rose); color: var(--rose-ink); }
.rq-detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.rq-kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); margin: 10px 0 0; font-size: 13.5px; }
.rq-kv dt, .rq-kv dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rq-kv dt { color: var(--muted); }
.rq-kv dd { font-weight: 600; overflow-wrap: anywhere; }
.tl { list-style: none; margin: 14px 0 0; padding: 0; }
.tl li { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; padding: 0 0 18px; }
.tl li::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--lime-ink); font-size: 12px; font-weight: 800; }
.tl .current .dot { background: var(--cream); color: var(--cream-ink); box-shadow: 0 0 0 4px rgba(245, 197, 24, .25); }
.tl .rejected .dot { background: var(--rose); color: var(--rose-ink); }
.tl .t b { display: block; font-size: 14px; }
.tl .t small { color: var(--muted); font-size: 12.5px; }
.tl .when { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.lp-item .lp-dl { text-decoration: none; }
.rq-list td small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.rq-list td.when { white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.rq-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
dialog.rq-dialog { width: var(--dlg-sm); }
dialog.rq-dialog textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
@media (max-width: 900px) { .rq-detail, .rq-grid { grid-template-columns: 1fr; } .tl li { grid-template-columns: 22px minmax(0, 1fr); } .tl .when { grid-column: 2; } .rq-kv { grid-template-columns: 1fr; } .rq-kv dt { border-bottom: 0; padding-bottom: 0; } }
a.btn { text-decoration: none; }

/* ---------- Modul 5: Persetujuan ---------- */
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); font-size: 11px; font-weight: 700; text-align: center; }
.side-nav a[aria-current="page"] .nav-badge { background: var(--sidebar); color: #fff; }
.ib-list { display: flex; flex-direction: column; gap: 14px; }
.ib-card { padding: 18px 22px; }
.ib-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ib-top b { font-size: 16px; }
.ib-top .when { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.ib-by { margin: 4px 0 12px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ib-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; margin: 0 0 14px; font-size: 13px; }
.ib-rows div { display: flex; gap: 8px; }
.ib-rows dt { color: var(--muted); min-width: 96px; }
.ib-rows dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ib-act { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 720px) { .ib-rows { grid-template-columns: 1fr; } }

/* Revisi Line Manager: LM otomatis di form, kolom Work Level + LM di Pengguna */
.lm-none { color: var(--muted); font-size: 12.5px; }
.tag.warn { background: var(--cream); color: var(--cream-ink); }
.rq-kv dd small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.lm-block { display: flex; gap: 12px; margin-bottom: 20px; padding: 14px 18px; border-radius: 14px; background: var(--rose); color: var(--rose-ink); font-size: 13.5px; line-height: 1.5; }
.lm-block[hidden] { display: none; }
.lm-block svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Jenis permintaan FTE (segmented), total jam overtime, detail pekerjaan */
.jn-seg { display: flex; gap: 8px; padding: 4px; border-radius: 999px; background: var(--surface-2); max-width: 520px; }
.jn-seg button { flex: 1; padding: 10px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.jn-seg button.on { background: var(--sidebar); color: #fff; }
[data-theme="dark"] .jn-seg button.on { background: #3b3b4f; }
.jn-total { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 13.5px; }
.jn-total:has(b) { background: var(--lime); color: var(--lime-ink); }
.jn-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--lav); color: var(--lav-ink); }
.jn-pill.ot { background: var(--sky); color: var(--sky-ink); }
.help-split { display: flex; justify-content: space-between; gap: 12px; }
.rq-grid textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; resize: vertical; box-sizing: border-box; }
.rq-kv dd { white-space: pre-line; }
[hidden] { display: none !important; }

/* Pilihan jenis form (tautan antar halaman Buat permintaan) */
.form-tabs { display: flex; margin: 0 0 16px; max-width: 520px; }
.form-tabs a { flex: 1; padding: 10px 16px; border-radius: 999px; color: var(--muted); font-weight: 700; text-align: center; text-decoration: none; }
.form-tabs a.on { background: var(--sidebar); color: #fff; }
[data-theme="dark"] .form-tabs a.on { background: #3b3b4f; }

/* PK: kategori, nilai Rp, pilihan CC / CBT, peringatan lampiran, pil kategori */
.pk-seg { display: flex; gap: 8px; padding: 4px; border-radius: 999px; background: var(--surface-2); max-width: 520px; }
.pk-seg button { flex: 1; padding: 10px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.pk-seg button.on { background: var(--sidebar); color: #fff; }
[data-theme="dark"] .pk-seg button.on { background: #3b3b4f; }
.pk-seg button.on.day { background: var(--cream); color: var(--cream-ink); }
.pk-seg button.on.now { background: var(--rose); color: var(--rose-ink); }
.pk-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.pk-pill.day { background: var(--cream); color: var(--cream-ink); }
.pk-pill.now { background: var(--rose); color: var(--rose-ink); }
.pk-rp { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pk-rp span { padding: 0 0 0 14px; color: var(--muted); font-weight: 700; }
.pk-rp input { border: 0 !important; background: transparent !important; box-shadow: none !important; }
.pk-pick { position: absolute; left: 0; right: 0; z-index: 5; margin-top: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.pk-pick div { padding: 9px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pk-pick div:last-child { border: 0; }
.pk-pick div:hover { background: var(--lime); color: var(--lime-ink); }
.pk-warn { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--cream); color: var(--cream-ink); font-size: 13.5px; line-height: 1.5; margin-bottom: 12px; }
.pk-warn svg { flex: none; width: 20px; height: 20px; }
.form-tabs { max-width: 720px; }

/* Progres bundel PDF PK (detail) */
.bd-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 14px 0 0; }
.bd-bar div { height: 100%; width: 10%; background: var(--lime); transition: width .25s; }

/* Daftar permintaan semua jenis (modul 10) */
.ls-tabs { display: flex; gap: 8px; padding: 4px; border-radius: 999px; background: var(--surface-2); max-width: 420px; margin-bottom: 14px; }
.ls-tabs a { flex: 1; padding: 9px 14px; border-radius: 999px; text-align: center; font-weight: 700; color: var(--muted); text-decoration: none; font-size: 14px; }
.ls-tabs a.on { background: var(--sidebar); color: #fff; }
[data-theme="dark"] .ls-tabs a.on { background: #3b3b4f; }
.ls-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ls-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; }
.ls-chip b { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.ls-chip.on { background: var(--lime); border-color: transparent; color: var(--lime-ink); }
.ls-chip.on b { background: rgba(0,0,0,.12); color: inherit; }
.ls-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.ls-bar input[type=date] { padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; }
.ls-note { margin: 10px 4px 0; font-size: 12.5px; color: var(--muted); }
.jn-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.jn-tag.fte { background: var(--sky); color: var(--sky-ink); }
.jn-tag.meal { background: var(--lime); color: var(--lime-ink); }
.jn-tag.pk { background: var(--lav); color: var(--lav-ink); }
.rq-list .pk-pill { margin-left: 6px; }

/* Profil saya (modul 12) */
.who-link { color: inherit; text-decoration: none; } .who-link strong { border-bottom: 1px dashed rgba(255,255,255,.5); } .who-link:hover strong { border-bottom-style: solid; }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .pf-grid { grid-template-columns: 1fr; } }
.pf-id { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.pf-ava { width: 56px; height: 56px; border-radius: 18px; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.pf-id h2 { margin: 0; font-size: 19px; } .pf-id small { color: var(--muted); }
.pf-kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); font-size: 13.5px; margin: 0 0 6px; }
.pf-kv dt, .pf-kv dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pf-kv dt { color: var(--muted); } .pf-kv dd { font-weight: 600; overflow-wrap: anywhere; } .pf-kv dd small { display: block; color: var(--muted); font-weight: 500; }
.pf-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 6px; } @media (max-width: 700px) { .pf-edit { grid-template-columns: 1fr; } }
.pf-edit input { width: 100%; box-sizing: border-box; }
.pf-lock { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 600; }
.pf-perm h3 { margin: 14px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.pf-chip.ok { background: var(--lime); color: var(--lime-ink); } .pf-chip.tr { background: var(--lav); color: var(--lav-ink); }
.pf-note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

/* Persiapan awal (modul 13) */
.pa-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 18px 22px; }
.pa-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; background: conic-gradient(var(--lime) var(--p), var(--surface-2) 0); position: relative; }
.pa-ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.pa-ring span { position: relative; z-index: 1; }
.pa-sum h2 { margin: 0 0 2px; font-size: 18px; } .pa-sum p { margin: 0; color: var(--muted); font-size: 13.5px; }
.pa-grp { margin: 22px 4px 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pa-list { display: flex; flex-direction: column; gap: 10px; }
.pa-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; }
.pa-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface-2); color: var(--muted); }
.pa-item.ok .pa-dot { background: var(--lime); color: var(--lime-ink); } .pa-item.todo .pa-dot { background: var(--cream); color: var(--cream-ink); } .pa-item.bad .pa-dot { background: var(--rose); color: var(--rose-ink); }
.pa-item > div > b { display: block; font-size: 14.5px; } .pa-item small b { display: inline; font-size: inherit; } .pa-item small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.45; }
.pa-act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) { .pa-item { grid-template-columns: 30px minmax(0, 1fr); } .pa-act { grid-column: 2; justify-content: flex-start; } }
.pa-tpl { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.hm-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 16px; }
.hm-card .pa-ring { width: 52px; height: 52px; font-size: 13px; } .hm-card .pa-ring::after { inset: 6px; }
.hm-card b { font-size: 15px; } .hm-card small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.hm-card .spacer { flex: 1; }
