/* =====================================================================
   SIMAGANG – UI stylesheet (tanpa framework, ramah CSP)
   ===================================================================== */
:root {
  --primary: #0f5d9c;
  --primary-soft: color-mix(in srgb, var(--primary) 12%, #fff);
  --primary-dark: color-mix(in srgb, var(--primary) 80%, #000);
  --bg: #f3f6fa;
  --card: #ffffff;
  --text: #1c2533;
  --muted: #6b7686;
  --border: #e3e8ef;
  --success: #15803d; --success-soft: #dcfce7;
  --warning: #b45309; --warning-soft: #fef3c7;
  --danger: #b91c1c;  --danger-soft: #fee2e2;
  --info: #0369a1;    --info-soft: #e0f2fe;
  --purple: #7e22ce;  --purple-soft: #f3e8ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.05);
  --sidebar-w: 260px;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }
h3 { font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
p { margin: 0 0 .75rem; }
code { background: #eef2f7; padding: 1px 6px; border-radius: 6px; font-size: .85em; }
.ic { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; }
.big { font-size: 1.4rem; }
.pre { white-space: pre-line; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: #0f1b2d; color: #c9d3e1; position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column; z-index: 40; transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand img { width: 42px; height: 42px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; }
.brand strong { color: #fff; display: block; font-size: 1.05rem; letter-spacing: .3px; }
.brand small { color: #8fa0b8; font-size: .75rem; }
.nav { flex: 1; overflow-y: auto; padding: .5rem .7rem; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: #6c7d96; margin: 1rem .6rem .35rem; }
.nav a {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 10px; color: #c9d3e1;
  font-size: .92rem; margin-bottom: 2px; text-decoration: none;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 45%, transparent); }
.nav-badge { margin-left: auto; background: #ef4444; color: #fff; font-style: normal; font-size: .7rem; padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.nav-logout { padding: .7rem; border-top: 1px solid rgba(255,255,255,.07); }
.nav-logout button { width: 100%; display: flex; gap: .7rem; align-items: center; background: none; border: 0; color: #f8a5a5; padding: .6rem .75rem; border-radius: 10px; cursor: pointer; font: inherit; }
.nav-logout button:hover { background: rgba(239,68,68,.12); }
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 1rem; padding: .7rem 1.5rem; min-height: 64px;
}
.topbar-title { font-weight: 600; font-size: 1.05rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.user-chip { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none !important; }
.user-chip img, .user-chip .avatar { width: 38px; height: 38px; }
.user-chip b { display: block; font-size: .88rem; }
.user-chip small { color: var(--muted); font-size: .75rem; }
.icon-btn { background: none; border: 0; padding: .3rem; cursor: pointer; color: var(--text); }
.mobile-only { display: none; }
.content { padding: 1.5rem; flex: 1; max-width: 1400px; width: 100%; }
.footer { padding: 1rem 1.5rem; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--border); }
.backdrop { display: none; }

/* ---------- Avatar & person ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; object-fit: cover; flex-shrink: 0;
}
img.avatar { background: #ddd; }
.avatar-xl { width: 84px; height: 84px; font-size: 1.6rem; }
.person { display: flex; align-items: center; gap: .65rem; }
.person b { display: block; font-size: .92rem; }
.person small { color: var(--muted); font-size: .78rem; display: block; }

/* ---------- Card ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.card.narrow { max-width: 560px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + * { margin-top: 1.25rem; }
.grid-form-list { grid-template-columns: minmax(300px, 420px) 1fr; align-items: start; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1rem; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none !important;
  transition: background .15s, transform .05s, box-shadow .15s; white-space: nowrap; line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.93); }
.btn-danger-outline { background: #fff; border-color: #f3c2c2; color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-soft); }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .85rem 1.3rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-group, .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions { margin-top: 1rem; }
.actions form, .actions-cell form, .btn-col form, .lb-foot form { display: inline; margin: 0; }
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin: 1px; }
.btn-col { display: flex; gap: .3rem; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1rem; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.span-2 { grid-column: span 2; }
.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .35rem; }
label { font-size: .86rem; font-weight: 600; color: #334155; }
input, select, textarea {
  font: inherit; font-size: .92rem; padding: .58rem .75rem; border: 1px solid #cfd7e2; border-radius: 10px; background: #fff; color: var(--text); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input[readonly] { background: #f5f7fa; color: var(--muted); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
input[type=color] { width: 60px; height: 40px; padding: 2px; }
input[type=file] { padding: .45rem; background: #fafbfc; }
textarea { resize: vertical; }
.input-group { display: flex; } .input-group input { border-radius: 10px 0 0 10px; } .input-group .btn { border-radius: 0 10px 10px 0; }
.input-row { display: flex; gap: .5rem; align-items: center; }
.fieldset { border: 1px dashed var(--border); border-radius: 12px; padding: 1rem; margin: 0 0 1rem; }
.fieldset legend { font-weight: 600; padding: 0 .4rem; display: flex; align-items: center; gap: .4rem; font-size: .9rem; }
.switch { display: flex; align-items: center; gap: .55rem; font-weight: 500; cursor: pointer; margin: .4rem 0; }
.switch input { width: 18px; height: 18px; }
.toggle-list { display: grid; gap: .2rem; margin: .5rem 0 1rem; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.checks label { font-weight: 500; display: flex; gap: .35rem; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg label { padding: .5rem 1.2rem; display: flex; gap: .4rem; align-items: center; cursor: pointer; font-weight: 500; }
.seg label + label { border-left: 1px solid var(--border); }
.preview { max-width: 140px; border-radius: 10px; margin-top: .4rem; }
.hp-field { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.pw-meter { height: 6px; background: #eef2f7; border-radius: 99px; overflow: hidden; margin: -.5rem 0 1rem; }
.pw-meter span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* ---------- Filters / page head ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head p { margin: 0; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-width: 140px; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .7rem 1rem; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Alerts & badges ---------- */
.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .92rem; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: #14532d; border-color: #bbf7d0; }
.alert-danger { background: var(--danger-soft); color: #7f1d1d; border-color: #fecaca; }
.alert-warning { background: var(--warning-soft); color: #78350f; border-color: #fde68a; }
.alert-info { background: var(--info-soft); color: #0c4a6e; border-color: #bae6fd; }
.badge { display: inline-block; padding: .18rem .6rem; border-radius: 99px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-muted { background: #eef2f7; color: #64748b; }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -1.25rem; padding: 0 1.25rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; padding: .6rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .7rem .6rem; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.table tbody tr:hover { background: #fafbfd; }
.table .num { text-align: right; }
.row-muted { opacity: .55; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem !important; }
.inline-form { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form select, .inline-form input { width: auto; padding: .35rem .5rem; font-size: .82rem; }
.inline-form input { min-width: 110px; flex: 1; }
.mini-meta { display: flex; gap: .3rem; align-items: center; color: var(--muted); }
.link-icon { display: inline-flex; color: var(--primary); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.pagination a, .pagination .active { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: .85rem; }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .muted { margin-left: .5rem; }

/* ---------- Dashboard ---------- */
.hello { margin-bottom: 1.25rem; }
.hello h1 { font-size: 1.5rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; gap: .85rem; align-items: center; box-shadow: var(--shadow); }
.stat b { font-size: 1.45rem; display: block; line-height: 1.1; }
.stat small { color: var(--muted); font-size: .8rem; }
.stat-ic { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-ic.success { background: var(--success-soft); color: var(--success); }
.stat-ic.warning { background: var(--warning-soft); color: var(--warning); }
.stat-ic.info { background: var(--info-soft); color: var(--info); }
.stat-ic.danger { background: var(--danger-soft); color: var(--danger); }
.stat-ic.purple { background: var(--purple-soft); color: var(--purple); }
.stat-ic.primary { background: var(--primary-soft); color: var(--primary); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.quick-item { display: flex; align-items: center; gap: .75rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; color: var(--text); text-decoration: none !important; box-shadow: var(--shadow); }
.quick-item:hover { border-color: var(--primary); }
.quick-item span { flex: 1; font-weight: 500; }
.quick-item b { background: var(--primary); color: #fff; border-radius: 99px; padding: .1rem .65rem; font-size: .85rem; }
.today-times { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.today-times > div { background: #f6f8fb; border-radius: 12px; padding: .85rem 1rem; display: flex; flex-direction: column; }
.today-times strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.today-times small { color: var(--muted); font-size: .78rem; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: .45rem 1rem; margin: 0 0 1rem; font-size: .9rem; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 500; }
.progress { height: 10px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.progress.sm { height: 7px; }
.progress.ok span { background: var(--success); } .progress.mid span { background: #f59e0b; } .progress.low span { background: var(--danger); }
.progress-label { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .35rem; }
.announce { padding: .85rem 0; border-bottom: 1px solid #eef1f5; }
.announce:last-child { border: 0; }
.announce h4 { margin-bottom: .2rem; }
.announce p { margin: .4rem 0 0; font-size: .92rem; }
.profile-head { display: flex; gap: 1.25rem; align-items: center; }
.profile-head p { margin: 0; }

/* ---------- Absen ---------- */
.big-clock { font-size: 3rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; color: var(--primary); margin: .5rem 0 1rem; letter-spacing: 1px; }
.thumbs { display: flex; gap: .75rem; }
.thumbs figure { margin: 0; text-align: center; font-size: .8rem; color: var(--muted); }
.thumbs img { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; }
.geo-box { display: flex; gap: .5rem; align-items: center; padding: .75rem 1rem; border-radius: 10px; background: #f6f8fb; margin-bottom: 1rem; font-size: .9rem; }
.geo-box.ok { background: var(--success-soft); color: #14532d; }
.geo-box.bad { background: var(--danger-soft); color: #7f1d1d; }
.geo-box.warn { background: var(--warning-soft); color: #78350f; }
.camera { background: #0f172a; border-radius: 14px; overflow: hidden; margin-bottom: 1rem; position: relative; }
.camera video, .camera img { width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover; transform: scaleX(-1); background: #0f172a; }
.camera img { transform: none; }
.camera-actions { display: flex; gap: .5rem; justify-content: center; padding: .75rem; background: #111827; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state .ic { color: #cbd5e1; margin-bottom: .5rem; }
.empty-state.ok .ic { color: var(--success); }
.empty-state h3 { justify-content: center; color: var(--text); }

/* ---------- Logbook ---------- */
.timeline { display: grid; gap: 0; }
.lb-item { border-left: 4px solid var(--border); }
.lb-menunggu { border-left-color: #f59e0b; } .lb-disetujui { border-left-color: var(--success); } .lb-revisi { border-left-color: var(--danger); }
.lb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .6rem; }
.lb-item h4 { font-size: 1rem; }
.lb-foot { display: flex; gap: .4rem; flex-wrap: wrap; }
.note { background: #f8fafc; border-left: 3px solid var(--primary); padding: .55rem .8rem; border-radius: 6px; font-size: .88rem; margin: .5rem 0; }
.lb-review { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--border); }
.lb-review input { flex: 1; min-width: 200px; padding: .4rem .6rem; font-size: .85rem; }
.bulk-bar { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1.25rem; gap: 1rem; flex-wrap: wrap; }
.bulk-bar label { display: flex; gap: .4rem; align-items: center; }
.list-item { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid #eef1f5; }
.list-item:last-child { border: 0; }
.list-item p { margin: .3rem 0; }
.list-item .right { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.list-item .right.btn-col { flex-direction: row; align-items: flex-start; }

/* ---------- Penilaian ---------- */
.score-list { display: grid; gap: .5rem; margin-bottom: 1rem; }
.score-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid #f1f4f8; }
.score-row input { width: 100px; text-align: center; }
.score-avg { text-align: right; font-size: 1.05rem; margin-bottom: 1rem; }
.score-avg b { font-size: 1.5rem; color: var(--primary); }

/* ---------- Unit ---------- */
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.unit-grid .card { margin: 0; }
.unit-card.disabled { opacity: .6; }
.unit-card h3 { margin-top: .4rem; }
.unit-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; font-size: .83rem; color: #475569; }
.unit-meta span { display: flex; gap: .35rem; align-items: center; }

/* ---------- Settings ---------- */
.logo-preview { width: 120px; height: 120px; border: 1px dashed var(--border); border-radius: 14px; display: flex; align-items: center; justify-content: center; padding: .6rem; background: #fafbfc; }
.logo-preview img { max-height: 100%; object-fit: contain; }
.logo-preview.sm { width: 64px; height: 64px; }
.swatches { display: flex; gap: .4rem; margin-top: .5rem; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.sec-list { background: #f8fafc; border-radius: 12px; padding: 1rem 1.25rem; }
.sec-list ul { margin: 0; padding-left: 1.2rem; font-size: .88rem; }
.sec-list li { margin-bottom: .3rem; }

/* ---------- Login ---------- */
.login-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-hero {
  background: radial-gradient(1200px 600px at -10% -10%, color-mix(in srgb, var(--primary) 70%, #fff) 0%, transparent 60%), linear-gradient(150deg, var(--primary) 0%, var(--primary-dark) 60%, #0b1324 100%);
  color: #fff; display: flex; align-items: center; justify-content: center; padding: 3rem; position: relative; overflow: hidden;
}
.login-hero::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.05); right: -120px; bottom: -120px; }
.hero-inner { max-width: 460px; position: relative; z-index: 1; }
.hero-logo { width: 88px; height: 88px; object-fit: contain; background: #fff; border-radius: 22px; padding: 8px; margin-bottom: 1.5rem; }
.login-hero h1 { font-size: 2.4rem; letter-spacing: .5px; }
.login-hero .lead { font-size: 1.1rem; opacity: .9; }
.login-hero .inst { font-weight: 600; opacity: .85; margin-bottom: 2rem; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.hero-points li { display: flex; gap: .7rem; align-items: center; background: rgba(255,255,255,.08); padding: .7rem 1rem; border-radius: 12px; }
.login-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.login-card { width: 100%; max-width: 400px; padding: 2rem; }
.login-card h2 { font-size: 1.5rem; }
.login-logo-sm { display: none; width: 64px; height: 64px; object-fit: contain; margin: 0 auto 1rem; }

/* ---------- Error / installer ---------- */
.error-page, .install-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; }
.error-box { text-align: center; max-width: 460px; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: .5rem; }
.install-box { max-width: 760px; width: 100%; }
.install-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.install-head img { width: 56px; }
.install-box h3 { margin-top: 1.5rem; }
.req { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; font-size: .9rem; }
.req .ok { color: var(--success); } .req .bad { color: var(--danger); font-weight: 600; }

/* ---------- Print ---------- */
.print-page { background: #e5e7eb; }
.print-toolbar { position: sticky; top: 0; display: flex; gap: .5rem; justify-content: center; padding: .75rem; background: #111827; z-index: 5; }
.print-filter { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; margin-bottom: 1rem; font-size: .85rem; }
.print-filter label { display: flex; gap: .35rem; align-items: center; font-weight: 500; }
.print-filter input[type=date] { width: auto; padding: .3rem .5rem; }
.paper { background: #fff; width: 210mm; min-height: 297mm; margin: 1.5rem auto; padding: 16mm 16mm 20mm; box-shadow: 0 10px 40px rgba(0,0,0,.15); font-size: 11pt; color: #000; font-family: "Times New Roman", Georgia, serif; }
.paper h3, .paper h4 { font-family: inherit; display: block; }
.paper h3 { font-size: 13pt; margin: 1rem 0 .25rem; }
.paper h4 { font-size: 11.5pt; margin: 1.2rem 0 .4rem; }
.kop { display: flex; align-items: center; gap: 16px; border-bottom: 3px double #000; padding-bottom: 10px; margin-bottom: 8px; }
.kop img { width: 78px; height: 78px; object-fit: contain; }
.kop div { flex: 1; text-align: center; }
.kop h2 { font-size: 15pt; margin: 0 0 2px; letter-spacing: .5px; }
.kop p { margin: 0; font-size: 10pt; }
.ident { width: 100%; font-size: 10.5pt; margin: .75rem 0; border-collapse: collapse; }
.ident td { padding: 2px 4px; vertical-align: top; }
.ident td:nth-child(odd) { width: 17%; white-space: nowrap; }
.ptable { width: 100%; border-collapse: collapse; font-size: 10pt; margin-bottom: .5rem; }
.ptable th, .ptable td { border: 1px solid #000; padding: 4px 6px; vertical-align: top; }
.ptable th { background: #eef2f7; text-align: center; }
.ptable .c, .ptable tr.c td { text-align: center; }
.ptable .r { text-align: right; }
.ptable.nilai { width: 70%; }
.ttd-wrap { display: flex; justify-content: flex-end; margin-top: 2rem; page-break-inside: avoid; }
.ttd-wrap.two { justify-content: space-between; }
.ttd { width: 45%; text-align: center; }
.ttd p { margin: 0; }
.ttd-space { height: 70px; }
.print-meta { margin-top: 2rem; font-family: system-ui, sans-serif; font-size: 8pt !important; }

@media print {
  @page { size: A4; margin: 12mm; }
  body, .print-page { background: #fff !important; }
  .no-print, .print-toolbar, .sidebar, .topbar, .footer { display: none !important; }
  .paper { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .ptable tr { page-break-inside: avoid; }
  .main { margin: 0 !important; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-form-list { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 35; }
  .main { margin-left: 0; }
  .mobile-only { display: inline-flex; }
  .grid-2 { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-logo-sm { display: block; }
  .paper { width: 100%; padding: 6mm; }
}
@media (max-width: 640px) {
  :root { font-size: 14px; }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
  .hide-sm { display: none !important; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .filters { width: 100%; }
  .filters input, .filters select { flex: 1; min-width: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .card { padding: 1rem; }
  .table-wrap { margin: 0 -1rem; padding: 0 1rem; }
  .dl { grid-template-columns: 105px 1fr; }
  .unit-meta { grid-template-columns: 1fr; }
  .big-clock { font-size: 2.4rem; }
  .req { grid-template-columns: 1fr; }
  .ttd-wrap.two { flex-direction: row; }
}
