/**
 * CST Management — tema brand (teal / biru)
 * Wajib dipisah light vs dark agar selaras dengan toggle Filament (html.dark)
 */

:root {
    --brand-teal: #0c8c8f;
    --brand-blue: #1565a8;
    --cst-dark-bg-from: #0f172a;
    --cst-dark-bg-to: #1e293b;
    --cst-dark-surface: rgba(30, 41, 59, 0.92);
    --cst-dark-border: rgba(12, 140, 143, 0.22);
    --cst-dark-text-muted: #94a3b8;
}

/* ========== LIGHT MODE (eksplisit) ========== */
html:not(.dark) .fi-simple-main,
html:not(.dark) .fi-main {
    background: linear-gradient(180deg, #f7fbfc 0%, #f2f7fb 100%);
}

html:not(.dark) .fi-sidebar {
    border-right: 1px solid rgba(12, 140, 143, 0.12);
    background: linear-gradient(
        180deg,
        rgba(12, 140, 143, 0.08) 0%,
        rgba(21, 101, 168, 0.06) 100%
    );
}

html:not(.dark) .fi-topbar {
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid rgba(12, 140, 143, 0.14);
}

html:not(.dark) .cst-topbar-pill {
    border: 1px solid rgba(12, 140, 143, 0.24);
    background: rgba(12, 140, 143, 0.08);
    color: #0b4f53;
}

html:not(.dark) .cst-topbar-link {
    border: 1px solid rgba(12, 140, 143, 0.24);
    background: #ffffff;
    color: #0b4f53;
}

html:not(.dark) .cst-topbar-link:hover {
    background: rgba(12, 140, 143, 0.1);
}

html:not(.dark) .cst-topbar-chip {
    border: 1px solid rgba(21, 101, 168, 0.24);
    background: rgba(21, 101, 168, 0.08);
    color: #0d3f68;
}

html:not(.dark) .cst-login-hero-title {
    color: #0f172a;
}

html:not(.dark) .cst-login-hero-subtitle {
    color: #475569;
}

html:not(.dark) .cst-login-footnote {
    color: #64748b;
}

/* ========== DARK MODE ========== */
html.dark .fi-simple-main,
html.dark .fi-main {
    background: linear-gradient(
        180deg,
        var(--cst-dark-bg-from) 0%,
        var(--cst-dark-bg-to) 100%
    );
}

html.dark .fi-sidebar {
    border-right: 1px solid var(--cst-dark-border);
    background: linear-gradient(
        180deg,
        rgba(12, 140, 143, 0.12) 0%,
        rgba(15, 23, 42, 0.98) 45%,
        rgba(15, 23, 42, 1) 100%
    );
}

/* Mobile sidebar: make panel solid and theme-aware */
@media (max-width: 768px) {
    html:not(.dark) .fi-sidebar {
        background: #f8fbfd !important;
        border-right: 1px solid rgba(12, 140, 143, 0.2) !important;
        backdrop-filter: none;
    }

    html.dark .fi-sidebar {
        background: #0f172a !important;
        border-right: 1px solid rgba(12, 140, 143, 0.3) !important;
        backdrop-filter: none;
    }
}

html.dark .fi-topbar {
    backdrop-filter: blur(10px);
    background: var(--cst-dark-surface);
    border-bottom: 1px solid var(--cst-dark-border);
}

html.dark .fi-ta-ctn,
html.dark .fi-section,
html.dark .fi-card {
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

html.dark .fi-header-heading {
    color: #f1f5f9;
}

html.dark .cst-topbar-pill {
    border: 1px solid rgba(12, 140, 143, 0.35);
    background: rgba(12, 140, 143, 0.15);
    color: #a7f3d0;
}

html.dark .cst-topbar-link {
    border: 1px solid rgba(12, 140, 143, 0.35);
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
}

html.dark .cst-topbar-link:hover {
    background: rgba(12, 140, 143, 0.2);
    color: #f8fafc;
}

html.dark .cst-topbar-chip {
    border: 1px solid rgba(21, 101, 168, 0.4);
    background: rgba(21, 101, 168, 0.2);
    color: #bfdbfe;
}

html.dark .cst-login-hero-title {
    color: #f1f5f9;
}

html.dark .cst-login-hero-subtitle {
    color: var(--cst-dark-text-muted);
}

html.dark .cst-login-footnote {
    color: #64748b;
}

/* ========== BERSAMA (radius & tipografi) ========== */
.fi-sidebar-item-button,
.fi-topbar-item-btn,
.fi-btn {
    border-radius: 0.75rem;
}

.fi-ta-ctn,
.fi-section,
.fi-card {
    border-radius: 1rem;
}

html:not(.dark) .fi-ta-ctn,
html:not(.dark) .fi-section,
html:not(.dark) .fi-card {
    border-color: rgba(12, 140, 143, 0.14);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.fi-header-heading {
    letter-spacing: -0.01em;
    font-weight: 700;
}

.fi-sidebar-header {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.cst-topbar-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cst-topbar-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--brand-teal), var(--brand-blue));
}

.cst-topbar-meta {
    display: none;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (min-width: 1024px) {
    .cst-topbar-meta {
        display: inline-flex;
    }
}

.cst-topbar-link {
    padding: 0.3rem 0.65rem;
    border-radius: 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.cst-topbar-chip {
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.cst-login-hero {
    margin-bottom: 1rem;
    text-align: center;
}

.cst-login-hero-logo {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 0.75rem;
    object-fit: contain;
}

.cst-login-hero-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.cst-login-hero-subtitle {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
}

.cst-login-footnote {
    margin-top: 1rem;
    font-size: 0.75rem;
    text-align: center;
}
