 :root {
    --afc-green: #004225;
    --afc-green-soft: #035c33;
    --afc-gold: #cea63b;
    --afc-bg: #f3f4f6;
    --afc-surface: #ffffff;
    --afc-border: #e1e5eb;
    --afc-text: #111827;
    --afc-muted: #6b7280;
}

body {
    font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.94rem;
    background-color: var(--afc-bg);
    color: var(--afc-text);
}

a {
    color: var(--afc-green);
}

a:hover {
    color: var(--afc-green-soft);
}

#wrapper {
    min-height: 100vh;
}

#sidebar-wrapper {
    min-width: 240px;
    max-width: 240px;
    box-shadow: 2px 0 8px rgba(15, 23, 42, 0.08);
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: -240px;
}

.bg-sidebar {
    background: linear-gradient(180deg, #02492a, #002f1b);
}

.sidebar-heading {
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.bg-sidebar-item {
    background-color: transparent;
    color: #e4f2ea;
    border: 0;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    font-size: 0.93rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background-color 0.18s ease, color 0.18s ease, padding-left 0.18s ease;
}

.bg-sidebar-item .bi {
    font-size: 1.05rem;
}

.bg-sidebar-item:hover,
.bg-sidebar-item.active {
    background-color: var(--afc-green-soft);
    color: #ffffff;
    padding-left: 1.4rem;
}

#page-content-wrapper {
    background-color: var(--afc-bg);
}

.navbar {
    z-index: 1000;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.navbar-brand {
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-success,
.btn-primary {
    background-color: var(--afc-green);
    border-color: var(--afc-green);
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.35);
    transition: box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

.btn-success:hover,
.btn-primary:hover {
    background-color: var(--afc-green-soft);
    border-color: var(--afc-green-soft);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.btn-outline-secondary {
    border-color: var(--afc-border);
}

.card {
    border-radius: 0.9rem;
    border-color: var(--afc-border);
    background-color: var(--afc-surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.card:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.card-header {
    border-bottom-color: rgba(148, 163, 184, 0.35);
}

.kpi-card {
    border: 0;
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), transparent 55%), var(--afc-surface);
}

.kpi-label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--afc-muted);
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 600;
}

.kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(16, 185, 129, 0.12);
    color: var(--afc-green);
}

.table thead {
    background-color: #f9fafb;
}

.table thead th {
    border-bottom-width: 1px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--afc-muted);
}

.table tbody tr:hover {
    background-color: #f3f4ff;
}

.table tbody td {
    vertical-align: middle;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 55%),
                radial-gradient(circle at bottom right, rgba(251, 191, 36, 0.18), transparent 55%),
                #0f172a;
}

.login-card-wrapper {
    max-width: 460px;
    width: 100%;
}

.login-card {
    border-radius: 1rem;
    overflow: hidden;
}

.login-card .card-header {
    border-bottom: 0;
}

.login-subtitle {
    font-size: 0.82rem;
    color: rgba(226, 232, 240, 0.9);
}

.form-control, .form-select {
    border-radius: 0.55rem;
    border-color: var(--afc-border);
}

.form-control:focus, .form-select:focus {
    border-color: var(--afc-green);
    box-shadow: 0 0 0 1px rgba(4, 120, 87, 0.35);
}

/* Mobile responsiveness */
@media (max-width: 767.98px) {
    #sidebar-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        margin-left: -240px; /* hidden by default */
        transition: margin-left 0.2s ease-in-out;
        z-index: 1030;
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0; /* show drawer when toggled on mobile */
    }

    #page-content-wrapper {
        min-width: 100vw;
    }

    main.flex-fill {
        padding: 0.9rem !important;
    }

    .navbar .btn#sidebarToggle {
        padding: 0.25rem 0.5rem;
    }

    .table thead th {
        font-size: 0.72rem;
    }

    .table tbody td {
        font-size: 0.8rem;
    }
}
