:root {
  --bg: #f2f5fa;
  --surface: #ffffff;
  --ink: #14202e;
  --muted: #6b7a8c;
  --line: #dde4ec;
  --brand: #7b1226;          /* maroon */
  --brand-dark: #5b0c1c;
  --accent: #a4142f;         /* merah maroon */
  --green: #0b8a4d;          /* hijau aksen */
  --amber: #b45309;
  --blue: #1d4ed8;
  --gradient-brand: linear-gradient(120deg, #4a0710 0%, #7b1226 45%, #b3213c 100%);
  --radius: 10px;
}


* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
a { color: var(--brand-dark); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex: 0 0 250px; background: linear-gradient(180deg, #3d060e 0%, #6d1020 55%, #9c1a30 100%);
  color: #eef3fa;
  display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 9px; background: var(--gradient-brand);
  color: #fff; display: grid; place-items: center; font-weight: 700;
}
.brand strong { display: block; font-size: 16px; }
.brand small { color: #c6d4ea; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  color: #dce6f5; padding: 9px 11px; border-radius: 8px; font-size: 13.5px;
  display: flex; justify-content: space-between; align-items: center;
}
.sidebar nav a:hover { background: rgba(255,255,255,.09); }
.sidebar nav a.active { background: rgba(255,255,255,.20); color: #fff; font-weight: 600; }
.pill { background: var(--accent); color: #fff; border-radius: 20px; padding: 1px 8px; font-size: 11px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.15); padding-top: 12px; }
.me strong { display: block; font-size: 13px; }
.me small { color: #c6d4ea; font-size: 11.5px; }
.sidebar-foot .btn { margin-top: 8px; width: 100%; }

.main { flex: 1; min-width: 0; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 16px 24px; display: flex; justify-content: space-between; align-items: center;
}
.topbar h1 { margin: 0; font-size: 19px; }
.topbar { border-top: 3px solid transparent; border-image: var(--gradient-brand) 1; }
.content { padding: 22px 24px 60px; }

/* ---------- cards & grid ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.stat.warn { border-left: 4px solid var(--accent); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eef2f9; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: #3a4a63; }
tbody tr:hover { background: #f7f9fd; }
.table-wrap { overflow-x: auto; }
tr.section-row td { background: #e8edf8; font-weight: 700; }

/* ---------- forms ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; color: #33455f; }
input[type=text], input[type=password], input[type=date], input[type=time],
input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(123,18,38,.25); border-color: var(--brand); }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 0;
  background: var(--gradient-brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-ghost { background: transparent; color: #eaf3ee; border-color: rgba(255,255,255,.35); }
.btn-outline { background: #fff; color: var(--brand-dark); border: 1px solid var(--brand); }
.btn-danger { background: var(--accent); }
.btn-muted { background: #7b869b; }

/* ---------- badges & alerts ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-green { background: #dcf1e5; color: #075c36; }
.badge-red   { background: #fde2e7; color: #96082c; }
.badge-amber { background: #fdefd9; color: #8a4b06; }
.badge-blue  { background: #e0e8fd; color: #16359c; }
.badge-gray  { background: #e9edec; color: #4e615c; }

.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.alert-ok { background: #dcf1e5; color: #075c36; }
.alert-err { background: #fde2e7; color: #96082c; }
.alert-info { background: #e0e8fd; color: #16359c; }

/* ---------- login ---------- */
html:has(body.center-page), body.center-page {
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
}
.center-page {
  display: grid; place-items: center; width: 100vw; min-height: 100vh; min-height: 100dvh;
  margin: 0; padding: 20px; position: relative; overflow: hidden;
  background: none;
}
.center-page::before {
  content: "";
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: url("terminal-bg-fullscreen.jpg?v=4") center center / 100% 100% no-repeat;
  z-index: 0;
  pointer-events: none;
}
.center-page > * { position: relative; z-index: 1; }
.login-card { background: #fff; border-radius: 14px; padding: 28px; width: 100%; max-width: 400px; box-shadow: 0 18px 40px rgba(0,0,0,.22); }
.login-card h2 {
  margin: 0 0 4px; font-size: 30px; letter-spacing: 1px;
  background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.demo-users { font-size: 12px; color: var(--muted); margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; line-height: 1.7; }

/* ---------- checklist form ---------- */
.chk-row td { font-size: 13px; }
.chk-opts { display: flex; gap: 10px; white-space: nowrap; }
.chk-opts label { font-weight: 500; margin: 0; display: inline-flex; gap: 4px; align-items: center; }
.sticky-actions {
  position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line);
  padding: 12px 0; display: flex; gap: 10px; justify-content: flex-end;
}
.approval-line { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.approval-line:last-child { border-bottom: 0; }
.approval-line .who { flex: 1; }

@media print {
  .sidebar, .topbar, .sticky-actions, .btn { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
}

/* ---------- stempel approve ---------- */
.stamp {
  --sc: #0b7f4a;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 7px 16px; border: 3px double var(--sc); border-radius: 10px;
  color: var(--sc); background: rgba(11,127,74,.06);
  font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase;
  line-height: 1.15; transform: rotate(-7deg); box-shadow: 0 0 0 1px rgba(0,0,0,.03) inset;
}
.stamp .stamp-main { font-size: 15px; }
.stamp .stamp-sub { font-size: 9px; font-weight: 700; letter-spacing: .6px; opacity: .85; }
.stamp-sm { padding: 4px 10px; transform: rotate(-4deg); }
.stamp-sm .stamp-main { font-size: 11px; }
.stamp-sm .stamp-sub { font-size: 8px; }
.stamp-lg { padding: 12px 26px; border-width: 4px; }
.stamp-lg .stamp-main { font-size: 26px; }
.stamp-lg .stamp-sub { font-size: 11px; }
.stamp-reject { --sc: #96082c; background: rgba(150,8,44,.06); }
.stamp-wait   { --sc: #8a4b06; background: rgba(138,75,6,.06); transform: rotate(0deg); border-style: dashed; }
.stamp-final-wrap { display: flex; justify-content: flex-end; margin: 6px 0 0; }

/* Kode pemulihan verifikasi 2 langkah */
.recovery-list { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
.recovery-list code {
  background:#f4f5f8; border:1px dashed #b9bfcc; border-radius:8px;
  padding:6px 10px; font-size:14px; letter-spacing:1px;
}

/* cap approval di samping nama & jabatan */
.approval-line .who { flex: 1 1 auto; }
.approval-line .sign-jabatan { display: block; }
.sign-stamp-inline { flex: 0 0 auto; margin-left: auto; padding-left: 10px; }
