/* ==========================================================================
   PTSP DIGITAL KUA WANGI-WANGI SELATAN — sistem desain panel petugas
   Palet: hijau tua, biru tegas, aksen emas. Padat data, kontras tinggi.
   ========================================================================== */
:root {
  --green-900: #06322b;
  --green-800: #074437;
  --green-700: #0b6b53;
  --green-600: #0f8a6a;
  --green-100: #e4f5ee;
  --blue-800: #0a3566;
  --blue-700: #0f4c8a;
  --blue-600: #1667b8;
  --blue-100: #e8f1fb;
  --gold-600: #b78e1c;
  --gold-500: #c9a227;
  --gold-400: #e6c65c;
  --gold-100: #fbf2d5;
  --ink: #0d2231;
  --ink-2: #33475a;
  --muted: #64798a;
  --line: #dce6e2;
  --line-soft: #eaf0ed;
  --surface: #f3f7f5;
  --card: #ffffff;
  --danger: #b3261e;
  --danger-100: #fdecea;
  --warn: #a35a00;
  --warn-100: #fdf1df;
  --ok: #0b6b53;
  --ok-100: #e4f5ee;
  --info: #0f4c8a;
  --info-100: #e8f1fb;
  --proses: #4c3f9e;
  --proses-100: #eeecfb;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(13, 34, 49, .06), 0 1px 3px rgba(13, 34, 49, .05);
  --shadow: 0 4px 14px rgba(13, 34, 49, .07), 0 1px 3px rgba(13, 34, 49, .05);
  --shadow-lg: 0 18px 40px rgba(6, 50, 43, .16);
  --sidebar-w: 262px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Lora', Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
}
a { color: var(--blue-700); text-decoration: none; }
a:hover { color: var(--blue-800); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; color: var(--ink); }
h1 { font-size: 1.55rem; letter-spacing: -.015em; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: var(--gold-100); }

.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.big { font-size: 1.5rem; }
.truncate { max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-r { text-align: right; }
.mt { margin-top: 16px; }
.gap { gap: 10px; }
.gap-sm { gap: 6px; }
.gap-lg { gap: 20px; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }
.hide-sm { }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { width: 18px; height: 18px; flex: none; }
.link-strong { font-weight: 700; color: var(--blue-800); }
.link-strong:hover { text-decoration: underline; }
.danger-text { color: var(--danger) !important; }
.inline-form { display: inline; }

/* ------------------------------------------------------------------ layout */
.app-body { background: var(--surface); }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: linear-gradient(178deg, #06322b 0%, #08324f 48%, #0a3566 100%);
  color: #e8f2ee;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(230, 198, 92, .22);
  z-index: 40;
}
.sidebar::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 18% 8%, rgba(230, 198, 92, .18), transparent 45%),
    radial-gradient(circle at 90% 92%, rgba(15, 138, 106, .3), transparent 50%);
  pointer-events: none;
}
.brand { position: relative; padding: 18px 16px 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.brand-link { display: flex; align-items: center; gap: 11px; color: #fff; }
.brand-link:hover { color: #fff; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 11px; object-fit: contain;
  /* alas putih: logo berlatar transparan/gelap tetap terbaca di atas sidebar navy */
  background: #fff; padding: 3px; border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: .98rem; letter-spacing: .01em; }
.brand-text small { font-size: .7rem; color: rgba(232, 242, 238, .68); letter-spacing: .02em; }
.sidebar-close { display: none; }
.nav { position: relative; overflow-y: auto; padding: 12px 10px 18px; flex: 1; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 3px; }
.nav-group { margin-bottom: 14px; }
.nav-title { font-size: .64rem; letter-spacing: .13em; text-transform: uppercase; color: rgba(230, 198, 92, .88); padding: 6px 10px; font-weight: 700; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px; color: rgba(232, 242, 238, .86);
  font-size: .86rem; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s, transform .15s;
}
.nav-link .ico { width: 17px; height: 17px; opacity: .82; }
.nav-link:hover { background: rgba(255, 255, 255, .09); color: #fff; transform: translateX(2px); }
.nav-link.active { background: linear-gradient(90deg, rgba(230, 198, 92, .22), rgba(255, 255, 255, .06)); color: #fff; box-shadow: inset 3px 0 0 var(--gold-400); }
.nav-link.active .ico { opacity: 1; color: var(--gold-400); }
.sidebar-foot { padding: 12px 16px 16px; font-size: .68rem; color: rgba(232, 242, 238, .6); border-top: 1px solid rgba(255, 255, 255, .1); display: flex; align-items: center; gap: 7px; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .22); }
.sidebar-overlay { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px; background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 25;
}
.page-head { flex: 1; min-width: 0; }
.page-head h1 { font-size: 1.22rem; margin: 0; }
.page-sub { margin: 1px 0 0; font-size: .78rem; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.icon-btn:hover { background: var(--green-100); border-color: #bfe3d5; color: var(--green-800); }
.menu-btn { display: none; }
.bell-dot {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--danger); color: #fff; border-radius: 9px; font-size: .62rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.user-chip:hover { border-color: #bfe3d5; color: var(--ink); }
.chip-img, .chip-ini { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.chip-ini { background: linear-gradient(135deg, var(--green-700), var(--blue-800)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; }
.chip-text { display: flex; flex-direction: column; line-height: 1.15; }
.chip-text strong { font-size: .8rem; }
.chip-text small { font-size: .66rem; color: var(--muted); }
.content { padding: 22px; flex: 1; }
.app-foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 22px 22px; font-size: .72rem; color: var(--muted);
}

/* ------------------------------------------------------------------- kartu */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.03rem; }
.card-head h2 .ico { color: var(--green-700); }
.card-head .chip-muted, .chip-muted {
  font-size: .7rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 999px;
}
.card + .card, .card + .grid-dash, .grid-dash + .card { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-2.gap-lg { gap: 20px; }
.grid-dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.grid-dash-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.form-card { max-width: 100%; }

/* statistik */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s;
}
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c9dfd6; color: var(--ink); }
.stat-ico { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.stat-ico .ico { width: 20px; height: 20px; }
.tone-green { background: var(--green-100); color: var(--green-800); }
.tone-blue { background: var(--blue-100); color: var(--blue-800); }
.tone-gold { background: var(--gold-100); color: var(--gold-600); }
.tone-proses { background: var(--proses-100); color: var(--proses); }
.tone-warn { background: var(--warn-100); color: var(--warn); }
.tone-danger { background: var(--danger-100); color: var(--danger); }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.5rem; line-height: 1.15; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.stat-sub { font-size: .72rem; color: var(--muted); }

/* tombol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .86rem; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .12s;
  white-space: nowrap; line-height: 1.2;
}
.btn .ico { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--green-700), var(--blue-700)); color: #fff; box-shadow: 0 2px 8px rgba(11, 107, 83, .24); }
.btn-primary:hover { color: #fff; box-shadow: 0 6px 18px rgba(11, 107, 83, .3); background: linear-gradient(135deg, #0d7a60, #12599e); }
.btn-gold { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: #3b2c05; box-shadow: 0 2px 8px rgba(201, 162, 39, .28); }
.btn-gold:hover { color: #2f2304; background: linear-gradient(135deg, #eecd6c, #d3ab2c); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface); border-color: #c5d8d0; color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #9c1f18; color: #fff; }
.btn-outline-light { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.btn-sm { padding: 7px 11px; font-size: .8rem; border-radius: 9px; }
.btn-xs { padding: 5px 8px; font-size: .74rem; border-radius: 8px; gap: 4px; }
.btn-lg { padding: 12px 22px; font-size: .95rem; border-radius: 12px; }
.btn-block { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* badge */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: .7rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.badge-ok { background: var(--ok-100); color: var(--green-800); }
.badge-info { background: var(--info-100); color: var(--blue-800); }
.badge-warn { background: var(--warn-100); color: var(--warn); }
.badge-danger { background: var(--danger-100); color: var(--danger); }
.badge-muted { background: #eef2f0; color: var(--muted); }
.badge-gold { background: var(--gold-100); color: var(--gold-600); }
.badge-proses { background: var(--proses-100); color: var(--proses); }

/* flash */
.flash {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid; margin-bottom: 16px; font-size: .87rem; font-weight: 500;
}
.flash-ok { background: var(--ok-100); border-color: #bfe3d5; color: var(--green-800); }
.flash-danger { background: var(--danger-100); border-color: #f3c9c5; color: var(--danger); }
.flash-info { background: var(--info-100); border-color: #c8dcf3; color: var(--blue-800); }
.flash-x { margin-left: auto; background: none; border: 0; font-size: 1.1rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.flash-x:hover { opacity: 1; }

/* catatan */
.note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius); font-size: .85rem; margin-bottom: 14px; }
.note .ico { margin-top: 1px; }
.note > div { min-width: 0; }
.note-info { background: var(--info-100); color: #123c66; border: 1px solid #cfe0f2; }
.note-ok { background: var(--ok-100); color: var(--green-800); border: 1px solid #bfe3d5; }
.note-warning { background: var(--warn-100); color: #6f3e00; border: 1px solid #f0d9b0; }
.note-danger { background: var(--danger-100); color: var(--danger); border: 1px solid #f3c9c5; }
.note-info a { color: var(--blue-800); font-weight: 600; text-decoration: underline; }

/* tabel */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line-soft); }
.table { width: 100%; border-collapse: collapse; font-size: .84rem; background: #fff; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table th {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  background: #f7faf8; font-weight: 700; white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafdfb; }
.table tfoot th { background: #f1f7f4; }
.table td .muted { font-size: .76rem; }
.table-dense th, .table-dense td { padding: 8px 10px; }
.table-sm { font-size: .8rem; }
.table-report { font-size: .8rem; }

/* chip filter */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: .8rem; font-weight: 600;
}
.chip .ico { width: 14px; height: 14px; }
.chip:hover { border-color: #bfe3d5; color: var(--green-800); }
.chip.active { background: linear-gradient(135deg, var(--green-800), var(--blue-800)); border-color: transparent; color: #fff; }
.chip b { background: rgba(0, 0, 0, .08); padding: 0 6px; border-radius: 999px; font-size: .7rem; }
.chip.active b { background: rgba(255, 255, 255, .24); }

/* filter bar */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.filter-bar .field { min-width: 130px; margin: 0; }
.filter-bar .field-label { font-size: .68rem; }
.filter-search { position: relative; flex: 1 1 240px; min-width: 200px; }
.filter-search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.filter-search .inp { padding-left: 34px; }

/* form */
.form-grid { display: grid; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.field-label em { color: var(--danger); font-style: normal; }
.inp, .field input[type="text"], .field input[type="password"], .field input[type="email"],
.field input[type="number"], .field input[type="date"], .field input[type="tel"], .field select, .field textarea, textarea.inp {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: .88rem; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus {
  outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(15, 138, 106, .14);
}
.field textarea { resize: vertical; min-height: 70px; }
.field-help { font-size: .72rem; color: var(--muted); }
.field-error { font-size: .74rem; color: var(--danger); }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: .85rem; cursor: pointer; color: var(--ink-2); }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--green-700); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 12px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }

/* uploader */
.uploader { border: 1px dashed #b7d3c8; border-radius: var(--radius); background: #f9fcfb; padding: 14px; }
.upload-drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
  padding: 18px 12px; border-radius: 10px; text-align: center; color: var(--ink-2); background: #fff;
  border: 1px solid var(--line); transition: border-color .15s, background .15s;
}
.upload-drop:hover, .upload-drop.drag { border-color: var(--green-600); background: var(--green-100); }
.upload-drop .ico { width: 24px; height: 24px; color: var(--green-700); }
.upload-drop strong { font-size: .87rem; }
.upload-drop span { font-size: .74rem; color: var(--muted); }
.upload-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.upload-item { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: .8rem; }
.upload-item .ico { color: var(--green-700); }
.upload-item .up-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .up-size { color: var(--muted); font-size: .72rem; }
.upload-item .up-x { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 1rem; }
.upload-item .up-bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; width: 70px; }
.upload-item .up-bar span { display: block; height: 100%; background: var(--green-600); width: 0; }
.upload-thumb { width: 76px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .66rem; color: var(--muted); }
.upload-thumb img { width: 64px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.upload-thumb .ico { width: 40px; height: 40px; color: var(--muted); }
.upload-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
.upload-row:last-of-type { border-bottom: 0; }

/* halaman detail */
.detail-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-id h2 { font-size: 1.5rem; margin: 2px 0 6px; letter-spacing: -.02em; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.grid-detail { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.eyebrow { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--green-700); font-weight: 700; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.kv { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); }
.kv.wide { grid-column: 1 / -1; }
.kv span { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.kv strong { font-size: .87rem; font-weight: 600; color: var(--ink); }
.kv strong .badge { font-weight: 700; }
.wa-inline { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; color: var(--green-700); margin-left: 6px; }
.wa-inline .ico { width: 13px; height: 13px; }
.action-card { position: sticky; top: 84px; }
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 11px; background: #fbfdfc; }
.doc-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--blue-100); color: var(--blue-800); display: flex; align-items: center; justify-content: center; flex: none; }
.doc-info { flex: 1; min-width: 0; }
.doc-info strong { display: block; font-size: .84rem; }
.doc-info small { color: var(--muted); font-size: .72rem; }
.qr-mini { display: flex; justify-content: center; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.qr-mini img { width: 150px; height: 150px; }

/* timeline / riwayat */
.riwayat { list-style: none; margin: 0; padding: 0 0 0 6px; }
.riwayat-item { position: relative; padding: 0 0 16px 22px; border-left: 2px dashed var(--line); }
.riwayat-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.riwayat-dot { position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 3px var(--green-100); }
.riwayat-item.tone-danger .riwayat-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-100); }
.riwayat-item.tone-warn .riwayat-dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-100); }
.riwayat-item.tone-proses .riwayat-dot { background: var(--proses); box-shadow: 0 0 0 3px var(--proses-100); }
.riwayat-item.tone-info .riwayat-dot { background: var(--blue-700); box-shadow: 0 0 0 3px var(--blue-100); }
.riwayat-card { background: #fbfdfc; border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 12px; }
.riwayat-head { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; flex-wrap: wrap; }
.riwayat-head small { color: var(--muted); font-size: .72rem; }
.riwayat-card p { margin: 4px 0; font-size: .82rem; color: var(--ink-2); }
.riwayat-card > small { font-size: .7rem; }

/* stepper */
.stepper { display: flex; gap: 4px; margin: 18px 0; flex-wrap: wrap; }
.stp { flex: 1; min-width: 110px; display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-radius: 10px; background: #f4f8f6; border: 1px solid var(--line-soft); font-size: .76rem; color: var(--muted); }
.stp-num { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; flex: none; }
.stp-num .ico { width: 13px; height: 13px; }
.stp.done { background: var(--ok-100); border-color: #c6e6d9; color: var(--green-800); }
.stp.done .stp-num { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.stp.current { background: var(--blue-100); border-color: #c6dcf2; color: var(--blue-800); font-weight: 700; }
.stp.current .stp-num { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }

/* progress & chart */
.chart-wrap { width: 100%; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: #e9f0ed; stroke-width: 1; }
.chart .grid-text { fill: #93a6b3; font-size: 10px; }
.chart .bar { fill: #0f8a6a; opacity: .92; }
.chart .bar-g:hover .bar { fill: #0a3566; opacity: 1; }
.chart .bar-label { fill: #6b7f8d; font-size: 10px; }
.chart .bar-val { fill: #33475a; font-size: 9.5px; font-weight: 700; }
.progress-list { display: flex; flex-direction: column; gap: 10px; }
.progress-head { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; margin-bottom: 3px; }
.progress-head strong { font-size: .8rem; }
.progress-head em { font-style: normal; color: var(--muted); font-weight: 500; font-size: .72rem; }
.bar-track { height: 8px; background: #eef3f1; border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 6px; background: var(--green-600); }
.bar-fill.tone-blue { background: var(--blue-700); }
.bar-fill.tone-gold { background: var(--gold-500); }
.bar-fill.tone-warn { background: #d08a2c; }
.bar-fill.tone-danger { background: var(--danger); }
.mini-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.mini-summary div { display: flex; flex-direction: column; }
.mini-summary span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mini-summary strong { font-size: 1.05rem; }

/* notifikasi */
.notif-list, .wa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow: auto; }
.notif-list li, .wa-list li { border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; background: #fff; }
.notif-list li.unread { background: #f6fbf8; border-color: #cfe7dc; box-shadow: inset 3px 0 0 var(--green-600); }
.notif-head, .wa-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.notif-head small, .wa-head small { color: var(--muted); font-size: .7rem; }
.notif-list p, .wa-list p { margin: 3px 0; font-size: .8rem; color: var(--ink-2); }
.notif-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* misc panel */
.quick-reports { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.quick-reports a { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font-weight: 600; font-size: .86rem; }
.quick-reports a:hover { border-color: var(--green-600); background: var(--green-100); color: var(--green-800); }
.pimpinan-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ikm-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.ikm-head strong { font-size: 2rem; color: var(--green-800); letter-spacing: -.03em; }
.ikm-head span { font-size: .82rem; color: var(--ink-2); }
.sebaran { display: flex; flex-direction: column; gap: 8px; }
.seb-row { display: grid; grid-template-columns: 190px 1fr 44px; gap: 10px; align-items: center; font-size: .78rem; }
.seb-row b { text-align: right; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; align-items: start; }
.konten-list { display: flex; flex-direction: column; gap: 8px; }
.konten-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); }
.konten-item:hover { border-color: var(--green-600); color: var(--ink); }
.konten-item .ico { color: var(--green-700); }
.qr-poster-mini { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr-poster-mini img { width: 132px; height: 132px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; text-align: center; color: var(--muted); font-size: .86rem; }
.empty-ico { width: 40px; height: 40px; opacity: .45; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; flex-wrap: wrap; }
.page-info { font-size: .76rem; color: var(--muted); }
.page-btns { display: flex; gap: 4px; }
.page-btn { display: inline-flex; min-width: 32px; height: 32px; align-items: center; justify-content: center; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: .8rem; color: var(--ink-2); }
.page-btn.active { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.page-btn:hover { border-color: var(--green-600); }

/* auth */
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 16px;
  background: linear-gradient(140deg, #06322b 0%, #08324f 55%, #0a3566 100%);
  position: relative; overflow: hidden;
}
.auth-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 12% 18%, rgba(230, 198, 92, .22), transparent 42%),
    radial-gradient(circle at 88% 84%, rgba(15, 138, 106, .34), transparent 46%);
}
.auth-bg::after {
  content: ''; position: absolute; inset: 0; opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cpath d='M36 4l9 23 23 9-23 9-9 23-9-23-23-9 23-9z' fill='none' stroke='%23e6c65c' stroke-width='1'/%3E%3C/svg%3E");
}
.auth-wrap { position: relative; width: 100%; max-width: 440px; }
.auth-wrap.wide { max-width: 660px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: #fff; }
.auth-brand-logo {
  width: 48px; height: 48px; border-radius: 12px; object-fit: contain;
  background: #fff; padding: 3px; border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}
.auth-brand strong { display: block; font-size: .96rem; }
.auth-brand small { font-size: .72rem; color: rgba(255, 255, 255, .7); }
.auth-card { padding: 26px 24px; border: 1px solid rgba(255, 255, 255, .5); box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.35rem; margin: 8px 0 6px; }
.auth-card .muted { font-size: .84rem; }
.auth-note { font-size: .78rem; color: var(--muted); margin-top: 12px; }
.auth-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--green-100); color: var(--green-800); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.auth-foot { text-align: center; color: rgba(255, 255, 255, .74); font-size: .74rem; margin-top: 16px; line-height: 1.7; }
.auth-foot a { color: #fff; text-decoration: underline; }
.profile-top { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.avatar-big { width: 76px; height: 76px; border-radius: 18px; background: linear-gradient(135deg, var(--green-700), var(--blue-800)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; font-weight: 700; flex: none; overflow: hidden; }
.avatar-big img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------ cetak/dokumen */
.print-body { background: #e8eeeb; padding: 0; }
.print-toolbar { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.paper {
  width: 210mm; min-height: 297mm; margin: 18px auto; padding: 15mm 16mm;
  background: #fff; box-shadow: 0 8px 30px rgba(13, 34, 49, .16);
  font-size: 11.5pt; line-height: 1.5; color: #111;
}
.paper h1, .paper h2, .paper h3 { color: #000; }
.kop { display: flex; gap: 14px; align-items: center; }
.kop-logo { width: 24mm; height: 24mm; object-fit: contain; }
.kop-teks { text-align: center; flex: 1; }
.kop-1 { font-size: 10.5pt; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.kop-2 { font-size: 10.5pt; font-weight: 600; text-transform: uppercase; }
.kop-3 { font-size: 14pt; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; margin-top: 1mm; }
.kop-4, .kop-5 { font-size: 8.4pt; color: #333; }
.kop-line { border-bottom: 2.4px solid #111; margin: 2mm 0 4mm; box-shadow: 0 2.5px 0 -1px #111; }
.paper .doc-title { text-align: center; margin-bottom: 6mm; }
.paper .doc-title h1 { font-size: 13pt; text-transform: uppercase; text-decoration: underline; margin-bottom: 1mm; letter-spacing: .03em; }
.paper .doc-title p { margin: 0; font-size: 10pt; }
.paper p { text-align: justify; }
.paper .table { font-size: 8.6pt; }
.paper .table th, .paper .table td { border: 1px solid #b9c4bf; padding: 3px 5px; }
.paper .table th { background: #eef3f1; position: static; }
.paper .print-section { margin-top: 5mm; }
.paper .print-section h3 { font-size: 10.5pt; margin-bottom: 2mm; }
.paper .print-section.small { font-size: 8.4pt; color: #444; }
.bukti-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2mm 8mm; margin: 4mm 0; }
.bukti-grid > div { display: flex; flex-direction: column; }
.bukti-grid .wide { grid-column: 1 / -1; }
.bukti-grid span { font-size: 8.6pt; color: #557; text-transform: uppercase; letter-spacing: .04em; }
.bukti-grid strong { font-size: 10.5pt; }
.bukti-head { display: flex; justify-content: space-between; gap: 8mm; flex-wrap: wrap; }
.bukti-reg { border: 1px solid #0b6b53; border-radius: 3mm; padding: 3mm 5mm; align-self: flex-start; background: #f2faf6; }
.bukti-reg span { display: block; font-size: 8pt; text-transform: uppercase; letter-spacing: .08em; color: #0b6b53; font-weight: 700; }
.bukti-reg strong { font-size: 15pt; letter-spacing: .02em; }
.bukti-reg small { font-size: 8pt; color: #555; }
.bukti-timeline h3 { font-size: 10pt; margin: 5mm 0 2mm; }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2mm; }
.tl-item { display: flex; align-items: center; gap: 3mm; font-size: 9.4pt; color: #555; }
.tl-dot { width: 6mm; height: 6mm; border-radius: 50%; background: #eef3f1; border: 1px solid #cdd8d2; display: flex; align-items: center; justify-content: center; font-size: 7.4pt; font-weight: 700; flex: none; }
.tl-item.done .tl-dot { background: #0b6b53; border-color: #0b6b53; color: #fff; }
.tl-item.current .tl-dot { background: #0f4c8a; border-color: #0f4c8a; color: #fff; }
.tl-item.warn .tl-dot { background: #a35a00; border-color: #a35a00; color: #fff; }
.tl-item.done, .tl-item.current { color: #111; font-weight: 600; }
.bukti-qr { display: flex; align-items: center; gap: 5mm; border-top: 1px dashed #b9c4bf; margin-top: 4mm; padding-top: 3mm; }
.bukti-qr img { width: 26mm; height: 26mm; }
.bukti-qr strong { font-size: 10pt; }
.bukti-qr p { font-size: 9pt; margin: 1mm 0; }
.bukti-qr small { font-size: 11pt; font-weight: 700; letter-spacing: .1em; }
.ttd-blok { margin-top: 10mm; margin-left: auto; width: 75mm; text-align: center; font-size: 10.5pt; page-break-inside: avoid; }
.ttd-tanggal { margin-bottom: 1mm; }
.ttd-jabatan { font-weight: 600; margin-bottom: 1mm; }
.ttd-area { position: relative; height: 24mm; display: flex; align-items: center; justify-content: center; }
.ttd-img { max-height: 24mm; max-width: 60mm; object-fit: contain; }
.stempel-img { position: absolute; width: 28mm; opacity: .85; right: -4mm; top: 0; mix-blend-mode: multiply; }
.ttd-space { height: 24mm; }
.ttd-nama { font-weight: 700; text-decoration: underline; }
.ttd-nip { font-size: 9.4pt; }
.identitas-table { margin: 3mm 0 4mm; font-size: 10.5pt; }
.identitas-table td { padding: 1mm 2mm 1mm 0; vertical-align: top; }
.identitas-table td:nth-child(1) { width: 42mm; }
.identitas-table td:nth-child(2) { width: 4mm; }
.identity-line { margin: 4mm 0; }
.print-foot { margin-top: 8mm; padding-top: 2mm; border-top: 1px solid #dde; font-size: 7.8pt; color: #777; text-align: center; }
.poster-qr { text-align: center; padding: 8mm 4mm; }
.pq-head { font-size: 11pt; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pq-sub { font-size: 22pt; font-weight: 800; letter-spacing: .06em; color: #0b6b53; margin: 2mm 0 6mm; }
.pq-img { width: 120mm; height: 120mm; }
.poster-qr h2 { font-size: 15pt; margin: 5mm 0 2mm; }
.poster-qr p { font-size: 10.5pt; max-width: 140mm; margin: 0 auto 4mm; text-align: center; }
.pq-url { font-size: 8.6pt; color: #555; margin-bottom: 5mm; word-break: break-all; }
.pq-foot { font-size: 9pt; color: #444; border-top: 1px solid #ccc; padding-top: 3mm; }
.label-tamu { border: 1px dashed #999; padding: 5mm; width: 120mm; margin: 0 auto; }
.lt-head { font-size: 10pt; font-weight: 700; text-align: center; }
.lt-sub { font-size: 8pt; text-align: center; letter-spacing: .06em; color: #555; margin-bottom: 2mm; }
.lt-kode { font-size: 15pt; text-align: center; font-weight: 700; letter-spacing: .08em; }
.lt-bar svg { width: 100%; height: 16mm; }
.lt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1mm 5mm; font-size: 8.6pt; }
.lt-grid span { display: block; color: #666; font-size: 7.4pt; text-transform: uppercase; letter-spacing: .04em; }
.lt-foot { margin-top: 3mm; font-size: 7.8pt; text-align: center; color: #777; }

/* ------------------------------------------------------------------ responsif */
@media (max-width: 1180px) {
  .grid-dash, .grid-dash-2 { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; position: absolute; top: 14px; right: 12px; width: 30px; height: 30px; align-items: center; justify-content: center; background: rgba(255, 255, 255, .12); border: 0; color: #fff; border-radius: 8px; cursor: pointer; font-size: 1.1rem; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(6, 30, 26, .45); z-index: 35; }
  .sidebar-overlay.show { display: block; }
  .menu-btn { display: inline-flex; }
  .grid-detail { grid-template-columns: minmax(0, 1fr); }
  .action-card { position: static; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .paper { width: 100%; min-height: 0; padding: 10mm; }
}
@media (max-width: 720px) {
  .grid-2, .grid-2.gap-lg { grid-template-columns: minmax(0, 1fr); }
  .kv-grid { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none; }
  .page-sub { display: none; }
  .user-chip .chip-text { display: none; }
  .chip-text small { display: none; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .stat-card { padding: 11px 12px; }
  .stat-value { font-size: 1.25rem; }
  .stat-ico { width: 34px; height: 34px; }
  .card { padding: 14px; border-radius: 14px; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions > .btn { display: none; }
  .topbar-actions .user-chip { padding: 4px; }
  .page-head h1 { font-size: 1.06rem; }
  .seb-row { grid-template-columns: 120px 1fr 36px; }
  .filter-bar { gap: 8px; }
  .filter-bar .field, .filter-bar .filter-search { flex: 1 1 100%; }
  .table th, .table td { padding: 8px 9px; }
  .pagination { flex-direction: column; align-items: stretch; }
  .btn-lg { padding: 11px 16px; font-size: .9rem; }
  .bukti-grid { grid-template-columns: minmax(0, 1fr); }
  .ttd-blok { margin-left: 0; width: 100%; }
}
@media print {
  @page { size: A4; margin: 12mm; }
  .no-print, .print-toolbar { display: none !important; }
  .print-body { background: #fff; }
  .paper { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; font-size: 10.5pt; }
  .table th { position: static; }
  .print-foot { position: static; }
  a { color: #000; text-decoration: none; }
}
