/* ============================================================
   Mkopo360 - Custom Styles
   Brand: Navy (#1E3A8A) + Teal (#22BFA3)
   Font: Inter
   Mobile-first
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
    --navy: #1E3A8A;
    --navy-dark: #162D6B;
    --navy-light: #2B4FA8;
    --teal: #22BFA3;
    --teal-dark: #1A9A83;
    --teal-light: #3CD4B8;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-500: #64748B;
    --gray-700: #334155;
    --gray-900: #0F172A;
    --danger: #DC2626;
    --warning: #F59E0B;
    --success: #16A34A;
    --sidebar-width: 250px;
    --navbar-height: 56px;
    --bottom-nav-height: 64px;
}

/* ---- Base ---- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}


/* ---- Navbar ---- */
.bg-navy {
    background-color: var(--navy) !important;
}

.navbar {
    height: var(--navbar-height);
    z-index: 1040;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.navbar-brand {
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}


/* ---- Sidebar (Desktop) ---- */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: #fff;
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    z-index: 1030;
    transition: transform 0.25s ease;
}

.sidebar-inner {
    padding: 1rem 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-heading {
    padding: 1.25rem 1.25rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background-color: var(--gray-100);
    color: var(--navy);
}

.sidebar-link.active {
    background-color: rgba(30, 58, 138, 0.06);
    color: var(--navy);
    border-left-color: var(--teal);
    font-weight: 600;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 0.9375rem;
}

/* Sidebar collapsed */
.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Hide sidebar on mobile */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }
}


/* ---- Main Content ---- */
.page-wrapper {
    display: flex;
    padding-top: var(--navbar-height);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left 0.25s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 0;
}

@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
        padding-bottom: var(--bottom-nav-height);
    }
}


/* ---- Bottom Navigation (Mobile) ---- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: #fff;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1040;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.08);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.375rem 0.75rem;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.6875rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.bottom-nav-item i {
    font-size: 1.125rem;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--teal);
}


/* ---- Public Pages (Login, Reset) ---- */
.public-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    padding: 2.5rem 2rem;
}

.auth-card .brand-section {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card .brand-section img {
    height: 48px;
    margin-bottom: 0.75rem;
}

.auth-card .brand-section h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}

.auth-card .brand-section p {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}


/* ---- Cards ---- */
.card {
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    padding: 0.875rem 1.25rem;
}


/* ---- Stat Cards (Dashboard) ---- */
.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1.25rem;
    transition: box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: #fff;
}

.stat-icon.bg-navy-light { background-color: var(--navy-light); }
.stat-icon.bg-teal { background-color: var(--teal); }
.stat-icon.bg-warning { background-color: var(--warning); }
.stat-icon.bg-danger { background-color: var(--danger); }
.stat-icon.bg-success { background-color: var(--success); }

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    margin-top: 0.75rem;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
}


/* ---- Buttons ---- */
.btn-navy {
    background-color: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.btn-navy:hover,
.btn-navy:focus {
    background-color: var(--navy-dark);
    border-color: var(--navy-dark);
    color: #fff;
}

.btn-teal {
    background-color: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.btn-teal:hover,
.btn-teal:focus {
    background-color: var(--teal-dark);
    border-color: var(--teal-dark);
    color: #fff;
}

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

.btn-outline-navy:hover {
    background-color: var(--navy);
    color: #fff;
}


/* ---- Tables ---- */
.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
}


/* ---- Status Badges ---- */
.badge-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3em 0.65em;
    border-radius: 6px;
}

.badge-active { background-color: #DCFCE7; color: #166534; }
.badge-pending { background-color: #FEF9C3; color: #854D0E; }
.badge-approved { background-color: #DBEAFE; color: #1E40AF; }
.badge-rejected { background-color: #FEE2E2; color: #991B1B; }
.badge-repaid { background-color: #D1FAE5; color: #065F46; }
.badge-defaulted { background-color: #FEE2E2; color: #991B1B; }
.badge-overdue { background-color: #FFE4E6; color: #9F1239; }
.badge-partial { background-color: #FEF3C7; color: #92400E; }
.badge-complete { background-color: #D1FAE5; color: #065F46; }
.badge-disbursed { background-color: #E0E7FF; color: #3730A3; }
.badge-blacklisted { background-color: #1F2937; color: #F9FAFB; }
.badge-suspended { background-color: #FED7AA; color: #9A3412; }
.badge-cleared { background-color: #E0E7FF; color: #3730A3; }


/* ---- Forms ---- */
.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(34, 191, 163, 0.15);
}

.form-text {
    font-size: 0.8125rem;
}


/* ---- Honeypot (hidden from real users) ---- */
.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}


/* ---- Page Headers ---- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.breadcrumb {
    font-size: 0.8125rem;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--teal);
    text-decoration: none;
}


/* ---- Utility ---- */
.text-navy { color: var(--navy) !important; }
.text-teal { color: var(--teal) !important; }
.bg-navy { background-color: var(--navy) !important; }
.bg-teal { background-color: var(--teal) !important; }

.fw-500 { font-weight: 500; }

/* Mobile overlay when sidebar is open */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1025;
}

.sidebar-overlay.show {
    display: block;
}

@media (max-width: 991.98px) {
    .page-header h1 {
        font-size: 1.125rem;
    }
}


/* ---- Print ---- */
@media print {
    .navbar,
    .sidebar,
    .bottom-nav,
    .btn {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
}
