/* ==============================================================
   ADMIN — Pengetahuan sebagai Daya
   Nuansa lebih presisi & data-dense dibanding wizard publik:
   instrumen kerja, bukan pengalaman perayaan.
   ============================================================== */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #1A2421; --canvas: #F4F7F6; --surface: #FFFFFF; --muted: #5C6B66; --line: #DCE7E2;
  --teal-900: #0B3D3A; --teal-700: #0F5C58; --teal-100: #DCF0EC;
  --gold-700: #9C7A1E; --gold-100: #FBF1D2;
  --sprout-600: #3F8F5F; --sprout-100: #E1F3E8;
  --red-700: #B4262A; --red-100: #FBE2E2;
  --font-display: 'Fraunces', serif; --font-body: 'Inter', sans-serif; --font-mono: 'IBM Plex Mono', monospace;
  --radius-sm: 8px; --radius-md: 14px;
  --shadow-card: 0 1px 2px rgba(15,45,42,0.05), 0 6px 18px rgba(15,45,42,0.06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); background: var(--canvas); color: var(--ink); line-height: 1.5; }
h1, h2 { font-family: var(--font-display); color: var(--teal-900); margin: 0; }
a { color: var(--teal-700); text-decoration: none; }
:focus-visible { outline: 3px solid var(--teal-700); outline-offset: 2px; }

.admin-shell { max-width: 1080px; margin: 0 auto; padding: 28px 20px 80px; }

.admin-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.admin-eyebrow { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--teal-700); margin-bottom: 4px; }
.admin-header h1 { font-size: 26px; }
.admin-user { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); }

.role-badge { font-family: var(--font-mono); font-size: 11px; padding: 5px 10px; border-radius: 999px; font-weight: 600; }
.role-cces { background: var(--teal-100); color: var(--teal-900); }
.role-lokadaya { background: var(--gold-100); color: var(--gold-700); }
.role-super_admin { background: var(--teal-900); color: #fff; }

.notice-box { background: var(--gold-100); color: #6b5310; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13.5px; margin-bottom: 20px; }
.error-box { background: var(--red-100); color: var(--red-700); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
@media (max-width: 720px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--surface); border-radius: var(--radius-md); padding: 16px 18px; box-shadow: var(--shadow-card); }
.stat-card.highlight { background: var(--teal-900); }
.stat-card.highlight .stat-value, .stat-card.highlight .stat-label { color: #fff; }
.stat-value { font-family: var(--font-mono); font-size: 24px; font-weight: 600; color: var(--teal-900); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.panel { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 20px; margin-bottom: 20px; }
.panel h2 { font-size: 17px; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-head h2 { margin-bottom: 0; }

.filter-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-row input, .filter-row select {
  padding: 9px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-size: 13.5px; font-family: var(--font-body);
}
.filter-row input { flex: 1; min-width: 180px; }

.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th { text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 2px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cell-org { font-weight: 600; white-space: normal; min-width: 160px; }
.muted-cell { color: var(--muted); }
.empty-cell { text-align: center; color: var(--muted); padding: 30px !important; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }

.badge { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; display: inline-block; }
.badge-muted { background: #EEF2F0; color: var(--muted); }
.badge-gold { background: var(--gold-100); color: var(--gold-700); }
.badge-green { background: var(--sprout-100); color: var(--sprout-600); }

.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pagination a { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; color: var(--ink); }
.pagination a.active { background: var(--teal-700); color: #fff; border-color: var(--teal-700); }

.kv-table { width: 100%; border-collapse: collapse; }
.kv-table th { text-align: left; padding: 10px 12px; font-size: 12.5px; color: var(--muted); vertical-align: top; width: 180px; border-bottom: 1px solid var(--line); }
.kv-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.answer-list { margin: 0; padding-left: 18px; }

.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px; border-radius: 999px;
  padding: 10px 18px; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: transform .15s ease, background .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--teal-700); color: #fff; }
.btn-primary:hover { background: var(--teal-900); }
.btn-ghost { background: transparent; color: var(--teal-700); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--teal-700); }
.btn-danger { background: transparent; color: var(--red-700); border: 1.5px solid var(--red-100); }
.btn-danger:hover { background: var(--red-100); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }

.field-group { margin-bottom: 14px; }
.field-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field-group input { width: 100%; padding: 11px 13px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); font-size: 14px; font-family: var(--font-body); }

.admin-login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--canvas);
  background-image: radial-gradient(ellipse 800px 500px at 20% 0%, rgba(15,92,88,0.07), transparent); }
.login-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-card); padding: 36px 32px; width: 100%; max-width: 380px; }
.login-eyebrow { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--teal-700); margin-bottom: 8px; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 22px; }

.empty-state { text-align: center; padding: 60px 20px; max-width: 480px; margin: 0 auto; }
.empty-state h1 { font-size: 22px; margin-bottom: 10px; }
.empty-state p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

.cluster-card { border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 16px; background: #FBFDFC; }
.cluster-card-head { font-size: 14.5px; margin-bottom: 12px; color: var(--teal-900); }

.admin-nav { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-nav a { padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); }
.admin-nav a.active { background: var(--teal-700); color: #fff; border-color: var(--teal-700); }

.chart-panel { margin-bottom: 24px; }
.chart-panel canvas { max-height: 260px; }
.stat-mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat-mini { background: var(--canvas); border-radius: var(--radius-sm); padding: 12px 14px; text-align: center; }
.stat-mini-value { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--teal-900); }
.stat-mini-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

.network-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.network-legend span { display: inline-flex; align-items: center; gap: 6px; }
.network-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Pemilih target broadcast (admin/broadcast.php) */
.target-picker { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.target-option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px;
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.target-option:hover { border-color: var(--teal-700); background: rgba(15,92,88,0.03); }
.target-option:has(input:checked) { border-color: var(--teal-700); background: var(--teal-100); }
.target-option input[type="radio"] { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; accent-color: var(--teal-700); }
.target-option-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.target-option-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.target-sub-panel {
  margin-left: 30px; padding: 10px 0 0 14px;
  border-left: 2px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.target-checkbox-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 6px 4px; border-radius: 8px; }
.target-checkbox-row:hover { background: var(--canvas); }
.target-checkbox-row input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--teal-700); }

.org-picker-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px; background: var(--surface); }
.org-picker-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.org-picker-row:last-child { border-bottom: none; }
.org-picker-row input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--teal-700); }
.org-search-input { width: 100%; max-width: 360px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 13.5px; margin-bottom: 10px; }
