/*
 * Blue + gold theme - matches the client's brand: blue chrome (topbar/
 * sidebar/login) with gold used sparingly for emphasis (active sidebar
 * item), blue reused as the general accent color for buttons/links on white
 * backgrounds since white-on-gold fails contrast. The .btn-primary/
 * .text-primary/etc. overrides below reskin Bootstrap's "primary" utility
 * classes to match, since the CDN-compiled bootstrap.min.css bakes in its
 * own blue rather than reading a CSS variable - these rules rely on app.css
 * loading after Bootstrap's stylesheet (see layout/fragments.html ::
 * htmlhead) to win on specificity.
 */
:root {
    --brand-primary: #0c5fc7;
    --brand-primary-dark: #073e85;
    --brand-accent: #0c5fc7;
    --brand-accent-dark: #094a9e;
    --brand-accent-light: #e7f0fc;
    --brand-gold: #f7b500;
    --brand-gold-dark: #d99e00;
}

body {
    background-color: #f4f6fb;
}

.btn-primary {
    background-color: var(--brand-accent);
    border-color: var(--brand-accent);
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
    background-color: var(--brand-accent-dark) !important;
    border-color: var(--brand-accent-dark) !important;
}

.btn-outline-primary {
    color: var(--brand-accent);
    border-color: var(--brand-accent);
}
.btn-outline-primary:hover,
.btn-outline-primary:active {
    background-color: var(--brand-accent) !important;
    border-color: var(--brand-accent) !important;
}

.text-primary { color: var(--brand-accent) !important; }
.bg-primary { background-color: var(--brand-accent) !important; }
.border-primary { border-color: var(--brand-accent) !important; }
.badge.bg-primary { background-color: var(--brand-accent) !important; }

a { color: var(--brand-accent-dark); }
a:hover { color: var(--brand-accent); }

.progress-bar { background-color: var(--brand-accent); }

.form-check-input:checked {
    background-color: var(--brand-accent);
    border-color: var(--brand-accent);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 .25rem rgba(12, 95, 199, .25);
}

.nav-pills .nav-link.active,
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--brand-accent) !important;
}

.page-link { color: var(--brand-accent-dark); }
.page-item.active .page-link {
    background-color: var(--brand-accent);
    border-color: var(--brand-accent);
}

body:has(.app-topbar) {
    padding-top: 56px;
}

.app-topbar {
    background-color: var(--brand-primary);
    z-index: 1040;
    height: 56px;
}

.app-topbar .navbar-brand {
    height: 40px;
    display: flex;
    align-items: center;
}

.app-sidebar {
    top: 56px;
    width: 250px;
    background: linear-gradient(180deg, var(--brand-primary), var(--brand-primary-dark));
    border-right: 1px solid var(--brand-primary-dark);
    height: calc(100vh - 56px);
}

.app-sidebar-nav .nav-link {
    color: rgba(255, 255, 255, .85);
    padding: .65rem 1.1rem;
    border-radius: 0;
}

.app-sidebar-nav .nav-link:hover,
.app-sidebar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, .08);
    color: var(--brand-gold);
    font-weight: 700;
}

.app-sidebar-nav .collapse .nav-link {
    color: rgba(255, 255, 255, .7);
}
.app-sidebar-nav .collapse .nav-link:hover,
.app-sidebar-nav .collapse .nav-link.active {
    color: var(--brand-gold);
}

.app-content {
    margin-left: 250px;
    padding: 1.5rem;
    transition: margin-left .2s ease;
}

@media (max-width: 991.98px) {
    .app-content {
        margin-left: 0;
    }
}

/*
 * Bootstrap's .offcanvas-lg resets position to static at >=992px (so it can sit
 * inline without JS). This app relies on a permanently fixed sidebar instead, so
 * that reset is overridden here to restore fixed positioning + the hide/unhide
 * toggle. Toggling `left` (not `margin-left`) avoids the over-constrained box
 * model that would otherwise make the browser discard the margin.
 */
@media (min-width: 992px) {
    .app-sidebar.offcanvas-lg {
        position: fixed !important;
        left: 0;
        transition: left .2s ease;
    }

    body.sidebar-hidden .app-sidebar.offcanvas-lg {
        left: -250px;
    }

    body.sidebar-hidden .app-content {
        margin-left: 0;
    }
}

.stat-card {
    border: none;
    border-radius: .75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* Icon badge shown above a stat value, e.g. dashboard/ESG KPI tiles. */
.icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}
.icon-circle-accent {
    background-color: var(--brand-accent-light);
    color: var(--brand-accent);
}

.stat-card .stat-value {
    font-size: 1.9rem;
    font-weight: 700;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    padding-top: 0;
}

.login-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    max-width: 420px;
    width: 100%;
}

.badge-sifat-rahasia { background-color: #b3261e; }
.badge-sifat-penting { background-color: #b3720b; }
.badge-sifat-biasa { background-color: #6c757d; }

.table-responsive-card .table td, .table-responsive-card .table th {
    vertical-align: middle;
}
