:root {
    --sidebar-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --menu-transition: 0.25s ease;

    /* Kartu & teks halaman custom (Profile, API Docs, Welcome) */
    --vivo-card-bg: #ffffff;
    --vivo-card-border: #e5e7eb;
    --vivo-text: #242933;
    --vivo-muted: #6b7280;
    --vivo-soft-bg: #f8fafc;
    --vivo-pre-bg: #242933;
    --vivo-pre-fg: #ffffff;
    --vivo-accent-soft: #eff6ff;
    --vivo-accent-border: #bfdbfe;
    --vivo-success-bg: #ecfdf5;
    --vivo-success-border: #a7f3d0;
    --vivo-success-text: #065f46;
}

.dark {
    --vivo-card-bg: #1f2937;
    --vivo-card-border: #374151;
    --vivo-text: #f9fafb;
    --vivo-muted: #9ca3af;
    --vivo-soft-bg: #111827;
    --vivo-pre-bg: #0b1120;
    --vivo-pre-fg: #e2e8f0;
    --vivo-accent-soft: #1e293b;
    --vivo-accent-border: #334155;
    --vivo-success-bg: #052e2b;
    --vivo-success-border: #065f46;
    --vivo-success-text: #6ee7b7;
}

.vivo-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}
@media (min-width: 1024px) {
    .vivo-grid-2 { grid-template-columns: 1fr 1fr; }
}

.vivo-card {
    background: var(--vivo-card-bg);
    border: 1px solid var(--vivo-card-border);
    border-radius: 12px;
    padding: 20px;
}

.vivo-card-title { margin: 0 0 4px; font-weight: 700; color: var(--vivo-text); }
.vivo-card-sub { margin: 0 0 16px; color: var(--vivo-muted); font-size: 13px; }
.vivo-label { font-size: 13px; font-weight: 600; color: var(--vivo-text); }
.vivo-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--vivo-card-border);
    border-radius: 8px;
    margin-top: 6px;
    box-sizing: border-box;
    background: var(--vivo-card-bg);
    color: var(--vivo-text);
}
.vivo-input:focus {
    outline: none;
    border-color: #415FFF;
    box-shadow: 0 0 0 3px rgba(65, 95, 255, 0.15);
}
.vivo-error { color: #dc2626; font-size: 12px; margin-top: 4px; }
.vivo-btn {
    background: #415FFF;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
}
.vivo-btn:hover { background: #2E3BCC; }
.vivo-code-inline {
    background: var(--vivo-accent-soft);
    border: 1px solid var(--vivo-accent-border);
    border-radius: 10px;
    padding: 12px;
    color: #415FFF;
    font-weight: 700;
    word-break: break-all;
}
.dark .vivo-code-inline { color: #93c5fd; }
.vivo-pre {
    background: var(--vivo-pre-bg);
    color: var(--vivo-pre-fg);
    padding: 14px;
    border-radius: 10px;
    overflow: auto;
    font-size: 13px;
}
.vivo-pre-light {
    background: var(--vivo-soft-bg);
    border: 1px solid var(--vivo-card-border);
    color: var(--vivo-text);
    padding: 14px;
    border-radius: 10px;
    overflow: auto;
    font-size: 13px;
}
.vivo-success {
    background: var(--vivo-success-bg);
    border: 1px solid var(--vivo-success-border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    color: var(--vivo-success-text);
}
.fi-sidebar {
    background-color: #ffffff !important;
    border-inline-end: 1px solid #e5e7eb !important;
    transition: width var(--sidebar-transition), transform var(--sidebar-transition), background-color var(--sidebar-transition), border-color var(--sidebar-transition) !important;
}
.fi-main {
    transition: margin-left var(--sidebar-transition), width var(--sidebar-transition) !important;
}
/* Logo hanya di sidebar, topbar hanya nama halaman */
.fi-topbar .fi-logo { display: none !important; }
.brand-full { height: 28px !important; width: auto !important; max-width: 170px !important; }
.brand-v { height: 28px !important; width: auto !important; display: none !important; }
body:has(.fi-sidebar-open) .brand-full { display: block !important; }
body:has(.fi-sidebar-open) .brand-v { display: none !important; }
body:not(:has(.fi-sidebar-open)) .brand-full { display: none !important; }
body:not(:has(.fi-sidebar-open)) .brand-v { display: block !important; }
/* Logo halaman login (auth panel): gambar, bukan teks */
.fi-simple-header .fi-logo img.brand-login-img {
    display: inline-block !important;
    height: 100% !important;
    width: auto !important;
    max-width: 220px !important;
    object-fit: contain !important;
    vertical-align: middle !important;
}

/* ===== Desktop: sidebar full sampai atas, topbar tidak full (mulai di kanan sidebar) ===== */
@media (min-width: 1024px) {
    /* Sidebar fixed dari y=0 sampai bawah, menutupi area kiri topbar */
    .fi-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        z-index: 40 !important;
    }
    /* Topbar hanya selebar area konten (di kanan sidebar) */
    .fi-topbar-ctn {
        margin-left: var(--sidebar-width, 16rem) !important;
        width: calc(100% - var(--sidebar-width, 16rem)) !important;
        transition: margin-left var(--sidebar-transition), width var(--sidebar-transition) !important;
    }
    /* Konten juga mulai setelah sidebar, tidak ketutup */
    .fi-main-ctn {
        margin-left: var(--sidebar-width, 16rem) !important;
        transition: margin-left var(--sidebar-transition) !important;
    }
    body:not(:has(.fi-sidebar-open)) .fi-topbar-ctn {
        margin-left: var(--sidebar-collapsed-width, 4.5rem) !important;
        width: calc(100% - var(--sidebar-collapsed-width, 4.5rem)) !important;
    }
    body:not(:has(.fi-sidebar-open)) .fi-main-ctn {
        margin-left: var(--sidebar-collapsed-width, 4.5rem) !important;
    }
    /* Jangan animasikan geseran saat load awal (sebelum Alpine init / masih x-cloak) */
    body:has(.fi-sidebar[x-cloak]) .fi-topbar-ctn,
    body:has(.fi-sidebar[x-cloak]) .fi-main-ctn {
        transition: none !important;
    }

    /* Sidebar header tampil (bukan kopong) di desktop */
    .fi-body-has-topbar .fi-sidebar-header {
        display: flex !important;
        height: 4rem !important;
        background-color: #ffffff !important;
        border-bottom: 1px solid #e5e7eb !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding-inline: 1rem !important;
    }
    .fi-sidebar-header-logo-ctn {
        display: flex !important;
        align-items: center !important;
    }
    body:not(:has(.fi-sidebar-open)) .fi-sidebar-header {
        justify-content: center !important;
        padding-inline: 0.5rem !important;
    }
}
.topbar-page-title {
    display: flex !important;
    align-items: center !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #242933 !important;
    margin-inline-start: 0.5rem !important;
    white-space: nowrap !important;
}
.dark .topbar-page-title { color: #f9fafb !important; }
.fi-topbar { background-color: #ffffff !important; border-bottom: 1px solid #e5e7eb !important; box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important; }
.fi-sidebar-nav, .fi-sidebar-group, .fi-sidebar-item-btn, .fi-sidebar-item-label, .fi-sidebar-item-btn svg, .fi-sidebar-group-items { transition: all var(--menu-transition) !important; }
.fi-sidebar-item-btn { transition: background-color var(--menu-transition), color var(--menu-transition), transform 0.2s ease, box-shadow 0.25s ease !important; }
.fi-sidebar-item-btn:active { transform: scale(0.98); }
.fi-sidebar-group-items { transform-origin: top center; }
.fi-sidebar-nav { background-color: #ffffff !important; }
.fi-sidebar-group-header-button-text, .fi-sidebar-group-header-text { color: #6b7280 !important; font-weight: 700 !important; }
.fi-sidebar-item-btn { color: #242933 !important; }
.fi-sidebar-item-btn .fi-sidebar-item-label { color: #242933 !important; }
.fi-sidebar-item-btn svg { color: #6b7280 !important; }
.fi-sidebar-item-btn:hover { background-color: #f3f4f6 !important; }
.fi-sidebar-item-btn:hover .fi-sidebar-item-label { color: #111827 !important; }
.fi-sidebar-item-btn:hover svg { color: #415FFF !important; }
.fi-sidebar-item.fi-active .fi-sidebar-item-btn { background-color: #415FFF !important; color: #ffffff !important; box-shadow: 0 4px 12px rgba(65, 95, 255, 0.25) !important; }
.fi-sidebar-item.fi-active .fi-sidebar-item-btn .fi-sidebar-item-label { color: #ffffff !important; }
.fi-sidebar-item.fi-active .fi-sidebar-item-btn svg { color: #ffffff !important; }
.fi-sidebar-item.fi-active .fi-sidebar-item-btn .fi-badge { background-color: #ffffff !important; color: #415FFF !important; }
.fi-sidebar-item .fi-badge { background-color: #415FFF !important; color: #ffffff !important; }
.fi-btn.fi-color-primary, .fi-ac-btn-action.fi-color-primary { background-color: #415FFF !important; }
.fi-btn.fi-color-primary:hover, .fi-ac-btn-action.fi-color-primary:hover { background-color: #2E3BCC !important; }
a { color: #415FFF; }
.fi-input, .fi-select-input { border-color: #e5e7eb !important; }
.fi-input:focus-within, .fi-select-input:focus-within { border-color: #415FFF !important; box-shadow: 0 0 0 3px rgba(65, 95, 255, 0.15) !important; }
.dark .fi-sidebar { background-color: #111827 !important; border-color: #1f2937 !important; }
.dark .fi-sidebar-header { background-color: #111827 !important; border-color: #1f2937 !important; }
.dark .fi-sidebar-nav { background-color: #111827 !important; }
.dark .fi-topbar { background-color: #111827 !important; border-color: #1f2937 !important; box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important; }
.dark .fi-sidebar-group-header-button-text, .dark .fi-sidebar-group-header-text { color: #9ca3af !important; }
.dark .fi-sidebar-item-btn { color: #e5e7eb !important; }
.dark .fi-sidebar-item-btn .fi-sidebar-item-label { color: #e5e7eb !important; }
.dark .fi-sidebar-item-btn svg { color: #9ca3af !important; }
.dark .fi-sidebar-item-btn:hover { background-color: #1f2937 !important; }
.dark .fi-sidebar-item-btn:hover .fi-sidebar-item-label { color: #ffffff !important; }
.dark .fi-sidebar-item-btn:hover svg { color: #415FFF !important; }
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-btn { background-color: #415FFF !important; color: #ffffff !important; }
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-btn .fi-sidebar-item-label { color: #ffffff !important; }
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-btn svg { color: #ffffff !important; }
.dark .fi-input, .dark .fi-select-input { background-color: #1f2937 !important; border-color: #374151 !important; color: #f9fafb !important; }
.dark a { color: #93c5fd; }
