/* ==========================================================================
   Portal Stylesheet — Login Terpadu, Setup Admin, Dashboard Member & Admin
   ========================================================================== */

.portal-body {
  background-color: var(--bg-cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-main,
.auth-section {
  flex: 1;
  padding-block: clamp(32px, 4vw, 56px);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 9px 15px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-xs {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-danger-outline {
  background: #fff;
  color: #b42318;
  border-color: #fecdca;
}

.btn-danger-outline:hover {
  background: #fef3f2;
  border-color: #b42318;
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.55;
  border: 1px solid transparent;
}

.alert-success {
  background: #ecfdf3;
  border-color: #abefc6;
  color: #067647;
}

.alert-danger {
  background: #fef3f2;
  border-color: #fecdca;
  color: #b42318;
}

.alert-warning {
  background: #fffaeb;
  border-color: #fedf89;
  color: #93370d;
}

/* ==================== AUTH & SETUP LAYOUT ==================== */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
  gap: clamp(28px, 5vw, 60px);
  align-items: start;
}

.auth-aside {
  padding-top: 12px;
}

.auth-aside h1 {
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 800;
  margin-bottom: 16px;
}

.auth-aside h1 span {
  color: var(--maroon);
}

.auth-aside p {
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.75;
  margin-bottom: 24px;
}

.auth-highlights {
  margin-bottom: 28px;
}

.auth-contact-note {
  display: inline-block;
  padding: 14px 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

.auth-contact-note small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.auth-contact-note strong {
  color: var(--maroon);
  font-size: 16px;
}

.auth-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: clamp(24px, 3.5vw, 36px);
  box-shadow: var(--shadow-md);
}

.setup-container {
  max-width: 660px;
}

.setup-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.setup-badge-row .eyebrow {
  margin-bottom: 0;
}

.setup-card h1 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  margin-bottom: 10px;
}

.setup-card h1 span {
  color: var(--maroon);
}

.setup-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 22px;
}

.setup-footer-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Auth Mode Switch Tabs */
.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: var(--bg-soft);
  border-radius: 14px;
  margin-bottom: 24px;
}

.auth-mode-tab {
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 700;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.auth-mode-tab.is-active {
  background: var(--surface);
  color: var(--maroon);
  box-shadow: var(--shadow-sm);
}

.auth-panel[hidden] {
  display: none !important;
}

.auth-panel-head h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-panel-head p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Forms */
.portal-form {
  display: grid;
  gap: 15px;
}

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

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 68px;
}

.pw-toggle {
  position: absolute;
  right: 8px;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--maroon);
  font-size: 11.5px;
  font-weight: 700;
}

.auth-switch-hint {
  margin: 4px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.text-link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--maroon);
  font-weight: 800;
  text-decoration: underline;
}

.field-help {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==================== MEMBER & ADMIN DASHBOARD ==================== */
.portal-welcome-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(22px, 3.5vw, 34px);
  margin-bottom: 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.portal-welcome-banner h1 {
  color: #fff;
  font-size: clamp(22px, 2.6vw, 30px);
  margin-bottom: 6px;
}

.portal-welcome-banner p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  max-width: 720px;
  margin: 0;
}

.role-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.role-pill-member {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.role-pill-admin {
  background: var(--gold);
  color: #1f1912;
}

.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.stat-card {
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.stat-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  display: block;
  font-size: 30px;
  font-weight: 800;
  color: var(--maroon);
  line-height: 1.15;
  margin-bottom: 4px;
}

.stat-card small {
  font-size: 12px;
  color: var(--text-muted);
}

.text-gold { color: #9a6c15; }
.text-success { color: #067647; }
.text-danger { color: #b42318; }

.member-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.admin-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: start;
}

.portal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 30px);
  box-shadow: var(--shadow-sm);
}

.portal-card-head {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.portal-card-head h2 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 4px;
}

.portal-card-head p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
}

.head-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

/* Status Chips & Badges */
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.chip-pending {
  background: #fffaeb;
  color: #b54708;
  border: 1px solid #fedf89;
}

.chip-approved {
  background: #ecfdf3;
  color: #067647;
  border: 1px solid #abefc6;
}

.chip-revision {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
}

.doc-cards-list,
.admin-docs-grid {
  display: grid;
  gap: 16px;
}

.doc-item-card,
.admin-doc-card {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-cream);
}

.doc-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.doc-service-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--maroon);
  margin-bottom: 3px;
}

.doc-item-top h3 {
  font-size: 17px;
  margin-bottom: 4px;
}

.doc-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.doc-note-box {
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  margin-bottom: 10px;
}

.doc-note-admin {
  border-left: 4px solid var(--maroon);
  background: #fff9f5;
}

.doc-item-actions,
.row-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline-form {
  display: inline;
  margin: 0;
}

/* Admin Navigation Tabs */
.admin-top-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.admin-top-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.admin-top-tabs a:hover,
.admin-top-tabs a.is-active {
  background: var(--maroon-tint);
  color: var(--maroon);
}

.nav-counter {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--maroon);
  color: #fff;
  font-size: 11px;
}

/* Bar Chart & Behavior Analytics */
.bar-chart-list {
  display: grid;
  gap: 14px;
}

.bar-chart-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 5px;
}

.bar-chart-label span {
  color: var(--text-muted);
  font-weight: 600;
}

.bar-chart-track {
  height: 11px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  overflow: hidden;
}

.bar-chart-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--maroon), var(--gold));
}

.behavior-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cat-metric {
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--bg-cream);
  border: 1px solid var(--border);
}

.cat-metric span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cat-metric strong {
  font-size: 22px;
  color: var(--maroon);
}

/* Filter Bar & Tables */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-bar select,
.filter-bar input {
  padding: 9px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-cream);
  font-size: 13.5px;
  min-width: 180px;
  flex: 1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.portal-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.portal-table th,
.portal-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.portal-table thead th {
  background: var(--bg-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

.portal-table tbody tr:last-child td {
  border-bottom: 0;
}

.portal-table tbody tr:hover {
  background: #fdfbf7;
}

.nowrap {
  white-space: nowrap;
}

.subtle-tag {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--gold-tint);
  border: 1px solid var(--gold-soft);
  color: #5f4510;
  font-size: 11px;
  font-weight: 700;
}

.role-badge,
.cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
}

.role-badge-member { background: #eef4ff; color: #1d4ed8; }
.role-badge-guest { background: #f2f4f7; color: #475467; }
.role-badge-admin { background: var(--maroon-tint); color: var(--maroon); }

.cat-service { background: var(--gold-tint); color: #78530d; }
.cat-whatsapp { background: #ecfdf3; color: #067647; }
.cat-document { background: #eef4ff; color: #1d4ed8; }
.cat-auth { background: var(--maroon-tint); color: var(--maroon); }
.cat-page { background: #f4f3ff; color: #5925dc; }

/* Admin Review Box */
.review-box {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.review-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.delete-doc-form {
  margin-top: 10px;
  text-align: right;
}

.text-danger-btn {
  border: 0;
  background: none;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-cream);
  border: 1px solid var(--border);
  font-size: 13.5px;
  cursor: pointer;
}

.checkbox-row input {
  margin-top: 4px;
}

.card-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}

.simple-admin-list {
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.empty-state {
  padding: 36px 20px;
  text-align: center;
  border-radius: 16px;
  background: var(--bg-cream);
  border: 1px dashed var(--border-strong);
}

.empty-state strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

.empty-state p {
  margin: 0 auto;
  max-width: 460px;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Unified Multi-Slot Document Upload Grid */
.upload-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.upload-slot-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--bg-cream);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.upload-slot-card[hidden] {
  display: none !important;
}

.upload-slot-card.has-files {
  border-color: #067647;
  background: #f6fef9;
}

.upload-slot-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.upload-slot-title {
  display: block;
  font-size: 14.5px;
  color: var(--text);
  margin-bottom: 3px;
}

.upload-slot-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.slot-tag {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.slot-tag-main {
  background: var(--maroon-tint);
  color: var(--maroon);
}

.slot-tag-opt {
  background: var(--gold-tint);
  color: #6b4e16;
}

.upload-slot-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.upload-slot-input-wrap input[type="file"] {
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  font-size: 12.5px;
}

.slot-selected-info {
  font-size: 11.5px;
  color: var(--text-muted);
}

.batch-upload-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--gold-tint);
  border: 1px solid var(--gold-soft);
}

.batch-summary-text {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.batch-groups-list {
  display: grid;
  gap: 20px;
}

.batch-group-card {
  padding: 20px 22px;
  border-radius: 18px;
  border: 1.5px solid var(--border);
  background: var(--bg-cream);
}

.batch-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.batch-group-head h3 {
  font-size: 18px;
  margin-bottom: 3px;
}

.batch-files-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.batch-files-table {
  min-width: 680px;
}

.admin-doc-subcard {
  padding: 15px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Document Preview Modal */
.doc-modal {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 15, 16, 0.82);
  backdrop-filter: blur(4px);
}

.doc-modal[hidden] {
  display: none !important;
}

.doc-modal-dialog {
  width: 100%;
  max-width: 880px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.doc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.doc-modal-header h3 {
  font-size: 15.5px;
  margin: 0;
}

.doc-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-cream);
  font-size: 22px;
  line-height: 1;
}

.doc-modal-body {
  flex: 1;
  min-height: 340px;
  max-height: 80vh;
  overflow: auto;
  padding: 16px;
  background: #2b2728;
  display: grid;
  place-items: center;
}

.doc-modal-body img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 8px;
}

.doc-modal-body iframe {
  width: 100%;
  height: 75vh;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

/* Responsive */
@media (max-width: 1024px) {
  .auth-layout,
  .member-workspace-grid,
  .admin-two-col,
  .upload-slots-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .form-grid-2,
  .stats-grid-4,
  .behavior-cat-grid {
    grid-template-columns: 1fr;
  }

  .admin-top-tabs {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
}

/* ==========================================================================
   Halaman Khusus Pencarian KBLI Tersinkron OSS (kbli.php)
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.kbli-main {
  flex: 1;
}

.kbli-hero {
  background: linear-gradient(180deg, #f6efe0 0%, var(--bg-cream) 100%);
  border-bottom: 1px solid var(--border);
  padding-block: clamp(36px, 5vw, 62px);
}

.kbli-hero-inner {
  max-width: 900px;
  margin-inline: auto;
  text-align: center;
}

.kbli-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.kbli-sync-pill .sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
}

.kbli-sync-pill.is-live {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.kbli-sync-pill.is-live .sync-dot {
  background: #12b76a;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.2);
}

.kbli-sync-pill.is-error {
  border-color: #fedf89;
  background: #fffaeb;
  color: #93370d;
}

.kbli-hero h1 {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 800;
  margin-bottom: 12px;
}

.kbli-hero h1 span {
  color: var(--maroon);
}

.kbli-hero-desc {
  max-width: 740px;
  margin: 0 auto 28px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.75;
}

.kbli-search-box {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 18px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.kbli-search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.kbli-search-icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--maroon);
  pointer-events: none;
}

.kbli-search-box input {
  width: 100%;
  padding: 13px 40px 13px 44px;
  border: 0;
  background: transparent;
  font-size: 15px;
  color: var(--text);
}

.kbli-search-box input:focus {
  outline: none;
}

.kbli-clear-btn {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
}

.kbli-clear-btn[hidden] {
  display: none !important;
}

.kbli-search-submit {
  padding-inline: 26px;
  white-space: nowrap;
}

.kbli-quick-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.kbli-chip {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.kbli-chip:hover {
  border-color: var(--maroon);
  background: var(--maroon-tint);
  color: var(--maroon);
}

.kbli-workspace {
  padding-block: clamp(28px, 4vw, 48px) clamp(50px, 6vw, 80px);
}

.kbli-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.kbli-version-group {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg-soft);
  gap: 4px;
}

.kbli-ver-btn {
  padding: 8px 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.kbli-ver-btn.is-active {
  background: var(--maroon);
  color: #fff;
  box-shadow: 0 4px 12px rgba(110, 27, 30, 0.22);
}

.kbli-filter-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}

.kbli-select {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-cream);
  font-size: 13.5px;
  min-width: 240px;
  max-width: 420px;
  flex: 1;
}

.kbli-results-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.kbli-suggest-bar {
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--gold-tint);
  border: 1px solid var(--gold-soft);
  font-size: 13.5px;
  margin-bottom: 16px;
}

.kbli-categories-drawer {
  padding: 22px;
  border-radius: 20px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.kbli-categories-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.kbli-categories-head h2 {
  font-size: 19px;
  margin-bottom: 4px;
}

.kbli-categories-head p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.kbli-categories-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kbli-cat-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--bg-cream);
  text-align: left;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.16s ease;
}

.kbli-cat-card:hover,
.kbli-cat-card.is-active {
  border-color: var(--maroon);
  background: var(--maroon-tint);
  transform: translateY(-1px);
}

.kbli-cat-code {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--maroon);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
}

.kbli-cat-info strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}

.kbli-cat-info small {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.kbli-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.kbli-loading-state,
.kbli-empty {
  grid-column: 1 / -1;
  padding: 46px 20px;
  text-align: center;
  color: var(--text-muted);
}

.kbli-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid var(--border-strong);
  border-top-color: var(--maroon);
  animation: kbliSpin 0.75s linear infinite;
}

@keyframes kbliSpin {
  to { transform: rotate(360deg); }
}

.kbli-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kbli-card:hover {
  transform: translateY(-3px);
  border-color: var(--maroon);
  box-shadow: var(--shadow-md);
}

.kbli-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.kbli-code-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 8px;
  background: var(--maroon);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.kbli-ver-tag {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--gold-tint);
  border: 1px solid var(--gold-soft);
  color: #5f4510;
  font-size: 11px;
  font-weight: 800;
}

.kbli-oss-tag {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
  font-size: 11px;
  font-weight: 800;
}

.kbli-card-title {
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 8px;
}

.kbli-card-desc {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.kbli-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.kbli-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.kbli-page-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.kbli-page-btn:hover:not(:disabled) {
  border-color: var(--maroon);
  color: var(--maroon);
}

.kbli-page-btn.is-active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: #fff;
}

.kbli-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.kbli-page-dots {
  color: var(--text-muted);
  padding-inline: 4px;
}

.kbli-help-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 42px;
  padding: clamp(24px, 4vw, 38px);
  border-radius: 24px;
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.kbli-help-banner h2 {
  color: #fff;
  font-size: clamp(21px, 2.6vw, 28px);
  margin-bottom: 8px;
  max-width: 650px;
}

.kbli-help-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  max-width: 650px;
}

.kbli-help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Modal Detail KBLI */
.kbli-modal-dialog {
  max-width: 900px;
}

.kbli-modal-header {
  align-items: flex-start;
  padding: 18px 22px;
  background: var(--bg-cream);
}

.kbli-modal-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.kbli-modal-header h3 {
  font-size: 20px;
  line-height: 1.3;
}

.kbli-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  max-height: 68vh;
  background: var(--surface);
}

.kbli-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-cream);
}

.kbli-detail-section + .kbli-detail-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.kbli-detail-section h4 {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--maroon);
  margin-bottom: 12px;
}

.kbli-detail-uraian p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 8px;
}

.kbli-muted {
  color: var(--text-muted);
  font-size: 13.5px;
}

.kbli-conv-box {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--gold-tint);
  border: 1px solid var(--gold-soft);
}

.kbli-conv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.kbli-conv-head h4 {
  margin-bottom: 0;
}

.kbli-conv-pill {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--maroon);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.kbli-conv-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.kbli-conv-col {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.kbli-conv-col strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kbli-conv-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.kbli-conv-link {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.kbli-conv-link:hover {
  color: var(--maroon);
  text-decoration: underline;
}

.kbli-conv-link code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--maroon-tint);
  color: var(--maroon);
  font-weight: 800;
}

.kbli-scope-card {
  padding: 16px;
  border-radius: 14px;
  background: var(--bg-cream);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.kbli-scope-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.kbli-scope-label {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.kbli-scope-head h5 {
  margin: 2px 0 0;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
}

.kbli-risk-list {
  display: grid;
  gap: 10px;
}

.kbli-risk-item {
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.kbli-risk-item summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.kbli-risk-item summary::-webkit-details-marker {
  display: none;
}

.kbli-skala-name {
  font-size: 14px;
  color: var(--text);
}

.kbli-risk-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 800;
}

.risk-low { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; }
.risk-med-low { background: #eff8ff; color: #175cd3; border: 1px solid #b2ddff; }
.risk-med-high { background: #fffaeb; color: #b54708; border: 1px solid #fedf89; }
.risk-high { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.risk-neutral { background: var(--bg-soft); color: var(--text-muted); }

.kbli-risk-detail {
  padding: 0 15px 14px;
  border-top: 1px solid var(--border);
}

.kbli-risk-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-block: 12px;
}

.kbli-risk-meta-grid small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.kbli-risk-meta-grid strong {
  font-size: 13.5px;
  color: var(--text);
}

.kbli-sublist {
  margin-top: 8px;
  font-size: 13px;
}

.kbli-sublist strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.kbli-sublist ul,
.kbli-regs-box ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.kbli-regs-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-strong);
  font-size: 12.5px;
}

.kbli-regs-box strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
}

@media (max-width: 1024px) {
  .kbli-results-grid,
  .kbli-categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .kbli-search-box {
    flex-direction: column;
  }

  .kbli-results-grid,
  .kbli-categories-grid,
  .kbli-conv-cols,
  .kbli-risk-meta-grid {
    grid-template-columns: 1fr;
  }

  .kbli-filter-right {
    justify-content: stretch;
  }

  .kbli-select {
    min-width: 0;
    width: 100%;
  }
}
