/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f7fb;
    color: #1a1a1a;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   NAVBAR — Responsive
   ============================================================ */
.navbar {
    background: linear-gradient(135deg, #0b3d91, #1e3a8a);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.navbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    position: relative;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

    .navbar-brand i {
        color: #ffcc00;
        font-size: 22px;
    }

/* Hamburger — hidden on desktop */
.navbar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    line-height: 1;
}

    .navbar-toggle:hover {
        background: rgba(255,255,255,0.1);
    }

/* Links — horizontal on desktop */
.navbar-links {
    display: flex;
    align-items: center;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

    .navbar-links li {
        list-style: none;
    }

    .navbar-links a {
        display: flex;
        align-items: center;
        gap: 7px;
        color: #e0e7ff;
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        transition: all 0.2s;
        white-space: nowrap;
    }

        .navbar-links a:hover {
            background: rgba(255, 255, 255, 0.12);
            color: #fff;
        }

        .navbar-links a.login-link {
            background: #ffcc00;
            color: #0b3d91;
            font-weight: 700;
        }

            .navbar-links a.login-link:hover {
                background: #ffdb4d;
            }

        .navbar-links a.logout-link {
            color: #fca5a5;
        }

            .navbar-links a.logout-link:hover {
                background: rgba(252, 165, 165, 0.15);
                color: #fecaca;
            }

/* ---------- MOBILE NAVBAR ---------- */
@media (max-width: 900px) {
    .navbar-toggle {
        display: block;
    }

    .navbar-inner {
        padding: 12px 15px;
    }

    .navbar-brand {
        font-size: 18px;
    }

        .navbar-brand i {
            font-size: 20px;
        }

    .navbar-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: #0b3d91;
        padding: 10px 15px 15px;
        gap: 2px;
        border-top: 1px solid rgba(255,255,255,0.15);
        box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    }

        .navbar-links.open {
            display: flex;
        }

        .navbar-links a {
            padding: 12px 14px;
            width: 100%;
            justify-content: flex-start;
            border-radius: 6px;
        }

            .navbar-links a.login-link {
                text-align: center;
                justify-content: center;
                margin-top: 6px;
            }
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.site-content {
    min-height: calc(100vh - 200px);
    width: 100%;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: #0b3d91;
    color: #e0e7ff;
    text-align: center;
    padding: 25px 20px;
    font-size: 14px;
    margin-top: 40px;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.footer p {
    margin: 0;
}

/* ============================================================
   HOME — HERO + FEATURES
   ============================================================ */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #0b3d91, #1e6bff);
    color: #fff;
}

    .hero h2 {
        font-size: clamp(26px, 5vw, 44px);
        margin: 0 0 15px;
    }

    .hero p {
        font-size: clamp(15px, 2.2vw, 18px);
        max-width: 620px;
        margin: 0 auto 25px;
        line-height: 1.6;
    }

    .hero .btn {
        display: inline-block;
        background: #ffcc00;
        color: #0b3d91;
        padding: 14px 30px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 700;
        transition: background 0.2s;
    }

        .hero .btn:hover {
            background: #ffdb4d;
        }

.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 40px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

@media (min-width: 700px) {
    .features {
        grid-template-columns: repeat(3, 1fr);
        padding: 60px 30px;
    }
}

.features .card {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    text-align: center;
}

    .features .card h3 {
        color: #0b3d91;
        margin: 0 0 10px;
        font-size: 18px;
    }

    .features .card p {
        color: #475569;
        margin: 0;
        font-size: 15px;
    }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrapper {
    max-width: 420px;
    margin: 40px auto;
    background: #fff;
    padding: 30px 24px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

@media (min-width: 600px) {
    .login-wrapper {
        padding: 40px;
        margin: 60px auto;
    }
}

.login-wrapper h2 {
    color: #0b3d91;
    margin: 0 0 10px;
    text-align: center;
    font-size: 24px;
}

.login-wrapper p.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 18px;
}

    .form-group label {
        display: block;
        margin-bottom: 6px;
        font-weight: 600;
        font-size: 14px;
        color: #333;
    }

    .form-group input {
        width: 100%;
        padding: 12px 14px;
        border: 1px solid #cfd8e3;
        border-radius: 8px;
        font-size: 15px;
        transition: border 0.2s;
    }

        .form-group input:focus {
            outline: none;
            border-color: #1e6bff;
            box-shadow: 0 0 0 3px rgba(30, 107, 255, 0.15);
        }

.btn-login {
    width: 100%;
    background: #ffcc00;
    color: #0b3d91;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

    .btn-login:hover {
        background: #ffdb4d;
    }

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 14px;
}

.alert-error {
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f5c6c2;
}

.alert-success {
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #c3e6cb;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

    .login-footer a {
        color: #1e6bff;
        font-weight: 600;
    }

        .login-footer a:hover {
            text-decoration: underline;
        }

/* ============================================================
   DASHBOARD (Admin / Staff / User)
   ============================================================ */
.jf-dashboard {
    max-width: 1280px;
    margin: 20px auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .jf-dashboard {
        margin: 30px auto;
        padding: 0 25px;
    }
}

.jf-dash-header {
    margin-bottom: 20px;
}

.jf-dash-title {
    color: #0b3d91;
    font-size: clamp(20px, 4vw, 28px);
    margin: 0 0 5px;
    line-height: 1.2;
    word-break: break-word;
}

.jf-dash-subtitle {
    color: #666;
    font-size: clamp(13px, 2vw, 15px);
    margin: 0;
    word-break: break-word;
}

.jf-card-panel {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.06);
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .jf-card-panel {
        padding: 25px;
        margin-bottom: 25px;
    }
}

.jf-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f4f9;
}

.jf-panel-title {
    color: #0b3d91;
    font-size: 17px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jf-panel-tag {
    background: #e6f4ea;
    color: #1e7e34;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Responsive grids */
.jf-info-grid,
.jf-stat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
}

@media (min-width: 480px) {
    .jf-info-grid,
    .jf-stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (min-width: 1024px) {
    .jf-info-grid,
    .jf-stat-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
}

.jf-info,
.jf-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
    background: #f8fafc;
    border-left: 4px solid #cbd5e1;
    transition: transform 0.2s;
    min-width: 0;
    overflow: hidden;
}

@media (hover: hover) {
    .jf-info:hover,
    .jf-stat:hover {
        transform: translateY(-3px);
    }
}

.jf-info-icon,
.jf-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.jf-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
}

.jf-info-body, .jf-stat-body {
    min-width: 0;
    flex: 1;
}

.jf-info-text {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jf-info-value, .jf-stat-value {
    font-size: clamp(15px, 2.2vw, 20px);
    font-weight: 700;
    color: #0f172a;
    margin-top: 4px;
    word-break: break-word;
    line-height: 1.2;
}

.jf-stat-value {
    font-size: clamp(16px, 2.4vw, 22px);
}

.jf-info-sep {
    color: #94a3b8;
    font-weight: 400;
}

.jf-stat-unit {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    margin-left: 4px;
}

.jf-stat-label {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Color variants */
.jf-info-maroon {
    border-left-color: #9f1239;
}

    .jf-info-maroon .jf-info-icon {
        background: linear-gradient(135deg, #9f1239, #881337);
    }

.jf-info-success {
    border-left-color: #15803d;
}

    .jf-info-success .jf-info-icon {
        background: linear-gradient(135deg, #15803d, #166534);
    }

.jf-info-teal {
    border-left-color: #0d9488;
}

    .jf-info-teal .jf-info-icon {
        background: linear-gradient(135deg, #0d9488, #0f766e);
    }

.jf-info-purple {
    border-left-color: #7c3aed;
}

    .jf-info-purple .jf-info-icon {
        background: linear-gradient(135deg, #7c3aed, #6d28d9);
    }

.jf-stat-warning .jf-stat-icon {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.jf-stat-danger .jf-stat-icon {
    background: linear-gradient(135deg, #9f1239, #881337);
}

.jf-stat-indigo .jf-stat-icon {
    background: linear-gradient(135deg, #4338ca, #3730a3);
}

.jf-stat-lime .jf-stat-icon {
    background: linear-gradient(135deg, #65a30d, #4d7c0f);
}

.jf-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.jf-alert-error {
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f5c6c2;
}


/* ============================================================
   TABLES (Collection, Users, Loans, etc.)
   ============================================================ */
.jf-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.jf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 800px;
}

    .jf-table thead {
        background: linear-gradient(135deg, #0b3d91, #1e3a8a);
        color: #fff;
    }

        .jf-table thead th {
            padding: 12px 10px;
            text-align: left;
            font-weight: 600;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            white-space: nowrap;
        }

    .jf-table tbody tr {
        border-bottom: 1px solid #f0f4f9;
        transition: background 0.15s;
    }

        .jf-table tbody tr:hover {
            background: #f8fafc;
        }

    .jf-table tbody td {
        padding: 12px 10px;
        color: #334155;
        white-space: nowrap;
    }

    .jf-table tfoot {
        background: #f1f5f9;
        border-top: 2px solid #cbd5e1;
    }

        .jf-table tfoot td {
            padding: 12px 10px;
            color: #0f172a;
        }

/* Mobile tweaks */
@media (max-width: 600px) {
    .jf-table {
        font-size: 13px;
        min-width: 700px;
    }

        .jf-table thead th,
        .jf-table tbody td,
        .jf-table tfoot td {
            padding: 10px 8px;
        }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

/* Print-only / no-print helpers (used only in @media print) */
.print-only {
    display: none;
}

/* Button styles */
.jf-dash-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    flex-wrap: wrap;
}

.jf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.jf-btn-print {
    background: #0b3d91;
    color: #fff;
}

    .jf-btn-print:hover {
        background: #1e3a8a;
    }

/* ---------- When actually printing ---------- */
@media print {

    /* Hide everything that isn't the report */
    .no-print,
    .navbar,
    .footer,
    .navbar-toggle,
    .navbar-links {
        display: none !important;
    }

    /* Show print-only blocks */
    .print-only {
        display: block !important;
    }

    /* Page setup */
    @page {
        size: A4 landscape;
        margin: 12mm;
    }

    html, body {
        background: #fff !important;
        font-size: 11pt;
        color: #000;
    }

    /* Remove shadows/rounded corners that look weird on paper */
    .jf-card-panel {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .jf-dashboard {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Print header */
    .print-header {
        text-align: center;
        margin-bottom: 15px;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }

        .print-header h1 {
            margin: 0;
            font-size: 20pt;
            color: #0b3d91;
            letter-spacing: 1px;
        }

        .print-header h2 {
            margin: 5px 0;
            font-size: 14pt;
            color: #000;
        }

        .print-header p {
            margin: 5px 0;
            font-size: 10pt;
            color: #333;
        }

    /* Print footer */
    .print-footer {
        margin-top: 15px;
        padding-top: 8px;
        border-top: 1px solid #999;
        font-size: 9pt;
        text-align: center;
        color: #444;
    }

        .print-footer p {
            margin: 2px 0;
        }

    /* Table styles for print */
    .jf-table-wrap {
        overflow: visible !important;
        border: 1px solid #000 !important;
        border-radius: 0 !important;
    }

    .jf-table {
        min-width: 0 !important;
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9pt;
    }

        .jf-table thead {
            background: #0b3d91 !important;
            color: #fff !important;
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }

            .jf-table thead th {
                padding: 6px 6px !important;
                border: 1px solid #000 !important;
                font-size: 9pt !important;
                color: #fff !important;
            }

        .jf-table tbody td,
        .jf-table tfoot td {
            padding: 5px 6px !important;
            border: 1px solid #666 !important;
            font-size: 9pt !important;
            white-space: normal !important;
        }

        .jf-table tbody tr:nth-child(even) {
            background: #f5f5f5 !important;
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }

        .jf-table tfoot {
            background: #e2e8f0 !important;
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }

        /* Avoid page-break inside rows */
        .jf-table tr {
            page-break-inside: avoid;
        }
}