/* Helpdesk RSUD Datu Beru — gaya panel (sesuai mockup yang disepakati) */
:root {
	--bg: #ECEBE7;
	--shell: #F7F6F3;
	--surface: #FFFFFF;
	--sunken: #F5F4F1;
	--line: #E4E2DD;
	--line-soft: #EFEEEA;
	--line-strong: #D6D4CE;
	--ink: #1C1C1A;
	--muted: #5E5D58;
	--primary: #141413;
	--accent: #0F6E5A;
	--accent-soft: #EEF7F3;
	--ok-bg: #E5F4EA;    --ok-fg: #14532D;
	--warn-bg: #FDF3E7;  --warn-fg: #7A3306;  --warn-line: #F1D6B3;
	--err-bg: #FDECEA;   --err-fg: #912018;   --err-line: #F3C4BE;
	--info-bg: #E6EEF9;  --info-fg: #163E73;
	--radius-sm: 10px;
	--radius: 12px;
	--radius-lg: 16px;
	--radius-xl: 20px;
	--font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
	--mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ico { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--primary); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.code { font-family: var(--mono); font-size: 12px; }
.text-danger { color: var(--err-fg) !important; }
.text-warn { color: var(--warn-fg); font-weight: 600; }
.truncate { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inline { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }

/* ---------- Shell ---------- */
.app { background: var(--shell); }
.shell { width: 100%; min-height: 100vh; background: var(--shell); display: flex; }
.sidebar { width: 264px; flex: none; padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; border-right: 1px solid var(--line); background: var(--shell); position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; transition: width .18s ease, padding .18s ease; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; border-radius: var(--radius); background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: none; }
.brand-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.brand-text strong { font-size: 15px; }
.brand-text small { color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section { color: var(--muted); font-size: 12px; padding: 12px 10px 4px; }
.nav-section:first-child { padding-top: 0; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border-radius: var(--radius-sm); text-decoration: none; border: 1px solid transparent; }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link:hover { background: #EFEEEA; color: var(--ink); }
.nav-link.is-active { background: var(--surface); border-color: var(--line); font-weight: 600; }
.nav-badge { background: #B42318; color: #fff; border-radius: 6px; font-size: 12px; padding: 1px 7px; font-weight: 600; }
.me { margin-top: auto; display: flex; align-items: center; gap: 6px; }
.me-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-decoration: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text strong, .me-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--muted); font-size: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #DCEFE8; color: #0B4F41; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; object-fit: cover; }
img.avatar { display: block; background: var(--line-soft); }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; }
.avatar-xl { width: 96px; height: 96px; font-size: 28px; }
.photo-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; align-self: flex-start; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.input-file { font: inherit; max-width: 100%; }
.label { font-weight: 600; }
/* Tombol khusus ponsel: spesifisitas dinaikkan agar tidak tertimpa .icon-btn */
.icon-btn.sidebar-close, .scrim, .topbar-me { display: none; }

/* Sidebar terlipat (desktop) */
.sb-collapsed .sidebar { width: 76px; padding-left: 12px; padding-right: 12px; }
.sb-collapsed .brand-text, .sb-collapsed .nav-label, .sb-collapsed .me-text, .sb-collapsed .nav-badge { display: none; }
.sb-collapsed .nav-section { padding: 10px 0 4px; }
.sb-collapsed .nav-section span { display: block; height: 1px; background: var(--line); font-size: 0; margin: 0 8px; }
.sb-collapsed .nav-link { justify-content: center; padding: 0; }
.sb-collapsed .me { flex-direction: column; }
.sb-collapsed .me-card { padding: 6px; justify-content: center; border-color: transparent; background: transparent; }

.main { flex: 1; min-width: 0; padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 44px; }
.crumbs { flex: 1; color: var(--muted); }
.crumbs span { color: var(--ink); font-weight: 500; }
.flash:empty { display: none; }
.flash { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Panel & layout ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.narrow { max-width: 720px; width: 100%; }
.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.col-main { flex: 2 1 520px; min-width: 0; }
.col-side { flex: 1 1 280px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.page-head > div { display: flex; flex-direction: column; gap: 6px; max-width: 72ch; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.empty { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; color: var(--muted); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.kpi strong { font-size: 20px; }

.meta-list { margin: 0; display: flex; flex-direction: column; }
.meta-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #2B2B29; color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--sunken); color: var(--ink); }
.btn-sm { min-height: 36px; padding: 0 10px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn.is-disabled { opacity: .5; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--line-strong); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-weight: 600; }
.input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font: inherit; color: var(--ink); }
textarea.input { padding: 10px 12px; min-height: 96px; resize: vertical; }
select.input { padding-right: 32px; }
.input:disabled { background: var(--sunken); color: var(--muted); }
.input-num { width: 76px; flex: none; }
.input-group { display: flex; gap: 8px; }
.hint { color: var(--muted); font-size: 12px; }
.field-error { color: var(--err-fg); font-size: 13px; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .input { width: auto; flex: 1 1 160px; min-height: 40px; }
.filters .btn { min-height: 40px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .input { width: 200px; }

/* ---------- Alerts & badges ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid transparent; }
.alert .ico { margin-top: 2px; }
.alert-success { background: var(--ok-bg); color: var(--ok-fg); }
.alert-error { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-line); }
.alert-warning { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
.alert-info { background: var(--info-bg); color: var(--info-fg); }
.alert a { color: inherit; font-weight: 600; }
.secret { display: flex; align-items: center; gap: 10px; margin: 8px 0 6px; }
.secret code { font-family: var(--mono); font-size: 18px; letter-spacing: .06em; background: var(--surface); padding: 6px 10px; border-radius: 8px; color: var(--ink); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--line-soft); color: #3D3D3A; vertical-align: middle; }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge-muted { background: var(--sunken); color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td { padding: 12px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line-soft); }
.table thead th { border-top: 0; color: var(--muted); font-size: 12px; font-weight: 600; background: #FAFAF8; }
.table-compact th, .table-compact td { padding: 8px 12px; }
.table tr.is-inactive td { color: var(--muted); }
.person { display: flex; align-items: center; gap: 10px; }
.row-actions { white-space: nowrap; text-align: right; }
.matrix .center { text-align: center; }
.matrix .group-row th { background: var(--sunken); font-size: 13px; }
.matrix .perm-name { font-weight: 500; min-width: 260px; }
.matrix-check { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.sticky-actions { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0; border-top: 1px solid var(--line-soft); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pagination-info { color: var(--muted); font-size: 13px; }
pre.json { margin: 0; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; font-family: var(--mono); font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }

/* ---------- Tree ---------- */
.tree { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 1px dashed var(--line-strong); margin-left: 15px; }
.tree-root > .tree { border-left: 0; padding-left: 0; margin-left: 0; }
.tree-item { margin: 0; }
.tree-row { display: flex; align-items: center; gap: 8px; padding: 10px 8px; border-radius: var(--radius-sm); }
.tree-row:hover { background: #FAFAF8; }
.tree-toggle, .tree-toggle-spacer { width: 30px; height: 30px; flex: none; }
.tree-toggle { display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; color: var(--ink); }
.tree-toggle .ico { transition: transform .15s ease; transform: rotate(90deg); }
.tree-toggle[aria-expanded="false"] .ico { transform: rotate(0deg); }
.tree-item.is-collapsed > .tree { display: none; }
.tree-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tree-meta { color: var(--muted); font-size: 12px; }
.tree-actions { display: flex; flex-wrap: wrap; gap: 2px; justify-content: flex-end; }
.tree-item.is-inactive > .tree-row .tree-title strong { color: var(--muted); text-decoration: line-through; }
.level-row { display: flex; gap: 8px; align-items: center; }
.level-meta { display: flex; justify-content: space-between; align-items: center; margin: -8px 0 4px; padding: 0 2px; }
.add-level { border-top: 1px solid var(--line-soft); padding-top: 14px; }

/* ---------- Auth ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }

/* ---------- Bottom nav (ponsel) ---------- */
.bottom-nav { display: none; }

@media (max-width: 960px) {
	.sidebar, .sb-collapsed .sidebar { position: fixed; inset: 0 auto 0 0; height: auto; width: min(300px, 86vw); padding-left: 16px; padding-right: 16px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; padding-top: calc(20px + env(safe-area-inset-top, 0px)); padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; box-shadow: 0 0 0 1px var(--line); }
	.sidebar.is-open { transform: translateX(0); }
	.icon-btn.sidebar-close { display: inline-flex; }
	.scrim:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(20, 20, 19, .4); z-index: 40; }
	.topbar-me { display: block; text-decoration: none; }
	/* Saat drawer terbuka, label selalu tampil walau preferensi desktop terlipat */
	.sb-collapsed .brand-text, .sb-collapsed .nav-label, .sb-collapsed .me-text { display: flex; }
	.sb-collapsed .nav-label { display: block; }
	.sb-collapsed .nav-link { justify-content: flex-start; padding: 0 10px; }
	.sb-collapsed .nav-section span { height: auto; background: none; font-size: 12px; margin: 0; }
	.sb-collapsed .me { flex-direction: row; }
	.sb-collapsed .me-card { padding: 10px; justify-content: flex-start; border-color: var(--line); background: var(--surface); }
	.main { padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(88px + env(safe-area-inset-bottom, 0px)); }
	.panel { padding: 16px; border-radius: 14px; }
	.grid-2 { grid-template-columns: minmax(0, 1fr); }
	h1 { font-size: 20px; }
	.bottom-nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
	.bottom-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border: 0; background: none; font: inherit; font-size: 11px; color: var(--muted); text-decoration: none; border-radius: var(--radius-sm); cursor: pointer; }
	.bottom-link.is-active { color: var(--ink); font-weight: 700; background: var(--sunken); }
	.tree { padding-left: 12px; margin-left: 8px; }
	.tree-row { flex-wrap: wrap; }
	.tree-actions { width: 100%; justify-content: flex-start; padding-left: 38px; }
	.tree-actions .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.inline-form { width: 100%; }
	.inline-form .input { flex: 1; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}

/* ---------- Landing publik ---------- */
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 15px; border-radius: 14px; }
.landing { background: var(--shell); }
.l-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.l-header { border-bottom: 1px solid var(--line); background: var(--shell); padding-top: env(safe-area-inset-top, 0px); }
.l-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; }
.l-header .brand { text-decoration: none; }
.l-hero { padding: 56px 0 48px; }
.l-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.l-hero-copy { display: flex; flex-direction: column; gap: 20px; }
.l-hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.02em; max-width: 14ch; }
.l-lead { font-size: 17px; line-height: 1.6; color: #3D3D3A; max-width: 56ch; }
.l-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.l-emergency { max-width: 56ch; }

.l-stub { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 22px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.l-stub::before, .l-stub::after { content: ""; position: absolute; top: 74px; width: 22px; height: 22px; border-radius: 50%; background: var(--shell); border: 1px solid var(--line); }
.l-stub::before { left: -12px; clip-path: inset(0 0 0 50%); }
.l-stub::after { right: -12px; clip-path: inset(0 50% 0 0); }
.l-stub-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; border-bottom: 1.5px dashed var(--line-strong); }
.l-stub-code { font-size: 24px; letter-spacing: .06em; font-weight: 700; }
.l-stub-title { font-weight: 700; font-size: 16px; }
.l-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.l-steps li { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; position: relative; }
.l-steps li:not(:last-child)::after { content: ""; position: absolute; left: 9px; top: 26px; bottom: -10px; width: 2px; background: var(--accent); }
.l-steps .dot { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); box-shadow: inset 0 0 0 5px var(--accent), inset 0 0 0 7px #fff; }
.l-steps .is-current .dot { background: #fff; box-shadow: inset 0 0 0 2px var(--accent); }
.l-steps .is-current span:not(.dot) { font-weight: 700; }
.l-steps small { color: var(--muted); font-size: 12px; }

.l-section { padding: 48px 0; border-top: 1px solid var(--line); }
.l-section-alt { background: var(--surface); }
.l-section h2 { font-size: 22px; margin-bottom: 20px; }
.l-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.l-type { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.l-type span { color: var(--muted); }
.l-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; counter-reset: flow; }
.l-flow li { counter-increment: flow; display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 2px solid var(--primary); }
.l-flow li::before { content: counter(flow); font-weight: 700; font-size: 13px; color: var(--accent); }
.l-flow span { color: #3D3D3A; line-height: 1.6; }
.l-privacy { display: flex; gap: 10px; align-items: flex-start; margin-top: 28px; color: #3D3D3A; max-width: 64ch; }
.l-privacy .ico { color: var(--accent); margin-top: 2px; }
.l-footer { border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.l-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 20px; padding-bottom: 20px; color: var(--muted); }

@media (max-width: 860px) {
	.l-hero { padding: 32px 0; }
	.l-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.l-flow { grid-template-columns: minmax(0, 1fr); gap: 18px; }
	.l-section { padding: 36px 0; }
	.l-actions .btn { flex: 1 1 100%; }
	.l-header .btn { min-height: 40px; padding: 0 12px; }
}

/* ---------- Halaman error ---------- */
.error-code { font-size: 64px; font-weight: 700; line-height: 1; color: var(--line-strong); }

/* ---------- Master kategori ---------- */
.cat-list { display: flex; flex-direction: column; gap: 12px; }
.cat-group { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cat-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; }
.cat-row.is-sub { border-top: 1px solid var(--line-soft); padding-left: 34px; background: #FCFCFA; }
.cat-row.is-inactive .tree-title strong { color: var(--muted); text-decoration: line-through; }
.cat-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

/* ---------- Halaman publik ---------- */
.p-nav { display: flex; gap: 4px; }
.p-nav a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; }
.p-nav a[aria-current="page"] { background: var(--surface); border: 1px solid var(--line); }
.p-main { padding: 32px 0 56px; }
.p-wrap { max-width: 760px; }
.p-head { display: flex; flex-direction: column; gap: 6px; }
.p-head h1 { font-size: clamp(24px, 4vw, 32px); }
.back-link { font-weight: 600; text-decoration: none; color: var(--accent); }
.p-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cat-tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; min-height: 132px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; color: var(--ink); }
.cat-tile:hover { border-color: var(--accent); color: var(--ink); }
.cat-tile strong { font-size: 16px; }
.cat-icon { width: 42px; height: 42px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 8px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.choice-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.choice input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.choice:has(input:checked) { border: 1.5px solid var(--accent); background: var(--accent-soft); font-weight: 600; }
.photo-pick { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 72px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: #FAFAF8; cursor: pointer; font-weight: 600; padding: 12px; text-align: center; }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.identity-fields[hidden] { display: none; }
.p-success { align-items: flex-start; }
.success-mark { width: 52px; height: 52px; border-radius: 50%; background: var(--ok-bg); color: var(--ok-fg); display: flex; align-items: center; justify-content: center; }
.ticket-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); }
.ticket-code strong { font-size: 26px; letter-spacing: .06em; }
.lacak-form { display: flex; gap: 8px; }
.lacak-form .input { flex: 1; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; min-height: 48px; }
.lacak-form .btn { min-height: 48px; }
.ticket-title { font-size: 20px; }
.status-pill { align-self: flex-start; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; background: var(--line-soft); }
.status-diproses { background: var(--info-bg); color: var(--info-fg); }
.status-ditanggapi { background: #F1ECFD; color: #4A2F9E; }
.status-selesai, .status-ditutup { background: var(--ok-bg); color: var(--ok-fg); }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.stepper li { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.stepper li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: var(--line); }
.stepper li.is-done:not(.is-current)::after { background: var(--accent); }
.stepper .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.stepper .is-done .dot { background: var(--accent); border-color: var(--accent); }
.step-text { display: flex; flex-direction: column; gap: 1px; padding-top: 2px; }
.stepper .is-current .step-text span { font-weight: 700; }
.step-text small { color: var(--muted); font-size: 12px; }
.stepper li:not(.is-done) .step-text span { color: var(--muted); }
.msg { border-top: 1px solid var(--line-soft); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
h3 { font-size: 15px; margin: 0; }
@media (max-width: 860px) {
	.p-main { padding: 20px 0 40px; }
	.p-card { padding: 16px; }
	.choice-grid-2 { grid-template-columns: minmax(0, 1fr); }
	.brand-text small { display: none; }
}

/* ================= M3: tiket ================= */
.badge-err { background: var(--err-bg); color: var(--err-fg); }
.badge-info { background: var(--info-bg); color: var(--info-fg); }
.btn-danger-soft { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-line); }
.icon-btn-sm { width: 32px; height: 32px; border-radius: 8px; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.seg { display: inline-flex; gap: 2px; background: var(--line-soft); border-radius: var(--radius); padding: 3px; flex: none; }
.seg-btn { min-height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; font: inherit; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg-btn.is-on, .seg-btn:has(input:checked) { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.seg-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(270px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 4px; }
.k-col { background: var(--sunken); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 160px; transition: box-shadow .12s ease, background .12s ease; }
.k-col.is-drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.k-col.is-blocked { opacity: .55; }
.k-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 4px 0; }
.k-count { font-size: 12px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.k-cards { display: flex; flex-direction: column; gap: 10px; }
.k-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 16px 0; }
.kanban-tabs { display: none; }
.t-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 6px; cursor: grab; }
.t-card:hover { border-color: var(--line-strong); }
.t-card.is-dragging { opacity: .45; }
.t-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.t-code { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.t-title { font-weight: 700; line-height: 1.35; text-decoration: none; color: var(--ink); }
.t-title:hover { color: var(--accent); }
.t-meta { color: var(--muted); font-size: 12px; }
.t-foot { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line-soft); padding-top: 8px; font-size: 12px; color: var(--muted); }
.t-who { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-stat { display: inline-flex; align-items: center; gap: 3px; }
.status-baru { background: var(--line-soft); color: #3D3D3A; }

.modal { border: 0; border-radius: 18px; padding: 22px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow-y: auto; color: var(--ink); }
.modal::backdrop { background: rgba(20, 20, 19, .45); }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sm-flow { display: flex; align-items: center; gap: 8px; }

.action-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.action { flex: 0 1 auto; }
.action[open] { flex: 1 1 100%; order: 10; }
.action summary { list-style: none; }
.action summary::-webkit-details-marker { display: none; }
.action[open] summary { box-shadow: 0 0 0 2px var(--accent); }
.action-body { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #FCFCFA; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--line-soft); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 5px; background: #8A8984; position: relative; }
.tl-dot-soft { background: var(--line-strong); }
.tl-dot-msg { background: var(--accent); }
.tl-dot-note { background: #B58A06; }
.tl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tl-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.bubble { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.bubble-reporter { background: var(--sunken); }
.bubble-note { background: #FFF8E6; border-color: #F1DFA8; }
.bubble-tag { font-size: 12px; font-weight: 600; color: var(--accent); }
.bubble-note .bubble-tag { color: #7A5A06; }
.bubble-reporter .bubble-tag { color: #3D3D3A; }
.file-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; text-decoration: none; font-size: 12px; max-width: 100%; background: var(--surface); }
.file-chip img { width: 88px; height: 88px; object-fit: cover; border-radius: 6px; display: block; }
.file-chip span { padding-right: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.composer { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.composer textarea { border: 0; padding: 4px; min-height: 72px; }
.composer textarea:focus-visible { outline: none; }
.composer:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.composer-foot { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.item-free, .item-row { display: flex; gap: 8px; }
.item-free[hidden] { display: none; }
.stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 32px; line-height: 1; color: var(--line-strong); cursor: pointer; padding: 2px; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #E8A317; }
.stars input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 6px; }
.rating-big { color: #E8A317; font-size: 20px; letter-spacing: 2px; }
.q-item { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.q-item:hover { border-color: var(--line-strong); color: var(--ink); }
.q-item.is-on { border: 1.5px solid var(--primary); background: #FAFAF8; }
.q-age { margin-left: auto; font-size: 12px; font-weight: 700; }
.dispatch-list { max-height: calc(100vh - 120px); overflow-y: auto; }
.dispatch-more { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.p-box { border-top: 1px solid var(--line-soft); padding-top: 16px; }

@media (max-width: 960px) {
	.kanban { grid-template-columns: repeat(4, 86%); scroll-snap-type: x mandatory; }
	.k-col { scroll-snap-align: start; }
	.kanban-tabs { display: flex; gap: 6px; overflow-x: auto; }
	.kanban-tab { flex: none; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 13px; background: var(--surface); }
	.kanban-tab span { color: var(--muted); }
	.t-card { cursor: default; }
	.dispatch-list { max-height: none; }
}

/* ================= M4: notifikasi & loading ================= */
.is-loading { cursor: progress; opacity: .8; pointer-events: none; }
.is-loading .ico { display: none; }
.btn:disabled, .icon-btn:disabled { cursor: not-allowed; }
.btn:disabled:not(.is-loading) { opacity: .55; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: hd-spin .7s linear infinite; flex: none; display: inline-block; }
.btn-sm .spinner { width: 14px; height: 14px; }
@keyframes hd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.6s; } }

.bell { position: relative; text-decoration: none; }
.bell-count { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #B42318; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; }
.bell-count[hidden] { display: none; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { border-top: 1px solid var(--line-soft); }
.notif-list a { display: flex; gap: 12px; padding: 12px 6px; text-decoration: none; color: var(--ink); border-radius: var(--radius-sm); }
.notif-list a:hover { background: #FAFAF8; color: var(--ink); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; flex: none; background: transparent; }
.notif-list .is-unread .notif-dot { background: var(--accent); }
.notif-list .is-unread strong { font-weight: 700; }
.notif-list strong { font-weight: 500; }
.notif-body { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.outbox { display: flex; flex-direction: column; gap: 10px; }
.outbox-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.outbox-text { margin: 0; white-space: pre-wrap; font-family: var(--font); font-size: 13px; background: var(--sunken); border-radius: var(--radius-sm); padding: 10px; overflow-wrap: anywhere; }
.settings-group { border: 0; border-top: 1px solid var(--line-soft); margin: 0; padding: 16px 0 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.settings-group legend { font-weight: 700; font-size: 15px; padding: 0 8px 0 0; }
.check-hint { margin-top: -6px; padding-left: 26px; }
.bottom-nav .bottom-link span { white-space: nowrap; }
