:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --border: #e3e7ef;
  --text: #1b2333;
  --muted: #6b7489;
  --accent: #2563eb;
  --accent-soft: #e8efff;
  --sidebar: #0f1b33;
  --sidebar-2: #16264a;
  --sidebar-text: #b9c3da;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --green: #12a150; --green-bg: #e3f7ec;
  --red: #dc2626; --red-bg: #fde8e8;
  --yellow: #b7791f; --yellow-bg: #fff6d6;
  --blue: #2563eb; --blue-bg: #e5edff;
  --magenta: #c026d3; --magenta-bg: #fbe7fd;
  --gray: #5b6478; --gray-bg: #eef0f4;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
code { background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.inline { display: inline; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; flex: none; background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: var(--sidebar-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #06b6d4); display: grid; place-items: center; color: #fff; }
.brand-logo .ic { width: 22px; height: 22px; }
.brand-name { color: #fff; font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 11.5px; opacity: .75; }
.nav { padding: 10px 12px; flex: 1; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .5; padding: 16px 10px 6px; }
.nav a, .nav-form button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 8px;
  color: var(--sidebar-text); font: inherit; background: none; border: 0; cursor: pointer; text-align: left;
}
.nav a:hover, .nav-form button:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.nav-group summary {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; list-style: none;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-group summary.has-active { color: #fff; }
.nav-caret { margin-left: auto; font-size: 11px; opacity: .6; transition: transform .15s; }
.nav-group[open] .nav-caret { transform: rotate(180deg); }
.nav a.nav-sub { padding: 8px 12px 8px 46px; font-size: 13.5px; }
.sidebar-user { display: flex; gap: 10px; align-items: center; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.06); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #334a7d; color: #fff; display: grid; place-items: center; font-weight: 700; }
.su-name { color: #fff; font-weight: 600; font-size: 13px; }
.su-role { font-size: 12px; opacity: .7; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(243,245,249,.9); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 12px; padding: 16px 28px; border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--text); }
.content { padding: 24px 28px 48px; max-width: 1500px; width: 100%; }
.backdrop { display: none; }

/* Cards & grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.card-head h3 { font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .grid-2 { margin-top: 18px; }
.grid-users { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }

.welcome { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.welcome h2 { font-size: 22px; }
.welcome p { margin: 4px 0 0; }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.c-green { color: var(--green); } .c-yellow { color: var(--yellow); } .c-red { color: var(--red); } .c-blue { color: var(--blue); } .c-magenta { color: var(--magenta); }

.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr 44px; gap: 12px; align-items: center; color: inherit; padding: 5px 6px; border-radius: 6px; }
.bar-row:hover { background: var(--bg); text-decoration: none; }
.bar-label { display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 99px; }
.bar-num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-green, .fill-green { background: var(--green); } .dot-red, .fill-red { background: var(--red); }
.dot-yellow, .fill-yellow { background: #eab308; } .dot-blue, .fill-blue { background: var(--blue); }
.dot-magenta, .fill-magenta { background: var(--magenta); } .dot-gray, .fill-gray { background: #9aa3b5; }
.fill-accent { background: linear-gradient(90deg, #3b82f6, #06b6d4); }

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-magenta { background: var(--magenta-bg); color: var(--magenta); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--gray-bg); font-size: 12.5px; }
.chip { display: inline-block; margin: 2px 4px; padding: 2px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; }

/* Buttons & forms */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
input, select, textarea {
  font: inherit; color: inherit; width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
label > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
label.check { display: flex; gap: 8px; align-items: center; }
label.check input { width: auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.alert-success { background: var(--green-bg); border-color: #b7e8cc; color: #0d6b37; }
.alert-error { background: var(--red-bg); border-color: #f6c3c3; color: #9b1c1c; }
.alert-info { background: var(--blue-bg); border-color: #c6d6ff; color: #1e40af; }

/* Search */
.search-top { display: flex; gap: 10px; flex-wrap: wrap; }
.search-box { flex: 1 1 340px; position: relative; }
.search-box .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 40px; height: 42px; }
.status-select { flex: 0 1 240px; height: 42px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; margin-top: 14px; }
.filter-grid input { padding: 7px 10px; }
.adv { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 10px; }
.adv summary { cursor: pointer; font-weight: 600; color: var(--accent); display: flex; gap: 8px; align-items: center; list-style: none; }
.adv summary::-webkit-details-marker { display: none; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tables */
.table-card { padding: 0; overflow: hidden; }
.table-card .card-head { padding: 16px 20px 0; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; position: sticky; top: 0; }
.table th a { color: inherit; }
.table tbody tr:hover { background: #f8faff; }
.table.compact td { padding: 8px 4px; }
.table tr:last-child td { border-bottom: 0; }
.row-actions a { color: var(--muted); padding: 4px; display: inline-flex; }
.row-actions a:hover { color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.pager a { padding: 6px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.pager a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.toolbar { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.toolbar label { flex: 1 1 160px; }

/* Detail */
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.detail-head h2 { font-size: 22px; margin: 2px 0 8px; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.audit-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.audit-strip > div { display: flex; flex-direction: column; border-left: 3px solid var(--accent); padding-left: 12px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; align-items: start; }
.history { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
.dl { display: grid; grid-template-columns: 220px 1fr; margin: 0; }
.dl dt, .dl dd { padding: 9px 0; border-bottom: 1px solid var(--border); margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; padding-right: 12px; }
.dl dd { word-break: break-word; }

/* Log / timeline */
.timeline, .log-list { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--blue); }
.tl-tambah { background: var(--green); } .tl-hapus { background: var(--red); } .tl-import { background: #9aa3b5; }
.log-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.log-item:last-child { border-bottom: 0; }
.log-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.log-top .tl-dot { margin-top: 0; }
.log-time { margin-left: auto; }
.tag { font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--gray-bg); }
.tag-tambah { background: var(--green-bg); color: var(--green); }
.tag-ubah { background: var(--blue-bg); color: var(--blue); }
.tag-hapus { background: var(--red-bg); color: var(--red); }
.diff { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12.5px; }
.diff th { text-align: left; color: var(--muted); font-weight: 600; width: 32%; padding: 4px 8px 4px 0; vertical-align: top; }
.diff td { padding: 4px 6px; vertical-align: top; word-break: break-word; }
.diff del { background: var(--red-bg); color: #9b1c1c; text-decoration: line-through; padding: 1px 4px; border-radius: 4px; }
.diff ins { background: var(--green-bg); color: #0d6b37; text-decoration: none; padding: 1px 4px; border-radius: 4px; }

/* Popover (kelola pengguna) */
.pop { position: relative; }
.pop summary { list-style: none; }
.pop summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; right: 0; top: 110%; width: 280px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(16,24,40,.16); padding: 14px; z-index: 10; }
.pop-body hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

/* Login */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #0b1530; position: relative; overflow: hidden; }
.login-bg { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at top, #1e3a8a 0%, transparent 60%), radial-gradient(ellipse at bottom right, #0e7490 0%, transparent 55%); }
.login-bg::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(circle at center, #000 30%, transparent 75%); }
.login-bg span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: login-float 14s ease-in-out infinite alternate; }
.login-bg span:nth-child(1) { width: 340px; height: 340px; background: #2563eb; top: -80px; left: -60px; }
.login-bg span:nth-child(2) { width: 280px; height: 280px; background: #06b6d4; bottom: -60px; right: -40px; animation-delay: -5s; }
.login-bg span:nth-child(3) { width: 200px; height: 200px; background: #7c3aed; top: 55%; left: 60%; opacity: .35; animation-delay: -9s; }
@keyframes login-float { to { transform: translate(40px, 30px) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .login-bg span { animation: none; } }
.login-wrap { position: relative; width: 100%; max-width: 400px; background: rgba(255,255,255,.97); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08); animation: login-in .45s ease-out; }
@keyframes login-in { from { opacity: 0; transform: translateY(12px); } }
.login-brand { display: flex; align-items: center; gap: 14px; padding: 22px 28px; background: linear-gradient(135deg, #2563eb, #06b6d4); color: #fff; }
.login-mark { flex: none; width: 48px; height: 48px; border-radius: 13px; background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); display: grid; place-items: center; }
.login-mark svg { width: 26px; height: 26px; }
.login-app { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.login-card { padding: 22px 28px 20px; display: flex; flex-direction: column; gap: 12px; }
.login-card label { font-weight: 600; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.login-card input:disabled { background: var(--gray-bg); color: var(--muted); cursor: not-allowed; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-card .alert { margin: 0; }
.login-btn { padding-top: 11px; padding-bottom: 11px; font-size: 15px; margin-top: 4px; background: linear-gradient(135deg, #2563eb, #1d4ed8); box-shadow: 0 6px 16px rgba(37,99,235,.35); }

/* Responsive */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .history { position: static; max-height: none; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
  .menu-btn { display: inline-flex; }
  .grid-2, .grid-users { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 12px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { border-bottom: 0; padding-bottom: 0; }
}

/* Profil */
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar-lg { width: 64px; height: 64px; font-size: 26px; background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.profile-id { flex: 1; min-width: 220px; }
.profile-id h2 { font-size: 21px; margin-bottom: 8px; }
.profile-stats { display: flex; gap: 24px; }
.profile-stats > div { display: flex; flex-direction: column; align-items: flex-start; }
.profile-stats b { font-size: 20px; }
.hint { margin: -6px 0 0; }

/* Foto */
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.foto-item { margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.foto-item a { display: block; aspect-ratio: 4 / 3; background: var(--gray-bg); }
.foto-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.foto-item a:hover img { transform: scale(1.04); }
.foto-item figcaption { padding: 6px 8px; display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.foto-del { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--red); cursor: pointer; }
.foto-del input { width: auto; }
.foto-drop { border: 2px dashed var(--border); border-radius: 12px; padding: 16px; background: #fafbfd; }
.foto-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.foto-pick { position: relative; overflow: hidden; }
.foto-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.foto-drop > p { margin: 10px 0 0; }
.foto-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.foto-preview:empty { display: none; }
.foto-new { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.foto-new-img { aspect-ratio: 4 / 3; background: var(--gray-bg) center / cover no-repeat; }
.foto-new-info { padding: 4px 8px; color: var(--green); font-weight: 600; }
.foto-new-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.foto-submit { display: flex; justify-content: flex-end; margin-top: 12px; }
.thumb-cell { position: relative; display: inline-block; width: 52px; height: 40px; border-radius: 6px; overflow: hidden; }
.thumb-cell img { width: 100%; height: 100%; object-fit: cover; }
.thumb-cell span { position: absolute; right: 2px; bottom: 2px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; padding: 0 5px; border-radius: 6px; }
.thumb-empty { display: inline-grid; place-items: center; width: 52px; height: 40px; border-radius: 6px; background: var(--gray-bg); color: #b4bccb; }
.tag-foto { background: var(--magenta-bg); color: var(--magenta); }
.tl-foto { background: var(--magenta); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8,12,24,.92); display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #222; }
.lightbox figcaption { color: #d5dbea; font-size: 13px; margin-top: 10px; text-align: center; }
.lightbox figcaption a { color: #8fb4ff; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer; border-radius: 50%; width: 48px; height: 48px; font-size: 30px; line-height: 1; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* Halaman sertifikat */
.cert-wrap { max-width: 1000px; }
.profil-cert { margin: 24px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; text-align: center; }
.profil-cert a { color: var(--muted); }
.profil-cert a:hover { color: var(--accent); }
.cert-wrap h3 { font-size: 15px; margin: 4px 0 8px; }
.cert-wrap ol { padding-left: 20px; margin: 0 0 14px; }
.cert-wrap li { margin-bottom: 6px; }
.cert-download { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-top: 18px; }
.cert-fp { word-break: break-all; }
.center { text-align: center; }

/* Webcam */
.webcam-modal { position: fixed; inset: 0; z-index: 90; background: rgba(8,12,24,.9); display: flex; align-items: center; justify-content: center; padding: 16px; }
.webcam-box { background: #fff; border-radius: 14px; width: min(760px, 100%); max-height: 100%; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.webcam-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.webcam-head select { width: auto; max-width: 100%; }
.webcam-view { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.webcam-view video { width: 100%; height: 100%; object-fit: contain; }
.webcam-view .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .25s; }
.webcam-view .flash.on { opacity: .8; transition: none; }
.webcam-msg { color: #fff; padding: 20px; text-align: center; }
.webcam-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.webcam-shoot { width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--accent); background: #fff; cursor: pointer; box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 30px var(--accent); }
.webcam-shoot:disabled { opacity: .4; cursor: not-allowed; }

/* CAPTCHA & keamanan login */
.captcha-row { display: flex; gap: 8px; align-items: stretch; }
.captcha-row img { border: 1px solid var(--border); border-radius: 8px; max-width: 100%; height: auto; }
.captcha-refresh { font-size: 20px; padding: 8px 14px; flex: 1; justify-content: center; }
.countdown { margin-top: 6px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.compact-rows td, .compact-rows th { padding: 7px 12px; }
.ua { max-width: 280px; }

/* ---------- Pencarian satu kolom ---------- */
.search-hint { margin: 10px 2px 0; }
mark { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 3px; }
.found-in { min-width: 160px; }
.chip-soft { margin: 1px 2px; background: var(--gray-bg); color: var(--gray); }

/* ---------- Tabs (Master Data) ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 16px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.tabs a:hover { text-decoration: none; border-color: var(--accent); }
.tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.table-filter { max-width: 240px; padding: 6px 10px; }
.pop-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pop-actions .ic, .badge .ic { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- Form: pilihan master & field terkunci ---------- */
.master-field { display: flex; gap: 8px; align-items: center; }
.master-field select { flex: 1; min-width: 0; }
.master-field .btn { flex: none; }
input.readonly, input[readonly] { background: var(--gray-bg); color: var(--muted); cursor: not-allowed; }

/* ---------- Modal & popup ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fadein .12s; }
.modal { background: #fff; border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 12px; padding: 20px; box-shadow: 0 24px 64px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-sm { width: min(420px, 100%); text-align: center; align-items: center; }
.modal-sm p { margin: 0; color: var(--text); }
.modal-foot { display: flex; justify-content: center; margin-top: 4px; }
.popup-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; font-weight: 800; }
.popup-warn { background: var(--yellow-bg); color: var(--yellow); }
.master-add { display: flex; gap: 8px; }
.master-add input { flex: 1; }
.master-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 120px; border: 1px solid var(--border); border-radius: 10px; }
.master-list li { display: flex; gap: 6px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.master-list li:last-child { border-bottom: 0; }
.master-list .mv { flex: 1; font-weight: 600; word-break: break-word; }
.master-msg { padding: 8px 12px; border-radius: 8px; }
.master-msg.ok { background: var(--green-bg); color: #0d6b37; }
.master-msg.err, .master-list .err { background: var(--red-bg); color: #9b1c1c; }
@keyframes fadein { from { opacity: 0; } }
@media (max-width: 640px) {
  .master-list li { flex-wrap: wrap; }
  .master-list .mv { flex-basis: 100%; }
}

/* ---------- Menu export ---------- */
.export-menu .pop-body { width: 290px; display: grid; gap: 4px; }
.export-opt { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 8px; color: var(--text); }
.export-opt:hover { background: var(--bg); text-decoration: none; }
.export-opt > span:last-child { display: grid; line-height: 1.3; }
.ext { flex: none; width: 42px; height: 30px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.ext-xlsx { background: #16a34a; }
.ext-csv { background: #64748b; }
.ext-pdf { background: #dc2626; }

/* Filter dropdown & sel yang bisa diklik di Data Inventaris */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.filter-grid label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.filter-grid select { width: 100%; }
.filter-grid select.is-active { border-color: var(--accent); background: var(--accent-soft); }
a.cell-filter { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
a.cell-filter:hover { color: var(--accent); }

/* Baris daftar yang bisa diklik ke halaman detail */
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: #f5f8ff; }
.icon-btn { background: none; border: 0; padding: 4px; display: inline-flex; cursor: pointer; color: inherit; font: inherit; }
.icon-btn.danger { color: var(--red); }

/* Status perbaikan (Input Pekerjaan) */
:root { --orange: #c2410c; --orange-bg: #ffedd5; --teal: #0f766e; --teal-bg: #ccfbf1; }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-teal { background: var(--teal-bg); color: var(--teal); }
.dot-orange, .fill-orange { background: #f97316; } .dot-teal, .fill-teal { background: #14b8a6; }
.c-orange { color: var(--orange); } .c-teal { color: var(--teal); }

/* Input Pekerjaan */
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; padding: 1px 6px; border-radius: 99px; text-align: center; }
.progress { height: 8px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; margin-top: 8px; flex: 1; min-width: 80px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #12a150); border-radius: 99px; }
.progress-row { display: flex; align-items: center; gap: 8px; }
.progress-row .progress { margin-top: 0; }
.card-attention { border-color: #fca5a5; box-shadow: 0 0 0 3px #fee2e2; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list > li { padding: 10px 0; border-top: 1px solid var(--border); }
.plain-list > li:first-child { border-top: 0; }
.ajakan-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ajakan-box { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.radio-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.radio-row > span { font-weight: 600; font-size: 13px; }
.tabs-inline { margin-bottom: 0; }
tr.row-selected td { background: var(--green-bg); }

/* Dashboard pekerjaan: 7 kotak statistik, rentang tanggal bebas */
@media (min-width: 1201px) { .stats.stats-7 { grid-template-columns: repeat(7, 1fr); } }
.toolbar .rentang-tgl { flex: 0 1 160px; }
.rekap-note { padding: 0 18px 14px; }
.foto-tambah { margin-bottom: 12px; }
.foto-tambah summary { list-style: none; cursor: pointer; }
.foto-tambah summary::-webkit-details-marker { display: none; }
.foto-tambah[open] summary { margin-bottom: 12px; }
.foto-tambah[open] ~ .foto-grid, .foto-tambah[open] ~ p { display: none; }

/* Lonceng notifikasi pekerjaan (topbar) */
.notif { position: relative; }
.notif-btn { list-style: none; cursor: pointer; position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; color: var(--text); background: #fff; border: 1px solid var(--border); }
.notif-btn::-webkit-details-marker { display: none; }
.notif-btn svg { width: 20px; height: 20px; }
.notif-btn:hover { background: var(--gray-bg); }
.notif-badge { position: absolute; top: -5px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.notif-badge[hidden] { display: none; }
/* Berdenyut & lonceng bergoyang hanya bila ada yang mendesak (belum dimulai, tertunda jatuh tempo, ajakan join/oper). */
.notif-mendesak .notif-badge { animation: notif-denyut 1.4s ease-in-out infinite; }
.notif-mendesak .notif-btn svg { animation: notif-goyang 2.8s ease-in-out infinite; transform-origin: 50% 10%; color: #dc2626; }
@keyframes notif-denyut { 0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 0 rgba(220,38,38,.55); } 50% { box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(220,38,38,0); } }
@keyframes notif-goyang { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-5deg); } }
@media (prefers-reduced-motion: reduce) { .notif-mendesak .notif-badge, .notif-mendesak .notif-btn svg { animation: none; } }
.notif-body { left: 0; right: auto; width: 360px; max-width: calc(100vw - 32px); padding: 0; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.notif-list li + li { border-top: 1px solid var(--border); }
.notif-list a { display: flex; flex-direction: column; gap: 3px; padding: 10px 14px; color: inherit; text-decoration: none; }
.notif-list a:hover { background: var(--gray-bg); }
.notif-list li.mendesak { background: #fef2f2; }
.notif-list .badge { align-self: flex-start; }
.notif-kosong { padding: 18px 14px; color: var(--muted); text-align: center; }
@media (max-width: 900px) { .notif-body { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; } }

/* ---------- Antrian pekerjaan ---------- */
.nav-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); margin-left: 6px; flex: none; box-shadow: 0 0 0 2px rgba(220, 38, 38, .25); }
.nav-badge[hidden], .nav-dot[hidden] { display: none; }
.ubah-pk > summary { list-style: none; display: inline-flex; }
.ubah-pk > summary::-webkit-details-marker { display: none; }
.ubah-pk[open] > summary { margin-bottom: 12px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; margin: 6px 0; }
.lama-antri { color: var(--red); }
.tugaskan-form { display: flex; gap: 6px; align-items: center; }
.tugaskan-form select { min-width: 170px; }
.modal-foot .btn + .btn { margin-left: 8px; }
