/* ============================================================
   Pilkades Belik — gaya aplikasi
   ============================================================ */
:root {
  --navy-950: #08172f;
  --navy-900: #0b1f45;
  --navy-800: #0f2f6b;
  --navy-700: #173d85;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #5b6b82;
  --soft: #8a99ad;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --green: #047857;
  --green-bg: #ecfdf5;
  --red: #b91c1c;
  --red-bg: #fef2f2;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -18px rgba(15, 23, 42, .25);
  --sidebar: 268px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0; }
img, svg { vertical-align: middle; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--navy-900); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------- layout */
.layout { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(37, 99, 235, .28), transparent 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #dbe6f6;
  padding: 22px 16px 16px;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 20px; }
.brand-mark { width: 44px; height: 44px; flex: 0 0 44px; }
.brand-mark svg { width: 44px; height: 44px; display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { color: #fff; font-size: 17px; letter-spacing: -.01em; }
.brand-text span { color: #9fb3d1; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  margin: 18px 12px 6px; color: #7f94b3; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .12em; font-weight: 700;
}
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 11px;
  color: #c6d4e8; font-size: 14px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-link.active {
  background: rgba(255, 255, 255, .11);
  color: #fff; box-shadow: inset 3px 0 0 #60a5fa;
}
.ikon { width: 19px; height: 19px; flex: 0 0 19px; opacity: .9; }
.nav-badge {
  margin-left: auto; background: #f59e0b; color: #3b2600;
  font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 20px;
}

.sidebar-foot { margin-top: auto; padding-top: 22px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
  padding: 10px; border-radius: 12px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 36px;
  display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1e40af);
}
.user-chip-text { display: flex; flex-direction: column; min-width: 0; }
.user-chip-text strong { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text span { color: #9fb3d1; font-size: 11px; }
.sidebar-actions { display: flex; gap: 8px; margin-top: 10px; }
.sidebar-actions form { display: inline; }
.mini-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; cursor: pointer; padding: 6px 8px;
  color: #a9bcd8; font: inherit; font-size: 12px; border-radius: 8px;
}
.mini-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.mini-link .ikon { width: 15px; height: 15px; flex-basis: 15px; }

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 30px;
  background: rgba(243, 246, 251, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 232, 240, .8);
}
.topbar-title { display: flex; flex-direction: column; min-width: 0; }
.eyebrow { color: var(--muted); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; }
.topbar-title strong { font-size: 19px; letter-spacing: -.02em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-date { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 30px;
  border: 1px solid transparent; white-space: nowrap;
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-open { color: var(--green); background: var(--green-bg); border-color: #a7f3d0; }
.pill-closed { color: var(--red); background: var(--red-bg); border-color: #fecaca; }

.icon-btn {
  display: none; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  padding: 11px 10px; flex-direction: column; justify-content: space-between;
}
.icon-btn span { display: block; height: 2px; background: var(--navy-800); border-radius: 2px; }

.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 35; background: rgba(8, 23, 47, .5);
  backdrop-filter: blur(2px);
}

.content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 30px 40px; flex: 1; }
.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 30px 26px; color: var(--soft); font-size: 12px;
  max-width: 1440px; width: 100%; margin: 0 auto;
}

/* ---------------------------------------------------------- headings & grid */
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head-text { min-width: 220px; flex: 1; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--muted); margin-top: 5px; font-size: 13.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 17px; }
.section-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-sidebar { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 20px; align-items: start; }

/* ---------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 18px 20px 0;
}
.card-head h2, .card-head h3 { font-size: 15.5px; }
.card-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.card-body { padding: 16px 20px 20px; }
.card-body.tight { padding: 12px 14px; }
.card-foot {
  padding: 12px 20px; border-top: 1px solid var(--line); background: #fafcff;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px;
}

/* ---------------------------------------------------------- stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow);
  overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -28px; top: -32px; width: 96px; height: 96px;
  border-radius: 50%; background: var(--blue-50);
}
.stat-top { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-icon {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--blue-50); color: var(--blue-700);
}
.stat-icon .ikon { width: 17px; height: 17px; flex-basis: 17px; }
.stat-value { font-size: 28px; font-weight: 750; letter-spacing: -.03em; margin-top: 10px; }
.stat-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat-meta strong { color: var(--text); }
.stat-card.accent { background: linear-gradient(135deg, var(--navy-800), var(--navy-900)); border-color: transparent; color: #fff; }
.stat-card.accent::after { background: rgba(59, 130, 246, .25); }
.stat-card.accent .stat-top, .stat-card.accent .stat-meta { color: #b7c9e2; }
.stat-card.accent .stat-meta strong { color: #fff; }
.stat-card.accent .stat-icon { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; line-height: 1.3;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue-700); color: #fff; box-shadow: 0 6px 14px -8px rgba(29, 78, 216, .8); }
.btn-primary:hover { background: #1e40af; color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover { background: #f8fafc; color: var(--text); }
.btn-dark { background: var(--navy-900); color: #fff; }
.btn-dark:hover { background: var(--navy-800); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #065f46; color: #fff; }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; color: var(--red); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef2f7; color: var(--text); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label {
  font-size: 12.5px; font-weight: 650; color: #334155;
}
.field .hint { font-size: 11.5px; color: var(--soft); }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: #fff; color: var(--text); font: inherit; font-size: 14px;
  transition: border .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}
.textarea { min-height: 84px; resize: vertical; }
.input[readonly] { background: #f1f5f9; color: #475569; }
.input-lg { padding: 12px 14px; font-size: 16px; }

/* Kolom kata sandi dengan tombol tampil/sembunyikan */
.input-sandi { position: relative; }
.input-sandi .input { padding-right: 46px; }
.btn-mata {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--soft); cursor: pointer;
}
.btn-mata:hover { color: var(--text); background: rgba(15, 47, 107, .07); }
.btn-mata:focus-visible { outline: 3px solid rgba(29, 78, 216, .35); outline-offset: 1px; }
.btn-mata .ikon { width: 19px; height: 19px; flex-basis: 19px; }
.btn-mata .mata-tutup { display: none; }
.btn-mata[aria-pressed="true"] .mata-buka { display: none; }
.btn-mata[aria-pressed="true"] .mata-tutup { display: inline-flex; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.check input { width: 17px; height: 17px; accent-color: var(--blue-700); }
.form-actions { display: flex; gap: 9px; flex-wrap: wrap; padding-top: 6px; }
.form-error { color: var(--red); font-size: 12.5px; }

.validasi-hint {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px;
  background: #f8fafc; border: 1px solid var(--line); color: var(--muted);
}
.validasi-hint.is-ok { background: var(--green-bg); border-color: #a7f3d0; color: var(--green); }
.validasi-hint.is-warn { background: var(--amber-bg); border-color: #fde68a; color: var(--amber); }
.validasi-hint.is-bad { background: var(--red-bg); border-color: #fecaca; color: var(--red); }
.btn-lg { padding: 12px 18px; font-size: 15px; border-radius: 11px; }

/* ---------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; padding: 11px 14px; background: #f8fafc;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcff; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .center { text-align: center; }
.table tfoot td { font-weight: 750; background: #f8fafc; border-top: 2px solid var(--line); }
.table .strong { font-weight: 650; }
.table .sub { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.table-title { font-weight: 600; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; }
.table.compact td, .table.compact th { padding: 8px 10px; }

.row-details { display: block; margin-top: 5px; }
.row-details summary { list-style: none; display: inline-flex; cursor: pointer; }
.row-details summary::-webkit-details-marker { display: none; }
.row-panel {
  width: 270px; margin: 8px 0 2px auto; padding: 10px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow);
}
.row-panel label { display: block; font-size: 11.5px; font-weight: 650; margin-bottom: 5px; }
.row-panel .textarea { min-height: 68px; font-size: 12.5px; margin-bottom: 8px; }
.row-panel .btn { width: 100%; }

/* ---------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-draft { color: #b45309; background: var(--amber-bg); border-color: #fde68a; }
.badge-submitted { color: var(--blue-700); background: var(--blue-50); border-color: #bfdbfe; }
.badge-verified { color: var(--green); background: var(--green-bg); border-color: #a7f3d0; }
.badge-kosong { color: var(--muted); background: #f1f5f9; border-color: var(--line); }
.badge-admin { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
.badge-operator { color: #0e7490; background: #ecfeff; border-color: #a5f3fc; }
.badge-off { color: var(--red); background: var(--red-bg); border-color: #fecaca; }

/* ---------------------------------------------------------- alerts */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.alert {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid var(--line); background: #fff;
  font-size: 13.5px; box-shadow: var(--shadow);
}
.alert-icon {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: #e2e8f0; color: #334155;
}
.alert-success { border-color: #a7f3d0; background: #f0fdf4; }
.alert-success .alert-icon { background: var(--green); color: #fff; }
.alert-error { border-color: #fecaca; background: #fff5f5; }
.alert-error .alert-icon { background: var(--red); color: #fff; }
.alert-warning { border-color: #fde68a; background: #fffbeb; }
.alert-warning .alert-icon { background: #f59e0b; color: #fff; }
.alert-info { border-color: #bfdbfe; background: #eff6ff; }
.alert-info .alert-icon { background: var(--blue-600); color: #fff; }
.alert-close {
  margin-left: auto; border: 0; background: transparent; font-size: 20px;
  line-height: 1; cursor: pointer; color: var(--soft); padding: 0 2px;
}

/* ---------------------------------------------------------- progress */
.progress { height: 8px; border-radius: 20px; background: #e8eef7; overflow: hidden; }
.progress > span {
  display: block; height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-700));
  min-width: 0;
}
.progress.green > span { background: linear-gradient(90deg, #34d399, #059669); }
.progress.amber > span { background: linear-gradient(90deg, #fbbf24, #d97706); }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress { flex: 1; }
.progress-row .pct { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }

/* ---------------------------------------------------------- dashboard */
.desa-list { display: flex; flex-direction: column; }
.desa-row {
  display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(110px, .8fr) minmax(140px, 1fr) auto;
  gap: 16px; align-items: center; padding: 13px 20px; border-bottom: 1px solid #edf2f7;
}
.desa-row:last-child { border-bottom: 0; }
.desa-name { font-weight: 650; font-size: 13.5px; }
.desa-name span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; margin-top: 1px; }
.desa-tps { color: var(--muted); font-size: 12px; }
.desa-leader { display: flex; align-items: center; gap: 8px; min-width: 0; }
.color-dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.desa-leader-text { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desa-leader-text small { color: var(--muted); }
.desa-row .progress-row { width: 100%; }

.winner-card {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  color: #fff; border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden;
}
.winner-card::after {
  content: ""; position: absolute; right: -40px; bottom: -70px; width: 190px; height: 190px;
  border-radius: 50%; background: rgba(59, 130, 246, .22);
}
.winner-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #9fc0e8; font-weight: 700; }
.winner-name { font-size: 22px; font-weight: 750; letter-spacing: -.02em; margin-top: 8px; }
.winner-meta { color: #bcd0e9; font-size: 12.5px; margin-top: 5px; }
.winner-votes { display: flex; align-items: baseline; gap: 7px; margin-top: 16px; }
.winner-votes strong { font-size: 32px; letter-spacing: -.03em; }
.winner-votes span { color: #bcd0e9; font-size: 12px; }

.chart-bars { display: flex; flex-direction: column; gap: 12px; }
.chart-item { display: grid; grid-template-columns: minmax(110px, 1.1fr) minmax(100px, 2.2fr) 74px; gap: 10px; align-items: center; }
.chart-name { font-size: 12.5px; font-weight: 600; display: flex; gap: 7px; align-items: center; min-width: 0; }
.chart-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-track { height: 22px; background: #eef3f9; border-radius: 7px; overflow: hidden; }
.chart-fill {
  height: 100%; border-radius: 7px; min-width: 2px;
  background: var(--c, var(--blue-600));
  transition: width .5s ease;
}
.chart-value { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.chart-value strong { color: var(--text); }

.quick-list { display: flex; flex-direction: column; gap: 0; }
.quick-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid #edf2f7; font-size: 13px;
}
.quick-item:last-child { border-bottom: 0; }
.quick-item .grow { flex: 1; min-width: 0; }
.quick-item .sub { color: var(--muted); font-size: 11.5px; }
.quick-num {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--blue-50); color: var(--blue-700);
}

/* ---------------------------------------------------------- input form */
.tps-meta {
  display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 14px 20px;
  background: #f8fafc; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.tps-meta div { display: flex; flex-direction: column; gap: 1px; }
.tps-meta span { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.tps-meta strong { font-size: 14px; }

.candidate-list { display: flex; flex-direction: column; gap: 10px; }
.candidate-row {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) 130px;
  gap: 14px; align-items: center;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  border-left: 5px solid var(--c, var(--blue-600));
  transition: background .12s ease;
}
.candidate-row:focus-within { background: #fafcff; border-color: var(--line-strong); }
.candidate-num {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-weight: 800; font-size: 17px; color: #fff; background: var(--c, var(--blue-600));
}
.candidate-name { font-weight: 650; font-size: 14.5px; }
.candidate-name small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 1px; }
.candidate-row .input { text-align: right; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }

.summary-box {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.summary-line + .summary-line { border-top: 1px dashed var(--line); }
.summary-line strong { font-variant-numeric: tabular-nums; }
.summary-line.total { font-weight: 700; font-size: 14px; }
.summary-line .text-ok { color: var(--green); }
.summary-line .text-bad { color: var(--red); }

.locked-note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  border-radius: 12px; background: var(--blue-50); border: 1px solid #bfdbfe;
  color: #1e3a8a; font-size: 12.5px;
}

.tps-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tps-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  padding: 16px; display: flex; flex-direction: column; gap: 11px; box-shadow: var(--shadow);
}
.tps-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tps-card h3 { font-size: 15px; }
.tps-card .sub { color: var(--muted); font-size: 11.5px; }
.tps-card-nums { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.tps-card-nums strong { display: block; color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.tps-card .btn { width: 100%; }

/* ---------------------------------------------------------- misc */
.empty {
  text-align: center; padding: 34px 18px; color: var(--muted); font-size: 13px;
}
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty-icon {
  width: 46px; height: 46px; border-radius: 14px; margin: 0 auto 12px;
  display: grid; place-items: center; background: var(--blue-50); color: var(--blue-700); font-size: 20px;
}

.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

.note {
  padding: 11px 14px; border-left: 3px solid var(--blue-500); background: var(--blue-50);
  border-radius: 0 10px 10px 0; color: #1e3a8a; font-size: 12.5px;
}
.note.warn { border-color: #f59e0b; background: var(--amber-bg); color: #78350f; }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafcff;
}
.toolbar .grow { flex: 1; }
.toolbar .select, .toolbar .input { width: auto; min-width: 160px; }

.pagination { display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-size: 12.5px; color: var(--muted); }
.pagination .btn { padding: 6px 11px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: #eef3f9; border-radius: 10px; width: fit-content; }
.tab { padding: 7px 12px; border-radius: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(15, 23, 42, .1); }

.divider { height: 1px; background: var(--line); margin: 18px 0; }

.print-only { display: none; }

/* ---------------------------------------------------------- login */
.auth-body {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--bg);
}
.auth-brand {
  position: relative; overflow: hidden; color: #fff; padding: 54px 58px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(96, 165, 250, .35), transparent 60%),
    radial-gradient(80% 60% at 0% 100%, rgba(29, 78, 216, .45), transparent 65%),
    linear-gradient(150deg, var(--navy-900), var(--navy-950));
}
.auth-brand::after {
  content: ""; position: absolute; width: 440px; height: 440px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12); right: -160px; top: 18%;
}
.auth-brand-top { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.auth-brand-top svg { width: 46px; height: 46px; }
.auth-brand-top strong { font-size: 19px; display: block; }
.auth-brand-top span { font-size: 11px; color: #a9c0de; text-transform: uppercase; letter-spacing: .1em; }
.auth-copy { position: relative; z-index: 1; max-width: 440px; }
.auth-copy .kicker {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: #93c5fd; background: rgba(59, 130, 246, .16);
  border: 1px solid rgba(147, 197, 253, .28); padding: 5px 10px; border-radius: 30px;
}
.auth-copy h1 { font-size: clamp(30px, 3.3vw, 44px); letter-spacing: -.035em; margin-top: 18px; line-height: 1.1; }
.auth-copy p { color: #b8cce5; margin-top: 16px; font-size: 14.5px; line-height: 1.65; }
.auth-points { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; position: relative; z-index: 1; }
.auth-point { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: #d3e1f2; }
.auth-point .tick {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(52, 211, 153, .18); color: #6ee7b7; font-size: 11px; font-weight: 800;
}
.auth-foot { color: #7f97b6; font-size: 11.5px; position: relative; z-index: 1; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 25px; letter-spacing: -.025em; }
.auth-card .lead { color: var(--muted); font-size: 13.5px; margin-top: 6px; margin-bottom: 24px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn { margin-top: 6px; }
.auth-help {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; line-height: 1.6;
}
.auth-alert { margin-bottom: 18px; }

/* ---------------------------------------------------------- print */
.cetak-page { background: #e8edf4; padding: 24px 12px 40px; }
.cetak-bar { max-width: 210mm; margin: 0 auto 14px; display: flex; justify-content: space-between; gap: 10px; }
.cetak-sheet {
  max-width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; color: #000;
  padding: 18mm 16mm; box-shadow: 0 10px 40px -20px rgba(0, 0, 0, .4);
  font-family: "Times New Roman", Times, serif; font-size: 11.5pt;
}
.cetak-kop { text-align: center; border-bottom: 3px double #000; padding-bottom: 10px; margin-bottom: 16px; }
.cetak-kop h1 { font-size: 15pt; text-transform: uppercase; letter-spacing: .02em; }
.cetak-kop h2 { font-size: 13pt; text-transform: uppercase; margin-top: 3px; }
.cetak-kop p { font-size: 10pt; margin-top: 3px; }
.cetak-title { text-align: center; margin: 18px 0 6px; }
.cetak-title h3 { font-size: 13pt; text-transform: uppercase; text-decoration: underline; }
.cetak-meta { font-size: 10pt; margin-bottom: 12px; }
.cetak-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.cetak-table th, .cetak-table td { border: 1px solid #000; padding: 4px 5px; text-align: center; vertical-align: middle; }
.cetak-table th { background: #eef2f7; font-size: 8.5pt; }
.cetak-table .left { text-align: left; }
.cetak-note { font-size: 9.5pt; margin-top: 14px; line-height: 1.55; }
.cetak-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 26px; font-size: 10pt; text-align: center; }
.cetak-sign .space { height: 62px; }
.cetak-print-date { margin-top: 18px; font-size: 9.5pt; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; width: 272px; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .icon-btn { display: flex; }
  .content { padding: 22px 20px 34px; }
  .topbar { padding: 12px 20px; }
  .footer { padding: 14px 20px 24px; }
  .auth-body { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

@media (max-width: 720px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .page-actions { margin-left: 0; width: 100%; }
  .desa-row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .desa-row .progress-row { grid-column: 1 / -1; }
  .candidate-row { grid-template-columns: 38px minmax(0, 1fr) 96px; gap: 10px; }
  .candidate-num { width: 34px; height: 34px; font-size: 15px; }
  .topbar-date { display: none; }
  .chart-item { grid-template-columns: 96px minmax(80px, 1fr) 64px; }
  .tps-meta { gap: 10px 18px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .content { padding: 18px 14px 30px; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar-title strong { font-size: 16px; }
  .status-pill { font-size: 11px; padding: 4px 8px; }
  .btn { padding: 9px 12px; }
  .auth-panel { padding: 28px 18px; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .cetak-page { background: #fff; padding: 0; }
  .cetak-bar, .no-print { display: none !important; }
  .cetak-sheet {
    max-width: none; min-height: 0; width: auto; margin: 0; padding: 0;
    box-shadow: none;
  }
  .cetak-table { font-size: 8.5pt; }
}
