/* VisitIn — Tamu & Magang SMARTRI · tema orange (terakota) · ARZ */
:root {
  --bg: #faf6f4; --surface: #ffffff; --surface-2: #f6efeb; --ink: #241a16; --muted: #76655e; --line: #eadfd9;
  --brand: #b2462a; --brand-2: #d4673f; --brand-strong: #8f3720; --brand-soft: rgba(178, 70, 42, .10); --brand-ink: #ffffff;
  --accent: #e9a100; --ok: #1d7f53; --ok-soft: rgba(29, 127, 83, .12); --warn: #a86b00; --warn-soft: rgba(233, 161, 0, .16);
  --danger: #c0392b; --danger-soft: rgba(192, 57, 43, .11); --info: #2f62b3; --info-soft: rgba(47, 98, 179, .11);
  --shadow: 0 1px 2px rgba(60, 30, 20, .06), 0 8px 24px rgba(60, 30, 20, .06); --radius: 14px;
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0807; --surface: #170f0d; --surface-2: #1f1512; --ink: #f3e9e4; --muted: #b29f97; --line: #33241f;
    --brand: #f2a07f; --brand-2: #e2744c; --brand-strong: #ffc2a8; --brand-soft: rgba(242, 160, 127, .15); --brand-ink: #1b0d08;
    --accent: #f3b52b; --ok: #4cc28a; --ok-soft: rgba(76, 194, 138, .14); --warn: #f3b52b; --warn-soft: rgba(243, 181, 43, .14);
    --danger: #f07b6e; --danger-soft: rgba(240, 123, 110, .14); --info: #82a9ec; --info-soft: rgba(130, 169, 236, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0807; --surface: #170f0d; --surface-2: #1f1512; --ink: #f3e9e4; --muted: #b29f97; --line: #33241f;
  --brand: #f2a07f; --brand-2: #e2744c; --brand-strong: #ffc2a8; --brand-soft: rgba(242, 160, 127, .15); --brand-ink: #1b0d08;
  --accent: #f3b52b; --ok: #4cc28a; --ok-soft: rgba(76, 194, 138, .14); --warn: #f3b52b; --warn-soft: rgba(243, 181, 43, .14);
  --danger: #f07b6e; --danger-soft: rgba(240, 123, 110, .14); --info: #82a9ec; --info-soft: rgba(130, 169, 236, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 8px 13px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--brand); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-color: transparent; color: #fff; }
:root[data-theme="dark"] .btn.primary { color: var(--brand-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: var(--brand-ink); } }
.btn.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.sm { padding: 5px 9px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn .ic { width: 16px; height: 16px; }
.input, select.input, textarea.input { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; outline: none; }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field small { color: var(--muted); font-size: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink); }
.check input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.span2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .03em; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill.ok, .pill.checked_in, .pill.approved, .pill.active, .pill.hadir { background: var(--ok-soft); color: var(--ok); }
.pill.warn, .pill.registered, .pill.pending, .pill.upcoming, .pill.izin { background: var(--warn-soft); color: var(--warn); }
.pill.danger, .pill.rejected, .pill.cancelled, .pill.sakit { background: var(--danger-soft); color: var(--danger); }
.pill.info, .pill.completed, .pill.checked_out { background: var(--info-soft); color: var(--info); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 16px; text-decoration: none; color: var(--ink); }
.logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(150deg, #d4673f, #b2462a 55%, #782a17); box-shadow: 0 6px 16px rgba(178, 70, 42, .3); flex: none; }
.logo .ic { width: 20px; height: 20px; }
.brand b { display: block; font-size: 16px; font-weight: 800; }
.brand small { display: block; font-size: 11.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.nav .count { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }
:root[data-theme="dark"] .nav .count { color: var(--brand-ink); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13px; flex: none; }
.me div { min-width: 0; } .me b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .me small { color: var(--muted); font-size: 12px; }
.tools { display: flex; gap: 6px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg button { font: inherit; font-size: 12px; font-weight: 700; border: 0; background: transparent; color: var(--muted); padding: 6px 9px; cursor: pointer; }
.seg button.on { background: var(--brand-soft); color: var(--brand); }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 9px; cursor: pointer; }
.icon-btn:hover { color: var(--ink); border-color: var(--brand); }
.icon-btn .ic { width: 16px; height: 16px; }
.topbar { display: none; }
.main { padding: 26px clamp(16px, 3vw, 36px) 48px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .row { margin-left: auto; }
.backdrop-nav { display: none; }

/* ---------- cards, stats, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card > h2, .card-h { margin: 0 0 14px; font-size: 15.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.cards { display: grid; gap: 16px; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; }
.stat .si { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.stat b { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; } .stat span { color: var(--muted); font-size: 12.5px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 0; }
.toolbar .grow { flex: 1 1 220px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--muted); font-size: 12.5px; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn + .btn { margin-left: 4px; }
.empty { text-align: center; color: var(--muted); padding: 30px 12px; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { font: inherit; font-weight: 700; font-size: 13.5px; background: none; border: 0; padding: 10px 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-color: var(--brand); }
.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; } .kv dd { margin: 0; overflow-wrap: anywhere; }
.notice { padding: 11px 14px; border-radius: 10px; background: var(--brand-soft); color: var(--ink); font-size: 13.5px; }
.notice.warn { background: var(--warn-soft); } .notice.ok { background: var(--ok-soft); } .notice.danger { background: var(--danger-soft); }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 8, 6, .55); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal header h3 { margin: 0; font-size: 16.5px; flex: 1; }
.modal .body { padding: 18px 20px; } .modal footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow); animation: fade .2s; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.secret { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.secret code { font-size: 16px; font-weight: 700; flex: 1; overflow-wrap: anywhere; }

/* ---------- intern home ---------- */
.clock { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.clock .time { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: inherit; }

/* ---------- LOGIN (template ARZ, warna orange) ---------- */
.auth {
  --auth-1: #d4673f; --auth-2: #b2462a; --auth-3: #782a17; --auth-hi: #ffd9c2;
  --auth-btn: #e2744c; --auth-btn-2: #c5583a; --auth-dark: #0d0706;
  --auth-glow-1: rgba(226, 116, 76, .20); --auth-glow-2: rgba(245, 195, 90, .09);
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--auth-dark);
}
.auth-side { position: relative; overflow: hidden; color: #fff; display: flex; align-items: center; padding: 56px clamp(24px, 6vw, 72px);
  background: radial-gradient(circle at 4% 6%, rgba(255,255,255,.14), transparent 18%),
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(160deg, var(--auth-1), var(--auth-2) 48%, var(--auth-3)); }
.auth-inner { position: relative; z-index: 1; max-width: 540px; display: flex; flex-direction: column; gap: 22px; }
.auth-org { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .92; }
.auth-tile-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); }
.auth-tile-ic .ic { width: 19px; height: 19px; color: #fff; }
.auth-side h1 { margin: 0; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.12; font-weight: 800; letter-spacing: -.01em; }
.auth-side h1 span { display: block; color: var(--auth-hi); }
.auth-lead { margin: 0; font-size: 16px; line-height: 1.6; opacity: .9; max-width: 48ch; }
.auth-feats { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 16px; }
.auth-feats li { display: flex; gap: 14px; align-items: flex-start; }
.auth-feats .auth-tile-ic { width: 34px; height: 34px; border-radius: 9px; }
.auth-feats .auth-tile-ic .ic { width: 16px; height: 16px; }
.auth-feats b { display: block; font-size: 15px; } .auth-feats small { font-size: 13px; opacity: .8; }
.auth-credit { display: flex; align-items: center; gap: 12px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.18); font-size: 13px; }
.auth-credit small { display: block; font-size: 11.5px; opacity: .75; }
.arz { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #fff; color: var(--auth-2, #b2462a); font-weight: 900; font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.arz.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 7.5px; background: var(--auth-btn, #e2744c); color: #fff; box-shadow: none; }
.auth-mark { position: absolute; right: -2%; bottom: -7%; font-size: clamp(160px, 19vw, 280px); font-weight: 900; line-height: 1; color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,.07); pointer-events: none; user-select: none; }
.auth-float { position: absolute; border-radius: 22px; background: linear-gradient(150deg, rgba(255,255,255,.22), rgba(255,255,255,.06)); border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 18px 40px rgba(0,0,0,.25); backdrop-filter: blur(4px); animation: authFloat 9s ease-in-out infinite; pointer-events: none; }
.auth-float.a { width: 104px; height: 132px; right: 8%; top: 4%; transform: rotate(22deg); }
.auth-float.b { width: 62px; height: 84px; right: 9%; top: 54%; border-radius: 14px; transform: rotate(-12deg); animation-delay: -4s; }
@keyframes authFloat { 50% { translate: 0 -10px; } }
.auth-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 16px;
  background: radial-gradient(circle at 100% 0%, var(--auth-glow-1), transparent 42%), radial-gradient(circle at 75% 100%, var(--auth-glow-2), transparent 45%), var(--auth-dark);
  --surface: #18100d; --surface-2: #20150f; --ink: #f3e9e4; --muted: #b29f97; --line: #3a2620; --brand: #f2a07f; --brand-soft: rgba(242,160,127,.22);
  --auth-card: rgba(27,17,14,.84); --auth-card-line: rgba(255,255,255,.08); color: var(--ink); color-scheme: dark; }
.auth-tools { position: absolute; top: 18px; right: 20px; display: flex; gap: 8px; }
.auth-card { width: min(420px, 100%); background: var(--auth-card); border: 1px solid var(--auth-card-line); border-radius: 22px; padding: 36px 32px 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05); display: flex; flex-direction: column; gap: 16px; }
.auth-card h2 { margin: 0; font-size: 25px; font-weight: 800; } .auth-card .sub { margin: 4px 0 0; color: var(--muted); }
.auth-card .input { padding: 11px 12px; }
.auth-card .btn.primary { padding: 12px 14px; font-size: 15px; font-weight: 700; color: #fff !important; background: linear-gradient(180deg, var(--auth-btn), var(--auth-btn-2)); box-shadow: 0 8px 22px rgba(0,0,0,.3); }
.auth-forgot { text-align: center; font-size: 13.5px; }
.auth-forgot summary { cursor: pointer; color: var(--brand); font-weight: 600; list-style: none; display: inline-block; }
.auth-forgot summary::-webkit-details-marker { display: none; }
.auth-forgot p { margin: 8px 0 0; color: var(--muted); }
.auth-guest { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; border-top: 1px solid var(--line); padding-top: 14px; }
.auth-guest:hover { color: var(--brand); }
.auth-foot { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.form-err { color: #ff9b8c; font-size: 13px; font-weight: 600; min-height: 0; }
/* login — mode terang: panel kanan terang */
:root[data-theme="light"] .auth-main, :root:not([data-theme]) .auth-main {
  --auth-dark-r: #f6f1ee; background: radial-gradient(circle at 100% 0%, rgba(226,116,76,.13), transparent 42%), radial-gradient(circle at 75% 100%, rgba(233,161,0,.08), transparent 45%), #f6f1ee;
  --surface: #ffffff; --surface-2: #faf5f2; --ink: #241a16; --muted: #76655e; --line: #e6d9d2; --brand: #b2462a; --brand-soft: rgba(178,70,42,.14);
  --auth-card: #ffffff; --auth-card-line: #eadfd9; color-scheme: light; }
:root[data-theme="light"] .auth-card, :root:not([data-theme]) .auth-card { box-shadow: 0 24px 60px rgba(90,40,20,.12); }
:root[data-theme="light"] .form-err, :root:not([data-theme]) .form-err { color: #c0392b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .auth-main { background: radial-gradient(circle at 100% 0%, var(--auth-glow-1), transparent 42%), radial-gradient(circle at 75% 100%, var(--auth-glow-2), transparent 45%), var(--auth-dark);
    --surface: #18100d; --surface-2: #20150f; --ink: #f3e9e4; --muted: #b29f97; --line: #3a2620; --brand: #f2a07f; --brand-soft: rgba(242,160,127,.22);
    --auth-card: rgba(27,17,14,.84); --auth-card-line: rgba(255,255,255,.08); color-scheme: dark; }
  :root:not([data-theme]) .auth-card { box-shadow: 0 24px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05); }
  :root:not([data-theme]) .form-err { color: #ff9b8c; }
}
@media (prefers-reduced-motion: reduce) { .auth-float { animation: none; } }

/* ---------- public guest pages ---------- */
.pub { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 0 0 40px; }
.pub-hero { width: 100%; color: #fff; padding: 26px 20px 70px; position: relative; overflow: hidden;
  background: radial-gradient(circle at 4% 6%, rgba(255,255,255,.14), transparent 22%),
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 34px 34px, linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(160deg, #d4673f, #b2462a 48%, #782a17); }
.pub-hero .wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 1; }
.pub-hero .top { display: flex; align-items: center; gap: 10px; }
.pub-hero .top .org { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .92; flex: 1; }
.pub-hero h1 { margin: 6px 0 0; font-size: 28px; font-weight: 800; }
.pub-hero h1 span { color: #ffd9c2; display: block; font-size: 17px; font-weight: 700; margin-top: 2px; }
.pub-hero p { margin: 0; opacity: .9; }
.pub-hero .icon-btn, .pub-hero .seg { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.pub-hero .seg button { color: rgba(255,255,255,.75); } .pub-hero .seg button.on { background: rgba(255,255,255,.22); color: #fff; }
.pub-hero .auth-mark { font-size: 170px; bottom: -40%; }
.pub-card { width: min(640px, calc(100% - 24px)); margin-top: -46px; position: relative; z-index: 2; }
.pub-foot { margin-top: 18px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; justify-content: center; text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.badge-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.badge-card .qr-box { width: min(230px, 70vw); padding: 10px; background: #fff; border-radius: 16px; border: 1px solid var(--line); }
.badge-card .qr-box svg { width: 100%; height: auto; display: block; }
.badge-card .code { font-size: 26px; font-weight: 800; letter-spacing: .14em; }
.badge-card h2 { margin: 0; font-size: 22px; }
.badge-meta { width: 100%; text-align: left; }
.badge-card > .pill { flex: none; }

/* ---------- poster & certificate (print) ---------- */
.print-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 20px; background: var(--bg); }
.print-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: min(1123px, 100%); }
.poster { width: min(794px, 100%); aspect-ratio: 210 / 297; background: #fff; color: #241a16; border-radius: 6px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.poster .ph { color: #fff; padding: 9% 8% 7%; background: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 34px 34px, linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 34px 34px, linear-gradient(160deg, #d4673f, #b2462a 48%, #782a17); position: relative; overflow: hidden; }
.poster .ph .auth-mark { font-size: 220px; }
.poster .ph small { font-size: 13px; letter-spacing: .14em; font-weight: 700; text-transform: uppercase; opacity: .9; }
.poster .ph h1 { margin: 10px 0 6px; font-size: clamp(28px, 5.4vw, 46px); font-weight: 800; }
.poster .ph p { margin: 0; font-size: clamp(14px, 2.2vw, 19px); opacity: .92; max-width: 30ch; }
.poster .pb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 6% 8%; text-align: center; }
.poster .pb .qr { width: min(330px, 62%); height: auto; }
.poster .pb .url { font-size: clamp(14px, 2.4vw, 20px); font-weight: 800; color: #b2462a; overflow-wrap: anywhere; }
.poster .pb .steps { font-size: clamp(12px, 1.8vw, 15px); color: #5a4a44; max-width: 46ch; }
.poster .pf { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-top: 1px solid #eee; font-size: 12px; color: #76655e; }
.cert { --c1: #d64545; --c2: #b3261e; --c3: #6e1510; --ca: #b3261e; --cl: rgba(179, 38, 30, .35); --cs: rgba(179, 38, 30, .4);
  width: min(1123px, 100%); aspect-ratio: 297 / 210; background: #fffdfb; color: #241a16; position: relative; overflow: hidden; box-shadow: var(--shadow); border-radius: 4px; container-type: inline-size; }
.cert .frame { position: absolute; inset: 2.2cqw; border: .25cqw solid var(--c2); border-radius: .6cqw; }
.cert .frame::after { content: ""; position: absolute; inset: .7cqw; border: .1cqw solid var(--cs); border-radius: .4cqw; }
.cert .band { position: absolute; left: 0; top: 0; bottom: 0; width: 15cqw; background: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 2.6cqw 2.6cqw, linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 2.6cqw 2.6cqw, linear-gradient(170deg, var(--c1), var(--c2) 50%, var(--c3)); }
.cert .band .vt { position: absolute; left: 50%; bottom: 6cqw; transform: translateX(-50%) rotate(180deg); writing-mode: vertical-rl; color: rgba(255,255,255,.9); font-weight: 800; letter-spacing: .5cqw; font-size: 1.4cqw; text-transform: uppercase; white-space: nowrap; max-height: 52cqw; overflow: hidden; text-overflow: ellipsis; }
.cert .band .lg { position: absolute; left: 50%; top: 5cqw; transform: translateX(-50%); width: 7cqw; height: 7cqw; border-radius: 1.6cqw; background: rgba(255,255,255,.16); border: .12cqw solid rgba(255,255,255,.35); display: grid; place-items: center; }
.cert .band .lg svg { width: 3.6cqw; height: 3.6cqw; stroke: #fff; }
.cert .logo-box { position: absolute; right: 6cqw; top: 5cqw; width: 19cqw; height: 10cqw; display: flex; align-items: center; justify-content: flex-end; }
.cert .logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.cert .content { position: absolute; left: 20cqw; right: 6cqw; top: 6cqw; bottom: 5cqw; display: flex; flex-direction: column; }
.cert .org { font-size: 1.25cqw; letter-spacing: .3cqw; font-weight: 800; text-transform: uppercase; color: var(--ca); max-width: 52cqw; }
.cert h1 { margin: 2cqw 0 0; font-size: 5.6cqw; letter-spacing: .5cqw; font-weight: 900; color: #2a1714; line-height: 1; }
.cert h2 { margin: .6cqw 0 0; font-size: 2.1cqw; font-weight: 600; color: var(--ca); }
.cert .no { font-size: 1.2cqw; color: #76655e; margin-top: 1cqw; }
.cert .given { margin-top: 3cqw; font-size: 1.5cqw; color: #76655e; }
.cert .name { font-size: 4.1cqw; font-weight: 800; margin-top: .4cqw; color: #241a16; border-bottom: .15cqw solid var(--cl); padding-bottom: .8cqw; align-self: flex-start; min-width: 60%; }
.cert .text { margin-top: 1.6cqw; font-size: 1.6cqw; line-height: 1.55; max-width: 62cqw; color: #3b2c26; }
.cert .topic { margin-top: .8cqw; font-size: 1.35cqw; color: #76655e; max-width: 62cqw; }
.cert .sign { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 3cqw; }
.cert .sign .who { text-align: center; min-width: 24cqw; max-width: 34cqw; font-size: 1.4cqw; }
.cert .sign .who .line { height: 6cqw; border-bottom: .12cqw solid #3b2c26; margin-bottom: .6cqw; }
.cert .sign .who b { display: block; font-size: 1.6cqw; }
.cert .sign .issuer { font-size: 1.15cqw; color: #76655e; max-width: 30cqw; }
.cert .sign .issuer b { display: block; color: var(--ca); font-size: 1.35cqw; }
.cert .seal { position: absolute; right: 7cqw; top: 6cqw; width: 11cqw; height: 11cqw; border-radius: 50%; border: .3cqw solid #e0a100; display: grid; place-items: center; align-content: center; text-align: center; color: #9a6a00; font-weight: 900; font-size: 1.1cqw; letter-spacing: .15cqw; background: radial-gradient(circle, rgba(224,161,0,.10), transparent 70%); }
.cert .seal span { display: block; font-size: 2.2cqw; letter-spacing: 0; line-height: 1.2; }
.cert-preview { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface-2); }
.cert-preview .cert { width: 100%; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 12.5px; font-weight: 600; background: var(--surface); color: var(--ink); }
.swatch input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.swatch .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.swatch:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.swatch input[type=color] { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.logo-field { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo-thumb { width: 150px; height: 84px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; display: grid; place-items: center; padding: 8px; }
.logo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
@page { margin: 0; }
@page cert { size: A4 landscape; margin: 0; }
@page poster { size: A4 portrait; margin: 0; }
.cert { page: cert; } .poster { page: poster; }
@media print {
  body { background: #fff; }
  .print-bar, .no-print { display: none !important; }
  .print-page { padding: 0; background: #fff; display: block; min-height: 0; }
  .cert { width: 297mm; height: 210mm; aspect-ratio: auto; box-shadow: none; border-radius: 0; }
  .poster { width: 210mm; height: 297mm; aspect-ratio: auto; box-shadow: none; border-radius: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .cols-2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 20px 30px; } .auth-inner { gap: 14px; }
  .auth-side h1 { font-size: 28px; } .auth-lead { font-size: 14px; }
  .auth-feats, .auth-float.b { display: none; }
  .auth-float.a { width: 64px; height: 82px; right: 6%; top: 10%; }
  .auth-mark { font-size: 130px; bottom: -14%; } .auth-credit { padding-top: 14px; }
  .auth-main { padding: 64px 16px 36px; justify-content: flex-start; } .auth-card { padding: 26px 20px 22px; }
  .auth-tools { top: 14px; right: 14px; }

  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 40; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.open .side { transform: none; }
  .shell.open .backdrop-nav { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .topbar b { font-size: 16px; font-weight: 800; flex: 1; }
  .main { padding: 18px 14px 40px; }
  .page-head h1 { font-size: 21px; }
  .page-head .row { margin-left: 0; width: 100%; }
  .grid2, .grid3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; gap: 10px; } .stat .si { width: 34px; height: 34px; } .stat b { font-size: 20px; }
  .toolbar .input { flex: 1 1 140px; }
  /* tabel jadi kartu */
  table.rt thead { display: none; }
  table.rt, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; }
  table.rt tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.rt td { border: 0; padding: 3px 0; display: flex; gap: 10px; }
  table.rt td::before { content: attr(data-l); flex: 0 0 38%; color: var(--muted); font-size: 12px; font-weight: 600; }
  table.rt td.actions { justify-content: flex-start; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
  table.rt td.actions::before { display: none; }
  table.rt td.actions .btn + .btn { margin-left: 0; }
  .clock .time { font-size: 28px; }
}
