@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #f8fafc;
  --white: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --border: #e5e7eb;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --radius: 8px;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

/* Disembunyikan sampai token divalidasi ke backend — dibuka lewat body.access-granted
   supaya tidak ada sedikit pun struktur halaman yang sempat ke-render kalau token salah. */
.app-shell { display: none; min-height: 100vh; align-items: flex-start; }
body.access-granted .app-shell { display: flex; }

.invalid-token-overlay {
  position: fixed;
  inset: 0;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}

.invalid-token-box { max-width: 420px; text-align: center; }

.invalid-token-box p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 8px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  padding: 0 6px;
  margin-bottom: 14px;
}

.sidebar-logo {
  display: block;
  height: 22px;
  width: auto;
  margin-bottom: 4px;
}

.sidebar-brand-sub {
  display: block;
  font-weight: 800;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  /* Lebar di-set lewat JS (fitBrandLabelToLogo di common.js) supaya sama persis
     dengan lebar render logo, lalu inter-character justify meregangkan hurufnya. */
  text-align: justify;
  text-align-last: justify;
  text-justify: inter-character;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; overflow-y: auto; }

.sidebar-link {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.3;
}

.sidebar-link:hover { background: #f1f5f9; color: var(--text); }

.sidebar-link.active { background: var(--accent-soft); color: var(--accent); }

.sidebar-link-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #fef3c7;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  text-align: center;
}

.impersonation-banner .btn { padding: 6px 14px; font-size: 12px; }

.sidebar-badge {
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
}

.sidebar-badge strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  margin-top: 2px;
}

.main-content { flex: 1; min-width: 0; padding: 18px 22px 48px; }

/* Halaman data (Try Out/Kerjasama/Komisi Referal) memakai panel putih polos
   yang menyatu langsung dengan sidebar, bukan card terpisah di atas bg abu-abu. */
.main-content--flush { background: var(--white); }
.table-panel { overflow: hidden; }

.mobile-menu-toggle { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 720px) {
  /* Di mobile, sidebar tetap sidebar (bukan jadi topbar) — cuma disembunyikan
     sebagai drawer di luar layar, dibuka lewat tombol garis tiga (hamburger). */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--white);
    box-shadow: var(--shadow);
    font-size: 18px;
    line-height: 1;
    color: var(--text);
    z-index: 10001;
    cursor: pointer;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    max-width: 80vw;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 10000;
    box-shadow: var(--shadow);
  }

  body.sidebar-open .sidebar { transform: translateX(0); }

  /* Tombol hamburger nutupin logo/Partnership begitu drawer kebuka — sembunyikan
     aja, nutup drawer masih bisa lewat tap backdrop atau klik link menu. */
  body.sidebar-open .mobile-menu-toggle { display: none; }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

  .main-content { padding: 72px 16px 48px; }
  .state-box { min-height: 260px; }
  .home-cards { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; min-width: 920px; }

th, td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-size: 12.5px;
}

th {
  background: #f1f5f9;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbff; }

.status-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.status-verified { background: #dcfce7; color: #166534; }
.status-pending { background: #fef9c3; color: #854d0e; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-progress { background: #dbeafe; color: #1e40af; }
.status-account { background: #fae8ff; color: #86198f; }
.status-other { background: #e0e7ff; color: #3730a3; }

.muted-cell { color: var(--muted); }

.note-cell {
  color: #991b1b;
  font-style: italic;
  white-space: normal;
  min-width: 260px;
}

.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 220px;
  padding: 16px;
  color: var(--muted);
}

.state-box.error { color: #b91c1c; }

.state-box h2 {
  font-size: 16px;
  margin: 0 0 8px;
  color: inherit;
}

/* Logo Lenterago dipakai sebagai CSS mask, lalu gradient di belakangnya
   digeser (kilatan cahaya/shimmer) — dipakai selagi data tabel masih di-fetch. */
.loading-logo {
  width: 160px;
  aspect-ratio: 2550 / 675;
  margin: 0 auto;
  -webkit-mask-image: url("/assets/lenterago-logo.svg");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url("/assets/lenterago-logo.svg");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  background: linear-gradient(100deg, #cbd5e1 30%, #eef2ff 45%, #ffffff 50%, #eef2ff 55%, #cbd5e1 70%);
  background-size: 220% 100%;
  animation: loading-logo-shimmer 1.4s ease-in-out infinite;
}

@keyframes loading-logo-shimmer {
  0% { background-position: 160% 0; }
  100% { background-position: -60% 0; }
}

.footer-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}

.toolbar label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.toolbar select {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.home-hero { margin-bottom: 14px; }
.home-hero h1 { font-size: 16px; margin: 0 0 2px; }
.home-hero p { margin: 0; color: var(--muted); max-width: 620px; }

.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.home-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}

.home-card:hover { border-color: var(--accent); }

.home-card h3 { margin: 0 0 4px; font-size: 13px; color: var(--accent); }
.home-card p { margin: 0; color: var(--muted); font-size: 12px; }

/* ---- Forms & buttons (login, admin) ---- */
.form-field { margin-bottom: 10px; }

.form-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 3px;
}

.form-field input, .form-field select {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
}

.form-field input:focus, .form-field select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 600;
  font-size: 12.5px;
  border-radius: 6px;
  padding: 6px 12px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary { background: var(--white); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f1f5f9; }

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  display: block;
}

.password-field { position: relative; }
.password-field input { padding-right: 40px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover { color: var(--text); }

.form-error { color: #b91c1c; font-size: 11.5px; margin: -4px 0 8px; min-height: 12px; }
.form-note { color: var(--muted); font-size: 12px; margin-top: 14px; }

.form-group-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 16px 0 8px;
}
.form-group-label:first-child { margin-top: 0; }

/* ---- Halaman login (di luar app-shell/sidebar) ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 340px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 22px;
}

.auth-logo { display: block; height: 26px; margin: 0 auto 18px; }
.auth-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; text-align: center; }
.auth-subtitle { font-size: 12px; color: var(--muted); margin: 0 0 16px; text-align: center; }

/* ---- Info user + menu profil di sidebar ---- */
.sidebar-user {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  position: relative;
}

.sidebar-user-name-wrap { position: relative; }

.sidebar-user-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  word-break: break-word;
}

.sidebar-user-name:hover { color: var(--accent); }
.sidebar-user-name .chevron { flex-shrink: 0; font-size: 10px; color: var(--muted); }

.sidebar-user-role { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 2px 0 10px; }
.sidebar-logout { width: 100%; }

.sidebar-user-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 20;
}

.sidebar-user-menu-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.sidebar-user-menu-item:hover { background: var(--accent-soft); color: var(--accent); }
.sidebar-user-menu-item + .sidebar-user-menu-item { border-top: 1px solid var(--border); }

/* ---- Panel admin (Kelola Partner / Kelola Admin) ---- */
.admin-panel { padding: 0; }
.admin-panel h1 { font-size: 16px; margin: 0 0 2px; }
.admin-panel .subtitle { color: var(--muted); font-size: 12px; margin: 0 0 12px; }

.admin-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-panel-header .subtitle { margin-bottom: 0; }

.inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.inline-checkbox input { cursor: pointer; }

/* ---- Toggle geser 2 opsi (mis. pilih skema Video / Grup WA) ---- */
.segmented-toggle {
  position: relative;
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 20px;
}

.segmented-toggle-slider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--white);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
  z-index: 0;
}

.segmented-toggle-option {
  position: relative;
  z-index: 1;
  flex: 1;
  background: none;
  border: none;
  padding: 8px 16px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.2s ease;
}

.segmented-toggle-option.active { color: var(--accent); }

/* ---- Modal ringan (mis. popup Tambah Akun Partner) ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
  overflow-y: auto;
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 420px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 18px;
}

.modal-box h2 { margin: 0 0 10px; font-size: 14px; }
.modal-box p { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.admin-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
}

.admin-form-card { padding: 20px; }
.admin-form-card h2 { font-size: 14px; margin: 0 0 16px; }

.badge-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef9c3; color: #854d0e; }

/* Bukan display:flex — flex di <td> merusak layout baris tabel. */
.table-actions { white-space: nowrap; }
.table-actions > * + * { margin-left: 4px; }
.table-actions button { font-size: 11.5px; padding: 3px 8px; }

/* ---- Halaman Detail Partner: tanpa card sama sekali, baris label:value ---- */
.detail-page { max-width: 1080px; }

.detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

@media (max-width: 900px) {
  .detail-columns { grid-template-columns: 1fr; gap: 0; }
}

.detail-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 16px;
}

.detail-back-link:hover { color: var(--accent); }

.partner-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.partner-hero-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}

.partner-hero-info h1 { font-size: 18px; margin: 0 0 4px; }

.partner-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.partner-hero-code {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.03em;
}

.detail-section { margin-bottom: 32px; }

.detail-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 24px;
}

.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.detail-section-header h2 {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}

/* Baris label:value editable langsung — bukan grid kotak-kotak, jadi
   tidak ada sel kosong dan input melebar penuh mengisi barisnya. */
.field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.field-row:last-child { border-bottom: none; }

.field-row > label {
  flex: 0 0 140px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.field-row > input, .field-row > select {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  padding: 5px 6px;
  border-radius: 6px;
}

.field-row > input:disabled, .field-row > select:disabled { color: var(--muted); }

.field-row > input:focus, .field-row > select:focus {
  outline: none;
  background: var(--accent-soft);
}

.field-row > p { flex: 1; min-width: 0; margin: 0; font-size: 13px; font-weight: 700; }

.detail-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.btn-sm { padding: 6px 14px; font-size: 12px; }

.notice-banner {
  background: #fef3c7;
  color: #92400e;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 14px;
}

/* Versi kecil dari .segmented-toggle */
.segmented-toggle--sm {
  width: 220px;
  margin-bottom: 0;
  padding: 3px;
}

.segmented-toggle--sm .segmented-toggle-option { padding: 6px 12px; font-size: 12px; }

/* ---- Indikator versi aplikasi (lihat CHANGELOG.md) ---- */
.version-footer {
  display: block;
  position: fixed;
  bottom: 4px;
  right: 8px;
  z-index: 9999;
  pointer-events: none;
  user-select: none;
  font-size: 10px;
  color: rgba(100, 116, 139, 0.7);
}

/* ---- Tambahan EFC: komponen ringkas (lihat preferensi tampilan rapat) ---- */
table.table-compact { min-width: 640px; }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 8px;
}

.filter-bar input, .filter-bar select {
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
}

.filter-bar input[type="search"] { width: 240px; max-width: 100%; }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--accent); }
.filter-count { margin-left: auto; font-size: 11.5px; color: var(--muted); }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

.narrow-panel { max-width: 520px; }
.form-card { padding: 12px 14px; }
.form-card .field-row > p { font-weight: 500; }

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 10;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  max-height: 220px;
  overflow-y: auto;
}

.search-result { padding: 6px 9px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--accent-soft); }
.search-result-sub { font-size: 11px; color: var(--muted); }
.search-result-empty { padding: 8px 9px; color: var(--muted); font-size: 12px; }

.selected-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 11px;
}

.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

.auth-links { display: flex; justify-content: space-between; margin-top: 10px; }

@media (max-width: 720px) {
  .form-row-2 { grid-template-columns: 1fr; }
  .filter-bar input[type="search"] { width: 100%; }
}

/* ---- Pill warna (aturan warna sheet Panduan) ---- */
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.pill-neutral { background: #eef2ff; color: #3730a3; }
.pill-yellow { background: #fef9c3; color: #854d0e; }
.pill-blue { background: #dbeafe; color: #1e40af; }
.pill-green { background: #dcfce7; color: #166534; }
.pill-red { background: #fee2e2; color: #991b1b; }
.pill-grey { background: #e5e7eb; color: #374151; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 10px 0; overflow-x: auto; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 6px 10px; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count { font-weight: 500; color: var(--muted); margin-left: 3px; }

/* ---- Form grid di modal lebar ---- */
.modal-box.modal-wide { max-width: 720px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }
.form-section-title {
  grid-column: 1 / -1; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin: 4px 0 6px; padding-top: 6px; border-top: 1px solid var(--border);
}
.form-section-title:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.form-field textarea {
  width: 100%; font-family: inherit; font-size: 13px; color: var(--text); background: var(--white);
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 9px; resize: vertical; min-height: 54px;
}
.form-field textarea:focus { outline: none; border-color: var(--accent); }

/* ---- Tabel: baris bisa diklik, sel ringkas ---- */
tr.row-link { cursor: pointer; }
.cell-sub { display: block; font-size: 11px; color: var(--muted); }
td.wrap { white-space: normal; min-width: 180px; }
.text-right { text-align: right; }

/* ---- Header halaman detail ---- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 16px; margin: 0; }
.page-head .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted); }
.head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.back-link { font-size: 12px; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 6px; }
.back-link:hover { color: var(--accent); }
.notice { background: #fef9c3; color: #854d0e; border-radius: 6px; padding: 6px 10px; font-size: 12px; margin: 8px 0; }
.notice-red { background: #fee2e2; color: #991b1b; }
.notice-blue { background: #dbeafe; color: #1e40af; }

/* Label:value 2 kolom di tab Profil */
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.kv-grid .field-row > p { font-weight: 500; white-space: pre-wrap; word-break: break-word; }
.section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 6px; }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .kv-grid { grid-template-columns: 1fr; }
}

/* ---- Form laporan & lampiran ---- */
.report-form { max-width: 980px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 4px 0; }
.check-grid .inline-checkbox, .check-row .inline-checkbox { font-size: 12.5px; font-weight: 500; color: var(--text); display: inline-flex; gap: 5px; align-items: center; }
.check-row { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--white); font-size: 12px; color: var(--accent); text-decoration: none;
}
.file-chip:hover { border-color: var(--accent); }
.bulk-bar {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin-bottom: 8px;
  background: var(--accent-soft); border-radius: 6px; font-size: 12px; color: var(--accent); font-weight: 600;
}
.filter-bar input[type="date"] { width: 132px; }

/* ---- Kanban Pipeline ---- */
.kanban { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kanban-col { flex: 0 0 178px; background: #f1f5f9; border-radius: 8px; padding: 6px; min-height: 120px; transition: background .15s; }
.kanban-col.drop-target { background: var(--accent-soft); outline: 2px dashed var(--accent); }
.kanban-col-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 6px; font-size: 12px; }
.kanban-count { font-weight: 700; color: var(--muted); }
.kanban-total { margin-left: auto; font-size: 11px; color: var(--muted); }
.kanban-cards { display: flex; flex-direction: column; gap: 6px; }
.kanban-card { background: var(--white); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; cursor: pointer; font-size: 12px; }
.kanban-card:hover { border-color: var(--accent); }
.kanban-card.dragging { opacity: .5; }
.kc-school { font-weight: 700; line-height: 1.3; }
.kc-tier { font-size: 10px; background: #eef2ff; color: #3730a3; border-radius: 4px; padding: 0 4px; margin-left: 2px; }
.kc-title { color: var(--muted); margin-top: 1px; }
.kc-meta { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 3px; font-weight: 600; }
.kc-next { margin-top: 3px; font-size: 11px; color: var(--muted); }
.kc-foot { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10.5px; color: var(--muted); }
.kanban-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 0; }

/* ---- Dashboard ---- */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 8px; }
.kpi-tile { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.kpi-label { font-size: 11.5px; color: var(--muted); }
/* Angka besar tunggal pakai figur proporsional (bukan tabular). */
.kpi-value { font-size: 20px; font-weight: 600; line-height: 1.3; font-variant-numeric: normal; }
.kpi-sub { font-size: 11px; color: var(--muted); }
.action-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.action-row:empty { display: none; }
.action-chip { font-size: 12px; padding: 4px 10px; border-radius: 6px; text-decoration: none; }
.action-yellow { background: #fef9c3; color: #854d0e; }
.action-red { background: #fee2e2; color: #991b1b; }
.dash-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; }
.dash-card { padding: 10px 12px; }
.dash-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.dash-card-head h2 { font-size: 13px; margin: 0; }
table.table-plain { min-width: 0; }
table.table-plain th { background: none; position: static; padding-left: 6px; padding-right: 6px; }
table.table-plain td { padding: 4px 6px; }
.funnel-row { display: grid; grid-template-columns: 86px 1fr 110px; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.funnel-label { color: var(--muted); }
.funnel-track { height: 14px; display: block; }
.funnel-bar { display: block; height: 14px; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 0; }
.funnel-row:hover .funnel-bar { background: #4338ca; }
.funnel-value { font-weight: 600; white-space: nowrap; }
@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
}
/* Checkbox/radio/file di dalam .form-field jangan ikut lebar penuh. */
.form-field input[type="checkbox"], .form-field input[type="radio"] { width: auto; padding: 0; margin: 0; accent-color: var(--accent); }
.form-field input[type="file"] { padding: 4px; }
td a, .meta a, .kv-grid a { color: var(--accent); text-decoration: none; }
td a:hover, .meta a:hover, .kv-grid a:hover { text-decoration: underline; }
td a.btn:hover { text-decoration: none; }
tfoot .total-row td { background: #f1f5f9; font-weight: 600; border-top: 1px solid var(--border); }
.filter-bar input[type="month"] { width: 150px; }
.timeline { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; }
.timeline li { padding: 3px 0; }
.material-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-bottom: 6px; }
.material-card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.material-card.inactive { opacity: .6; }
.mc-title { font-weight: 600; font-size: 13px; }

.sidebar-group { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; padding: 10px 8px 2px; }
