/* assets/css/style.css - With Clear Containers & Slide-Out Mobile Menu */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e2b3a;
    line-height: 1.6;
    background-color: #ffffff;
    transition: transform 0.3s ease;
}

/* ===== TYPOGRAPHY ===== */
h1 {
    font-size: 3.2rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #ffffff;
}

h2 {
    font-size: 2.2rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    color: #0a2540;
    margin-bottom: 2.5rem;
    text-align: center;
}

h3 {
    font-size: 1.4rem;
    font-weight: 400;
    color: #0a2540;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #0a2540;
    margin-bottom: 0.75rem;
}

p {
    color: #4a5a6a;
    font-weight: 300;
    margin-bottom: 1.5rem;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== HEADER ===== */
header {
    background: #0a2540;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h2 {
    color: white;
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin: 0;
}

/* Desktop Navigation */
nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    white-space: nowrap;
}

nav a:hover {
    color: white;
}

.btn {
    background: #439958;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    color: white !important;
}

.btn:hover {
    background: #367a46;
}

/* ===== MOBILE SLIDE-OUT MENU ===== */

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    line-height: 1;
}

/* Overlay background (darkens page when menu is open) */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile navigation panel - slides in from left */
.mobile-nav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #0a2540;
    z-index: 1002;
    transition: left 0.3s ease;
    padding: 2rem 0;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.mobile-nav.active {
    left: 0;
}

/* Close button inside menu */
.mobile-nav-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1003;
}

/* Menu header inside mobile nav */
.mobile-nav-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.mobile-nav-header h3 {
    color: white;
    font-size: 1.2rem;
    margin: 0;
}

/* Mobile navigation links */
.mobile-nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.mobile-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.mobile-nav .btn {
    background: #439958;
    margin: 1rem 1.5rem;
    display: block;
    text-align: center;
    padding: 0.8rem;
    border-radius: 8px;
    color: white !important;
}

/* Prevent body scrolling when menu is open */
body.menu-open {
    overflow: hidden;
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, #0a2540 0%, #2a4a3f 100%);
    padding: 6rem 2rem;
    text-align: center;
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin: 1.5rem 0 2rem 0;
}

.cta {
    display: inline-block;
    background: #439958;
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.cta:hover {
    background: #367a46;
}

/* ===== SECTION CONTAINERS ===== */
.section {
    padding: 5rem 0;
}

.section.dark {
    background: #f8fafc;
}

/* ===== BUSINESS LINES CONTAINER ===== */
.business-lines-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.business-lines-container h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.business-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Individual Business Line Card */
.business-card {
    background: white;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.business-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #d0d9e0;
}

.business-card h3 {
    margin-bottom: 1rem;
    color: #0a2540;
}

.business-card p {
    color: #4a5a6a;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.business-card a {
    color: #439958;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.business-card a:hover {
    color: #367a46;
}

/* ===== WHY CHOOSE US CONTAINER ===== */
.why-choose-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.why-choose-container h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Individual Why Choose Card */
.why-card {
    background: white;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.why-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #d0d9e0;
}

.why-card h4 {
    color: #0a2540;
    margin-bottom: 1rem;
    font-weight: 500;
}

.why-card p {
    color: #4a5a6a;
    margin: 0;
    font-size: 0.95rem;
}

/* Subtle accent line */
.why-card h4::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: #439958;
    margin: 0.75rem auto 0;
}

/* ===== FINAL CALL SECTION ===== */
.final-call {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 2rem;
}

.final-call h2 {
    margin-bottom: 1.5rem;
}

.final-call p {
    margin-bottom: 2rem;
    color: #4a5a6a;
}

/* ===== FOOTER ===== */
footer {
    background: #0a2540;
    color: white;
    text-align: center;
    padding: 2rem;
}

footer p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: 0.9rem;
}

/* ===== PAGE CONTAINER STYLES ===== */

/* Page Header (for interior pages) */
.page-header {
    background: linear-gradient(135deg, #0a2540 0%, #1a3a4a 100%);
    padding: 4rem 2rem;
    text-align: center;
}

.page-header h1 {
    color: white;
    font-size: 2.8rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.page-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Content Container - for consistent width */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

/* Text content styling */
.text-content h2 {
    text-align: left;
    margin-bottom: 1.5rem;
}

.text-content h3 {
    margin: 2rem 0 1rem 0;
    color: #0a2540;
}

.text-content p {
    margin-bottom: 1.5rem;
    color: #4a5a6a;
}

/* Image placeholder */
.image-placeholder {
    background: #f0f4f8;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    color: #8a9aaa;
    border: 1px solid #eef2f6;
}

/* Team grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.team-card {
    background: white;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #d0d9e0;
}

.team-card h3 {
    margin: 1rem 0 0.25rem 0;
    color: #0a2540;
}

.team-card .title {
    color: #439958;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.team-card p {
    color: #4a5a6a;
    font-size: 0.9rem;
    margin: 0;
}

/* Values grid */
.values-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 3rem 0;
}

.value-item {
    text-align: center;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 16px;
}

.value-item h4 {
    color: #0a2540;
    margin-bottom: 0.5rem;
}

/* Mobile - Hide desktop nav, show slide-out menu */
@media (max-width: 768px) {

    /* Show mobile menu button */
    .mobile-menu-btn {
        display: block;
    }

    /* Hide desktop navigation */
    nav {
        display: none !important;
    }

    /* Adjust header spacing */
    header .container {
        padding: 0 1rem;
    }

    header h2 {
        font-size: 1rem;
    }

    /* Typography */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    /* Hero section */
    .hero {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Grids to single column */
    .business-grid,
    .why-grid,
    .team-grid,
    .values-grid,
    .two-column {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Card padding */
    .business-card,
    .why-card,
    .team-card {
        padding: 1.5rem;
    }

    /* Page header */
    .page-header {
        padding: 3rem 1rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    /* Content containers */
    .container,
    .content-container,
    .business-lines-container,
    .why-choose-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Touch targets */
    button,
    .btn,
    .cta,
    nav a,
    .card a,
    .action-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ===== MOBILE RESPONSIVE BREAKPOINTS ===== */

/* Tablet */
@media (max-width: 1024px) {
    nav {
        gap: 1rem;
    }

    nav a {
        font-size: 0.8rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    header h2 {
        font-size: 0.9rem;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-menu-btn {
        font-size: 1.5rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .business-card,
    .why-card {
        padding: 1.2rem;
    }
}

/* Fix for very small phones */
@media (max-width: 360px) {
    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .business-card,
    .why-card {
        padding: 1rem;
    }
}

/* ===== UNIVERSAL MOBILE FIXES ===== */
@media (max-width: 768px) {

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
    }

    /* Ensure all containers stay within screen */
    .container,
    .content-container,
    .business-lines-container,
    .why-choose-container,
    .apply-container,
    .dashboard-container,
    .login-container,
    .register-container {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Force all grids to single column */
    .grid,
    .business-grid,
    .why-grid,
    .team-grid,
    .values-grid,
    [class*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Ensure all cards fit */
    .card,
    .business-card,
    .why-card,
    .team-card,
    .metric-card,
    .report-card {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    /* Fix images */
    img,
    video,
    iframe {
        max-width: 100%;
        height: auto;
    }

    /* Fix text wrapping */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    a,
    span,
    div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* ===== FIX FOR SCROLLING SECTIONS ON ABOUT & INVESTOR PAGES ===== */

/* Remove any overflow that causes independent scrolling */
.content-container,
.team-grid,
.values-grid,
.investor-contact,
.report-cards {
    overflow: visible !important;
}

/* Ensure team cards display properly without scroll */
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    overflow: visible;
    max-height: none;
}

/* Ensure values grid displays properly */
.values-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    overflow: visible;
    max-height: none;
}

/* Fix for investor relations sections */
.investor-contact {
    overflow: visible;
    max-height: none;
    margin-bottom: 2rem;
}

.report-cards {
    overflow: visible;
    max-height: none;
}

/* Mobile adjustments for these fixes */
@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        overflow: visible;
        max-height: none;
    }

    .values-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        overflow: visible;
        max-height: none;
    }

    .team-card,
    .value-item {
        width: 100%;
        margin: 0;
        overflow: visible;
    }
}

/* ===== STAFF PAGE OPTIMIZATIONS ===== */

/* Fix for header layout on staff pages */
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Ensure staff name and logout don't break layout */
header .container>div:last-child {
    display: flex;
    align-items: center;
    gap: 1rem;
}


/* Fix for metric cards on mobile */
@media (max-width: 768px) {

    /* Ensure all cards stay within screen */
    .metric-card,
    .stat-card {
        width: 100%;
        box-sizing: border-box;
        padding: 1rem;
        margin: 0;
        overflow: hidden;
    }

    /* Fix metric values to wrap properly */
    .metric-value,
    .stat-value {
        font-size: 1.5rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    /* Fix metric labels */
    .metric-label {
        font-size: 0.75rem;
        white-space: normal;
        word-wrap: break-word;
    }

    /* Ensure grid containers don't overflow */
    .metrics-grid,
    .stats-grid {
        width: 100%;
        overflow: hidden;
    }

    /* Fix for portfolio charts */
    .chart-container {
        height: 200px;
    }

    /* Fix for tables on mobile */
    .loan-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    /* Fix for date range selector */
    .date-range {
        flex-direction: column;
        align-items: flex-start;
    }

    .date-input,
    .export-btn {
        width: 100%;
    }
}

/* ===== FINAL DASHBOARD & MOBILE OVERRIDES ===== */

@media (max-width: 768px) {

    /* 1. Force the root container to stop expanding */
    html,
    body {
        overflow-x: hidden !important;
        position: relative;
        width: 100%;
        max-width: 100%;
    }

    /* 2. Fix all main containers */
    .portfolio-container,
    .dashboard-container,
    .risk-container,
    .team-container,
    .reports-container,
    .kyc-container,
    .cashflow-container,
    .reconciliation-container,
    .admin-container {
        width: 100%;
        max-width: 100%;
        padding: 0 1rem !important;
        margin: 1rem auto !important;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }

    /* 3. Make tables scrollable horizontally - THIS IS THE KEY FIX */
    .loan-table,
    .table-responsive,
    [class*="table"] {
        display: block;
        width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin: 1rem 0;
        white-space: nowrap;
    }

    /* 4. Ensure tables inside containers are scrollable */
    .loan-table table,
    .table-responsive table {
        width: 100%;
        min-width: 600px;
        display: table;
    }

    /* 5. Add visual hint that table is scrollable */
    .loan-table::after,
    .table-responsive::after {
        content: "← Scroll horizontally →";
        display: block;
        font-size: 0.7rem;
        color: #8a9aaa;
        text-align: right;
        margin-top: 0.5rem;
        padding-right: 0.5rem;
    }

    /* 6. Fix cards - prevent overflow */
    .metric-card,
    .stat-card,
    .business-card,
    .why-card,
    .team-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
        overflow: hidden;
    }

    /* 7. Fix metric values */
    .metric-value,
    .stat-value {
        font-size: 1.25rem !important;
        word-break: break-word;
        white-space: normal;
        overflow-wrap: break-word;
    }

    /* 8. Fix metric labels */
    .metric-label {
        font-size: 0.75rem !important;
        white-space: normal;
        word-break: break-word;
    }

    /* 9. Fix grids to single column */
    .metrics-grid,
    .stats-grid,
    .dashboard-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        width: 100%;
    }

    /* 10. Fix charts */
    .chart-container {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        position: relative;
    }

    .chart-container canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* 11. Fix date range selector */
    .date-range {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
        width: 100%;
    }

    .date-range label {
        width: 100%;
    }

    .date-input,
    .export-btn,
    .refresh-btn {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* 12. Fix section headers */
    .section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem;
        width: 100%;
    }

    .section-header>div {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .section-header .export-btn {
        width: 100% !important;
    }

    /* 13. Fix table cells on mobile */
    th,
    td {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    /* 14. Fix risk badges */
    .risk-badge {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.5rem !important;
    }

    /* 15. Fix alert banners */
    .alert-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .alert-link {
        align-self: flex-start;
    }

    /* 16. Fix header */
    header .container {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0 1rem;
    }

    /* 17. Fix footer */
    footer {
        padding: 1rem;
        text-align: center;
    }
}

/* Small mobile (below 480px) */
@media (max-width: 480px) {

    .metric-value,
    .stat-value {
        font-size: 1rem !important;
    }

    th,
    td {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.7rem !important;
    }

    .section-title {
        font-size: 1rem !important;
    }

    .chart-container {
        height: 200px !important;
    }

    .loan-table::after,
    .table-responsive::after {
        font-size: 0.6rem;
    }
}

/* ===== APPLICATIONS PAGE FIXES ===== */

/* Fix header contrast - ensure dark text on light background */
.applications-container .page-header h1 {
    color: #0a2540 !important;
    font-size: 1.8rem;
    font-weight: 400;
}

/* Fix stats pills background */
.stat-pill {
    background: white;
    border: 1px solid #eef2f6;
    color: #1e2b3a;
}

.stat-pill .count {
    color: #0a2540;
    font-weight: 600;
}

/* Mobile optimizations for applications page */
@media (max-width: 768px) {
    .applications-container {
        padding: 0 1rem !important;
        margin: 1rem auto !important;
        width: 100%;
        box-sizing: border-box;
    }

    /* Make the table container scrollable */
    .applications-table {
        width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px;
    }

    /* Ensure table has minimum width for horizontal scroll */
    .applications-table table {
        min-width: 700px;
        width: 100%;
        border-collapse: collapse;
    }

    /* Add scroll hint */
    .applications-table {
        position: relative;
    }

    .applications-table::after {
        content: "← Scroll horizontally to see all columns →";
        display: block;
        font-size: 0.7rem;
        color: #8a9aaa;
        text-align: center;
        margin-top: 0.75rem;
        padding-bottom: 0.5rem;
    }

    /* Fix filters stacking */
    .filters {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-box,
    .filter-select {
        width: 100%;
        box-sizing: border-box;
    }

    /* Fix stats bar scrolling */
    .stats-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }

    .stat-pill {
        white-space: nowrap;
    }

    /* Fix table cells for better readability */
    th,
    td {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.8rem !important;
    }

    .action-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
}

/* ============================================ */
/* STAFF PAGE OPTIMIZATION - MOBILE & RESPONSIVE */
/* ============================================ */

/* 1. FIX FOR ALL STAFF CONTAINERS */
.assessment-container,
.applications-container,
.portfolio-container,
.dashboard-container,
.risk-container,
.team-container,
.reports-container,
.kyc-container,
.cashflow-container,
.reconciliation-container,
.admin-container,
.offers-container {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

/* 2. FIX FOR ALL FORM CARDS */
.applicant-card,
.assessment-card,
.section-card,
.create-card,
.accounts-card,
.form-card,
.report-card {
    background: white;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
}

/* 3. FIX FOR ALL INFO GRIDS */
.info-grid,
.form-row,
.two-column {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* 4. FIX FOR ALL STATS GRIDS */
.stats-grid,
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 5. FIX FOR ALL STAT CARDS */
.stat-card,
.metric-card {
    background: white;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

/* 6. FIX FOR ALL BUTTONS */
.action-btn,
.btn-primary,
.btn-secondary,
.login-button,
.register-button {
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
}

/* 7. FIX FOR ALL TABLES */
.applications-table,
.risk-table,
.loan-table,
.kyc-table,
.audit-table {
    background: white;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.applications-table table,
.risk-table table,
.loan-table table,
.kyc-table table,
.audit-table table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eef2f6;
}

th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e2b3a;
}

td {
    color: #1e2b3a;
}

/* 8. FIX FOR ALL INPUTS AND SELECTS */
input,
select,
textarea {
    border: 1px solid #d0d9e0;
    border-radius: 8px;
    padding: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #1e2b3a;
    background: white;
    width: 100%;
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #439958;
    box-shadow: 0 0 0 3px rgba(67, 153, 88, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: #8a9aaa;
}

/* 9. FIX FOR ALL HEADERS */
.page-header h1,
.risk-header h1,
.team-container .page-header h1,
.reports-container .page-header h1 {
    color: whitesmoke;
    font-size: 1.8rem;
    font-weight: 500;
    margin: 0;
}

/* 10. FIX FOR ALL FILTERS */
.filters,
.date-range {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-select,
.search-box,
.date-input {
    padding: 0.5rem 1rem;
    border: 1px solid #d0d9e0;
    border-radius: 8px;
    background: white;
    font-family: 'Inter', sans-serif;
    color: #1e2b3a;
}

/* 11. FIX FOR ALL STAT PILLS */
.stats-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-pill {
    background: white;
    border: 1px solid #eef2f6;
    border-radius: 30px;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    color: #1e2b3a;
}

.stat-pill .count {
    font-weight: 600;
    color: #0a2540;
    margin-right: 0.3rem;
}

/* 12. FIX FOR ALL STATUS BADGES */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pending {
    background: #fff3e0;
    color: #b85c00;
}

.status-under-review {
    background: #e3f2fd;
    color: #0b5e7e;
}

.status-approved {
    background: #e8f5e9;
    color: #1e5a2a;
}

.status-rejected {
    background: #ffebee;
    color: #a51e2a;
}

.status-verified {
    background: #e8f5e9;
    color: #1e5a2a;
}

.status-flagged {
    background: #ffebee;
    color: #a51e2a;
}

/* 13. FIX FOR ALL BACK LINKS */
.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #439958;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* 14. FIX FOR RISK BADGES */
.risk-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
}

.risk-1 {
    background: #c8e6c9;
    color: #2e7d32;
}

.risk-2 {
    background: #dcedc8;
    color: #558b2f;
}

.risk-3 {
    background: #fff9c4;
    color: #f57f17;
}

.risk-4 {
    background: #ffccbc;
    color: #bf360c;
}

.risk-5 {
    background: #ffcdd2;
    color: #c62828;
}

/* 15. FIX FOR RATING BADGE */
.rating-badge {
    background: #439958;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 500;
}

/* 16. FIX FOR SECTION HEADERS */
.section-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eef2f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #0a2540;
}

/* 17. FIX FOR EXPORT BUTTONS */
.export-btn {
    background: #f8fafc;
    border: 1px solid #eef2f6;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.export-btn:hover {
    background: #eef2f6;
}

/* 18. FIX FOR ALERT BANNERS */
.alert-banner {
    background: #ffebee;
    border-left: 4px solid #c62828;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.alert-text {
    color: #c62828;
    font-weight: 500;
}

/* 19. FIX FOR CHARTS */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.chart-card {
    background: white;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 1.5rem;
}

.chart-title {
    font-size: 1rem;
    font-weight: 500;
    color: #0a2540;
    margin-bottom: 1rem;
}

/* ============================================ */
/* MOBILE BREAKPOINTS - 768px AND BELOW */
/* ============================================ */

@media (max-width: 768px) {

    /* Container padding */
    .assessment-container,
    .applications-container,
    .portfolio-container,
    .dashboard-container,
    .risk-container,
    .team-container,
    .reports-container,
    .kyc-container,
    .cashflow-container,
    .reconciliation-container,
    .admin-container,
    .offers-container {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    /* Headers */
    .page-header h1,
    .risk-header h1,
    .team-container .page-header h1,
    .reports-container .page-header h1 {
        font-size: 1.5rem;
    }

    /* Grids to single column */
    .stats-grid,
    .metrics-grid,
    .team-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Info grids to single column */
    .info-grid,
    .form-row,
    .two-column {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Filters stack vertically */
    .filters,
    .date-range {
        flex-direction: column;
        width: 100%;
    }

    .search-box,
    .filter-select,
    .date-input {
        width: 100%;
        box-sizing: border-box;
    }

    /* Stats bar horizontal scroll */
    .stats-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .stat-pill {
        white-space: nowrap;
    }

    /* Tables - make scrollable */
    .applications-table,
    .risk-table,
    .loan-table,
    .kyc-table,
    .audit-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .applications-table table,
    .risk-table table,
    .loan-table table,
    .kyc-table table,
    .audit-table table {
        min-width: 700px;
    }

    /* Add scroll hint for tables */
    .applications-table::after,
    .risk-table::after,
    .loan-table::after,
    .kyc-table::after,
    .audit-table::after {
        content: "← Scroll horizontally →";
        display: block;
        font-size: 0.7rem;
        color: #8a9aaa;
        text-align: right;
        margin-top: 0.5rem;
        padding: 0.5rem;
    }

    /* Table cells */
    th,
    td {
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    /* Cards */
    .applicant-card,
    .assessment-card,
    .section-card,
    .create-card,
    .accounts-card,
    .form-card,
    .report-card {
        padding: 1rem;
    }

    /* Action buttons stack */
    .action-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-primary,
    .btn-secondary,
    .action-btn {
        width: 100%;
        text-align: center;
    }

    /* Section header */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Export buttons full width */
    .export-btn {
        width: 100%;
        text-align: center;
    }

    /* Charts */
    .chart-container {
        height: 200px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Rating badge */
    .rating-badge {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }

    /* Alert banner */
    .alert-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Form inputs */
    input,
    select,
    textarea {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .scorecard-section label {
        font-size: 0.85rem;
    }
}

/* ============================================ */
/* EXTRA SMALL MOBILE - 480px AND BELOW */
/* ============================================ */

@media (max-width: 480px) {

    .page-header h1,
    .risk-header h1,
    .team-container .page-header h1,
    .reports-container .page-header h1 {
        font-size: 1.3rem;
    }

    .metric-value,
    .stat-value {
        font-size: 1.2rem;
    }

    .metric-label,
    .stat-label {
        font-size: 0.75rem;
    }

    th,
    td {
        padding: 0.5rem;
        font-size: 0.7rem;
    }

    .action-btn,
    .btn-primary,
    .btn-secondary {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }

    .chart-title {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1rem;
    }

    .info-label {
        font-size: 0.7rem;
    }

    .info-value {
        font-size: 0.85rem;
    }

    .rating-badge {
        font-size: 0.9rem;
    }
}

/* ============================================ */
/* TABLET BREAKPOINT - 1024px AND BELOW */
/* ============================================ */

@media (max-width: 1024px) {

    .stats-grid,
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================ */
/* UTILITY CLASSES */
/* ============================================ */

/* Hide scroll hint on desktop */
@media (min-width: 769px) {

    .applications-table::after,
    .risk-table::after,
    .loan-table::after,
    .kyc-table::after,
    .audit-table::after {
        display: none;
    }
}

/* Ensure footer stays at bottom */
footer {
    margin-top: auto;
    background: #0a2540;
    color: white;
    text-align: center;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Fix for header layout */
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Fix for mobile menu button */
.mobile-menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

/* Fix for slide-out menu */
.mobile-nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ===== SLIDESHOW STYLES ===== */

.slideshow-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.2);
    background: #f0f4f8;
}

.slides {
    position: relative;
    width: 100%;
    padding-top: 66.67%;
    /* 3:2 aspect ratio (800/1200 = 0.6667) */
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide.active {
    opacity: 1;
}

/* Dots/Indicators */
.slide-dots {
    text-align: center;
    padding: 1rem 0;
    margin: 0;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 6px;
    background-color: #cbd5e1;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: #439958;
}

.dot:hover {
    background-color: #2e7d32;
}

/* Touch/Click hint */
.slide-hint {
    text-align: center;
    font-size: 0.75rem;
    color: #8a9aaa;
    margin-top: 0.5rem;
}

/* Responsive Adjustments for different screens */
@media (max-width: 768px) {
    .slides {
        padding-top: 75%;
        /* 4:3 aspect ratio for tablets */
    }
}

@media (max-width: 480px) {
    .slides {
        padding-top: 100%;
        /* 1:1 square for mobile */
    }
}

/* ===== TEAM PHOTO STYLES (UNCHANGED) ===== */

.team-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem auto;
    display: block;
    border: 3px solid #eef2f6;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.team-photo:hover {
    transform: scale(1.05);
    border-color: #439958;
}

@media (max-width: 768px) {
    .team-photo {
        width: 100px;
        height: 100px;
    }
}

/* ===== REPAYMENT TABLE - HORIZONTAL SCROLL ===== */

/* Make the wrapper scrollable */
.repayment-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border-radius: 12px;
    width: 100%;
}

/* Ensure table has minimum width for scroll */
.repayment-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

/* Table cell styling */
.repayment-table th,
.repayment-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eef2f6;
    white-space: nowrap;
}

.repayment-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #4a5a6a;
    font-size: 0.85rem;
}

.repayment-table td {
    font-size: 0.85rem;
    color: #1e2b3a;
}

/* Scroll hint - only visible on mobile */
.repayment-table-wrapper::after {
    content: "← Scroll horizontally →";
    display: none;
    font-size: 0.7rem;
    color: #8a9aaa;
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.5rem;
}

/* Show scroll hint only on mobile */
@media (max-width: 768px) {
    .repayment-table-wrapper::after {
        display: block;
    }

    .repayment-table th,
    .repayment-table td {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}