/* =========================================================
   KSP — style tambahan di atas Tabler (Bootstrap 5)
   ========================================================= */
:root {
    --ksp-primary: #2563eb;
    --ksp-primary-dark: #1e3a8a;
}

/* ---------- Brand ---------- */
.ksp-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: #fff;
}
.ksp-brand:hover { text-decoration: none; }
.ksp-brand-dark { color: var(--tblr-body-color); }
.ksp-brand-logo {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    background: linear-gradient(135deg, var(--ksp-primary), #7c3aed);
    box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}
.ksp-brand { min-width: 0; max-width: 100%; }
.ksp-brand-text {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;   /* nama panjang dipotong rapi dengan "..." */
    max-width: 10.5rem;
}
.ksp-brand-img {
    width: 2.25rem;
    height: 2.25rem;
    object-fit: contain;
    border-radius: .5rem;
    background: #fff;
    padding: .15rem;
    flex-shrink: 0;
}
.ksp-brand-logo { flex-shrink: 0; }
.ksp-logo-preview {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: .75rem;
    border: 1px solid var(--tblr-border-color);
    background: #fff;
    padding: .35rem;
}

/* ---------- Sidebar ---------- */
.ksp-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111c3a 100%) !important;
}
.ksp-sidebar .navbar-nav .nav-link {
    border-radius: .5rem;
    margin: 1px .5rem;
    padding: .55rem .75rem;
}
.ksp-sidebar .nav-link-icon i { font-size: 1.05rem; }
.ksp-sidebar .nav-item.active > .nav-link {
    background: rgba(37, 99, 235, .25);
    color: #fff;
}
.ksp-sidebar .nav-link.disabled { opacity: .55; }
.ksp-nav-section {
    list-style: none;
    padding: 1.1rem 1.25rem .35rem;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .4);
}

/* ---------- Avatar inisial ---------- */
.ksp-avatar {
    background: linear-gradient(135deg, var(--ksp-primary), #7c3aed);
    color: #fff;
    font-weight: 600;
}

/* ---------- Kartu statistik ---------- */
.ksp-stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.ksp-welcome {
    background: linear-gradient(135deg, var(--ksp-primary-dark), var(--ksp-primary) 60%, #7c3aed);
    color: #fff;
    border: 0;
}
.ksp-welcome h1, .ksp-welcome h2, .ksp-welcome h3 { color: #fff; }
.ksp-welcome .text-secondary { color: rgba(255, 255, 255, .75) !important; }

/* ---------- Tombol mode gelap ---------- */
/* (hanya mengikuti tema halaman di <html>, bukan tema gelap sidebar) */
.ksp-theme-light-icon { display: none; }
html[data-bs-theme="dark"] .ksp-theme-light-icon { display: inline; }
html[data-bs-theme="dark"] .ksp-theme-dark-icon { display: none; }

/* ---------- Halaman login ---------- */
.ksp-auth-form { background: var(--tblr-bg-surface); }
.ksp-auth-hero {
    position: relative;
    align-items: center;
    padding: 4rem;
    background:
        radial-gradient(circle at 20% 20%, rgba(124, 58, 237, .45), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(14, 165, 233, .35), transparent 40%),
        linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    overflow: hidden;
}
.ksp-auth-hero-inner { position: relative; max-width: 560px; }
.ksp-auth-feature {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(6px);
}
.ksp-auth-feature i { font-size: 1.4rem; color: #93c5fd; }

/* ---------- Responsive (tablet & HP) ---------- */
@media (max-width: 991.98px) {
    .page-header .container-xl,
    .page-body .container-xl,
    .footer .container-xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .ksp-sidebar .navbar-brand { margin: 0 auto 0 .5rem; }
    .ksp-sidebar .navbar-collapse { padding-bottom: .75rem; }
    .ksp-auth-form .container-tight { max-width: 100%; }
}
@media (max-width: 575.98px) {
    .page-title { font-size: 1.25rem; }
    .ksp-welcome h2 { font-size: 1.15rem; }
    .card-header form .form-select,
    .card-header form .input-icon { width: 100% !important; max-width: 100% !important; }
}

/* ===== Select2 menyesuaikan tampilan Tabler/Bootstrap ===== */
.select2-container--default .select2-selection--single {
    height: calc(1.4285714em + 1.125rem + 2px);
    border: var(--tblr-border-width) solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    background-color: var(--tblr-bg-forms);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(1.4285714em + 1.125rem);
    padding-left: .75rem;
    color: var(--tblr-body-color);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(1.4285714em + 1.125rem);
    right: .5rem;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--tblr-primary);
    box-shadow: 0 0 0 .25rem rgba(var(--tblr-primary-rgb), .25);
}
.select2-dropdown {
    border-color: var(--tblr-border-color);
    background-color: var(--tblr-bg-surface);
    color: var(--tblr-body-color);
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    border-color: var(--tblr-border-color);
    background-color: var(--tblr-bg-forms);
    color: var(--tblr-body-color);
    border-radius: var(--tblr-border-radius);
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--tblr-primary);
}


/* ===== Cetak laporan (Ctrl+P / Simpan sebagai PDF) ===== */
@media print {
    .ksp-sidebar, .page-wrapper > header, .navbar, .page-header .col-auto, .footer, .d-print-none, .btn { display: none !important; }
    .page-wrapper { margin: 0 !important; padding: 0 !important; }
    .page-body, .container-xl { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }
    .card { border: 0 !important; box-shadow: none !important; break-inside: avoid; }
    .table-responsive { overflow: visible !important; max-height: none !important; }
    body { background: #fff !important; font-size: 11px; }
    a { color: inherit !important; text-decoration: none !important; }
    .row-cards > [class*="col-lg-6"] { width: 50% !important; float: left; }
}

/* =========================================================
   Halaman publik: beranda produk & panduan
   ========================================================= */
.bsa-public { background: var(--tblr-body-bg); }
.bsa-public-nav { background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--tblr-border-color); }
[data-bs-theme="dark"] .bsa-public-nav { background: rgba(21, 31, 44, .92); }
.bsa-hero, .bsa-guide-head, .bsa-cta {
    background:
        radial-gradient(circle at 15% 20%, rgba(124, 58, 237, .45), transparent 45%),
        radial-gradient(circle at 85% 70%, rgba(14, 165, 233, .35), transparent 40%),
        linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    color: #fff;
}
.bsa-hero { padding: 5rem 0; }
.bsa-hero-title { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 800; line-height: 1.15; color: #fff; margin-bottom: 1rem; }
.bsa-hero-lead { font-size: 1.1rem; color: rgba(255, 255, 255, .75); margin-bottom: 2rem; }
.bsa-hero-panel { padding: 1.5rem; border-radius: 1.25rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); }
.bsa-section { padding: 4.5rem 0; }
.bsa-section-title { font-size: 1.85rem; font-weight: 800; margin-bottom: .5rem; }
.bsa-module { transition: transform .15s, box-shadow .15s; }
.bsa-module:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.bsa-check { list-style: none; padding-left: 0; }
.bsa-check li { position: relative; padding-left: 1.6rem; margin-bottom: .5rem; }
.bsa-check li::before { content: "\F26B"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: 0; color: var(--tblr-success); }
.bsa-step-no { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--ksp-primary), #7c3aed); margin-bottom: .75rem; }
.bsa-cta { padding: 4rem 0; }
.bsa-public-footer { padding: 1.5rem 0; border-top: 1px solid var(--tblr-border-color); color: var(--tblr-secondary); font-size: .875rem; }
.bsa-public-footer a { color: inherit; }

.bsa-guide-head { padding: 3rem 0; }
.bsa-toc { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
.bsa-toc a { display: block; text-decoration: none; color: var(--tblr-body-color); padding: .2rem 0; }
.bsa-toc .bsa-toc-main { font-weight: 600; margin-top: .6rem; }
.bsa-toc .bsa-toc-sub { padding-left: .9rem; font-size: .875rem; color: var(--tblr-secondary); }
.bsa-toc a:hover { color: var(--ksp-primary); }
.bsa-guide h2 { font-size: 1.6rem; font-weight: 800; margin: 3rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--tblr-border-color); scroll-margin-top: 5rem; }
.bsa-guide h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.bsa-guide h3 { font-size: 1.15rem; font-weight: 700; margin: 2rem 0 .75rem; scroll-margin-top: 5rem; }
.bsa-guide ol, .bsa-guide ul { padding-left: 1.3rem; }
.bsa-guide li { margin-bottom: .4rem; }
.bsa-guide table { font-size: .9rem; }
.bsa-note { border-left: 4px solid var(--ksp-primary); background: rgba(37, 99, 235, .07); padding: .75rem 1rem; border-radius: .5rem; margin: 1rem 0; }
.bsa-note-warning { border-left-color: var(--tblr-warning); background: rgba(247, 103, 7, .08); }
.bsa-flow { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .75rem 0 1rem; }
.bsa-flow span { padding: .35rem .75rem; border-radius: 2rem; background: var(--tblr-bg-surface-secondary, #f1f5f9); border: 1px solid var(--tblr-border-color); font-size: .875rem; }
.bsa-flow i { color: var(--tblr-secondary); }
@media (max-width: 991.98px) { .bsa-toc { position: static; max-height: none; } }

/* Contoh kode (Integrasi API & panduan) */
.bsa-code { background: #0f172a; color: #e2e8f0; padding: .75rem 1rem; border-radius: .5rem; font-size: .8rem; white-space: pre-wrap; word-break: break-all; }
