/* ===============================
   Church Capital Broker Dashboard
=============================== */
.ccbp-dashboard-page{
    background:#f4f6f9;
    min-height:100vh;
    font-size:14px;
    color:#0f172a;
}

/* HEADER */
.ccbp-dash-header{
    background:#fff;
    border-top:3px solid #0284c7;
    border-bottom:1px solid #e5e9ef;
}
.ccbp-dash-header-inner{
    max-width:1280px;
    margin:0 auto;
    padding:16px 30px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    flex-wrap:wrap;
}
.ccbp-dash-logo{
    height:22px;
    width:auto;
}
.ccbp-dash-broker{
    display:flex;
    align-items:center;
    gap:12px;
    margin-right:auto;
}
.ccbp-dash-avatar{
    width:38px;
    height:38px;
    border-radius:50%;
    background:#0284c7 !important;
    color:#fff !important;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:700;
    font-size:15px;
}
.ccbp-dash-broker-name{
    margin:0;
    font-weight:700;
    font-size:14.5px;
    color:#0f172a;
}
.ccbp-dash-broker-role{
    font-size:12.5px;
    color:#64748b;
}
.ccbp-dash-nav{
    display:flex;
    align-items:center;
    gap:22px;
}
.ccbp-dash-nav-link{
    display:inline-flex;
    align-items:center;
    gap:7px;
    color:#475569 !important;
    text-decoration:none;
    font-size:14px;
    font-weight:500;
    transition:color .15s ease;
}
.ccbp-dash-nav-link i{
    font-size:13px;
    color:#94a3b8;
    transition:color .15s ease;
}
.ccbp-dash-nav-link.is-active{
    color:#0284c7 !important;
    font-weight:700;
}
.ccbp-dash-nav-link.is-active i{
    color:#0284c7;
}
.ccbp-dash-nav-link:hover{
    color:#0284c7 !important;
}
.ccbp-dash-nav-link:hover i{
    color:#0284c7;
}
.ccbp-dash-logout{
    color:#dc2626 !important;
}
.ccbp-dash-logout i{
    color:#dc2626;
}
.ccbp-dash-logout:hover{
    color:#b91c1c !important;
}
.ccbp-dash-logout:hover i{
    color:#b91c1c;
}

/* MAIN */
.ccbp-dash-main{
    max-width:1280px;
    margin:0 auto;
    padding:12px 20px 40px;
}

/* ACTION BAR */
.ccbp-dash-actionbar{
    display:flex !important;
    align-items:center;
    justify-content:space-between !important;
    gap:16px;
    flex-wrap:wrap;
    margin-top:20px;
    margin-bottom:24px;
}
.ccbp-dash-new-btn{
    display:inline-flex !important;
    align-items:center;
    align-self:flex-start;
    gap:8px;
    width:fit-content !important;
    margin:0 !important;
    background:#0284c7 !important;
    color:#fff !important;
    border:none !important;
    padding:12px 24px !important;
    border-radius:8px !important;
    font-size:14px !important;
    font-weight:600 !important;
    text-decoration:none;
    cursor:pointer;
    transition:background .15s ease;
}
.ccbp-dash-new-btn:hover{
    background:#0369a1 !important;
}
.ccbp-dash-search{
    display:flex;
    align-items:center;
    gap:8px;
    background:#fff;
    border:1px solid #d9dee5;
    border-radius:7px;
    padding:7px 12px;
    min-width:180px;
    flex:1;
    max-width:230px;
}
.ccbp-dash-search i{
    color:#94a3b8;
    font-size:11.5px;
}
.ccbp-dash-search input{
    border:none;
    outline:none;
    font-size:12.5px;
    width:100%;
    background:transparent;
}

/* SUMMARY CARDS */
.ccbp-dash-summary{
    display:grid !important;
    grid-template-columns:repeat(5,minmax(0,1fr)) !important;
    gap:18px !important;
    margin-bottom:24px !important;
}

.ccbp-summary-card{
    display:block;
    background:#fff;
    border:1px solid #e5e9ef;
    border-left:4px solid #cbd5e1;
    border-radius:10px;
    padding:18px 20px;
    text-decoration:none;
    transition:.2s;
    min-width:0;
}

.ccbp-summary-card:hover{
    box-shadow:0 6px 16px rgba(15,23,42,.06);
}

.ccbp-summary-card.is-active{
    border-left-color:#0284c7;
    box-shadow:0 6px 16px rgba(2,132,199,.12);
}

.ccbp-summary-count{
    display:block;
    font-size:26px;
    font-weight:700;
    color:#0f172a;
    line-height:1;
}

.ccbp-summary-label{
    display:block;
    margin-top:10px;
    font-size:13px;
    color:#64748b;
    font-weight:600;
}
.ccbp-summary-card{
    display:block;
    background:#fff;
    border:1px solid #e5e9ef;
    border-left:4px solid #cbd5e1;
    border-radius:10px;
    padding:18px 20px;
    text-decoration:none;
    transition:border-color .15s ease, box-shadow .15s ease;
}
.ccbp-summary-card:hover{
    box-shadow:0 6px 16px rgba(15,23,42,.06);
}
.ccbp-summary-card.is-active{
    border-left-color:#0284c7;
    box-shadow:0 6px 16px rgba(2,132,199,.12);
}
.ccbp-summary-count{
    display:block;
    font-size:26px;
    font-weight:700;
    color:#0f172a;
}
.ccbp-summary-label{
    display:block;
    margin-top:4px;
    font-size:13px;
    color:#64748b;
    font-weight:600;
}

/* TABLE CARD */
.ccbp-dash-table-card{
    background:#fff;
    border:1px solid #e5e9ef;
    border-radius:14px;
    padding:16px;
    margin-top:4px;
}
.ccbp-dash-search-note{
    padding:14px 16px 0;
    margin:0;
    font-size:13.5px;
    color:#64748b;
}
.ccbp-dash-search-note a{
    color:#0284c7;
    font-weight:600;
    text-decoration:none;
    margin-left:6px;
}
.ccbp-table-responsive{
    overflow-x:auto;
}
.ccbp-loan-table{
    width:100%;
    border-collapse:collapse;
    min-width:760px;
}
.ccbp-loan-table thead th{
    text-align:left;
    font-size:12.5px;
    text-transform:uppercase;
    letter-spacing:.04em;
    color:#64748b;
    font-weight:700;
    padding:18px 20px;
    border-bottom:1px solid #e5e9ef;
    white-space:nowrap;
}
.ccbp-loan-table tbody td{
    padding:20px;
    border-bottom:1px solid #f1f4f8;
    font-size:14px;
    color:#334155;
    vertical-align:middle;
}
.ccbp-loan-table tbody tr:last-child td{
    border-bottom:none;
}
.ccbp-loan-table tbody tr:hover{
    background:#f8fafc;
}
.ccbp-cell-strong{
    font-weight:700;
    color:#0f172a;
}
.ccbp-table-empty{
    text-align:center;
    padding:40px 16px !important;
    color:#94a3b8;
}

/* STAGE PILLS */
.ccbp-stage-pill{
    display:inline-block;
    padding:5px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
    background:#eef2f7;
    color:#475569;
}
.ccbp-stage-pill.ccbp-status-current{
    background:#e0f2fe;
    color:#0369a1;
}
.ccbp-stage-pill.ccbp-status-active{
    background:#fef3c7;
    color:#b45309;
}
.ccbp-stage-pill.ccbp-status-funded{
    background:#dcfce7;
    color:#15803d;
}
.ccbp-stage-pill.ccbp-status-closed{
    background:#fee2e2;
    color:#b91c1c;
}

/* Summary card left-border colors, matched to stage pills */
.ccbp-summary-card.ccbp-status-current{ border-left-color:#38bdf8; }
.ccbp-summary-card.ccbp-status-active{ border-left-color:#f59e0b; }
.ccbp-summary-card.ccbp-status-funded{ border-left-color:#22c55e; }
.ccbp-summary-card.ccbp-status-closed{ border-left-color:#ef4444; }
.ccbp-summary-card.is-active.ccbp-status-current{ border-left-color:#0369a1; }
.ccbp-summary-card.is-active.ccbp-status-active{ border-left-color:#b45309; }
.ccbp-summary-card.is-active.ccbp-status-funded{ border-left-color:#15803d; }
.ccbp-summary-card.is-active.ccbp-status-closed{ border-left-color:#b91c1c; }


/* ===============================
   RESPONSIVE
=============================== */

@media (max-width: 991px){
    .ccbp-dash-summary{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

.ccbp-mobile-toggle{
    display:flex !important;
    background:#0284c7 !important;
}

@media (max-width:768px){

    .ccbp-mobile-toggle{
    width:48px;
    height:48px;
    border:none;
    border-radius:10px;
    background:#0284c7 !important;
    color:#fff !important;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
}

    .ccbp-dash-header-inner{
        padding:14px 16px;
        position:relative;
        flex-wrap:nowrap;
    }

    .ccbp-dash-broker{
        flex:1;
        margin-right:0;
    }

    .ccbp-dash-broker-role{
        display:none;
    }

    .ccbp-dash-nav{
        display:none;
        position:absolute;
        top:100%;
        left:0;
        right:0;
        background:#fff;
        flex-direction:column;
        gap:0;
        border-top:1px solid #e5e9ef;
        box-shadow:0 12px 24px rgba(0,0,0,.08);
        z-index:999;
    }

    .ccbp-dash-nav.open{
        display:flex;
    }

    .ccbp-dash-nav-link{
        width:100%;
        padding:14px 18px;
        border-bottom:1px solid #eef2f7;
    }

    .ccbp-dash-main{
    padding:35px 16px 40px;
}

    .ccbp-dash-actionbar{
        flex-direction:column;
        align-items:stretch;
    }

    .ccbp-dash-new-btn{
        width:100% !important;
        justify-content:center;
    }

    .ccbp-dash-search{
        width:100%;
        max-width:none;
    }
}

@media (max-width:640px){

    .ccbp-dash-summary{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:12px !important;
}

.ccbp-summary-card{
    padding:14px;
}

.ccbp-summary-count{
    font-size:22px;
}

.ccbp-summary-label{
    font-size:12px;
    margin-top:6px;
}

    .ccbp-table-responsive{
        overflow-x:visible;
    }

    .ccbp-loan-table{
        min-width:0;
    }

    .ccbp-loan-table thead{
        display:none;
    }

    .ccbp-loan-table tbody tr{
        display:block;
        border:1px solid #e5e9ef;
        border-radius:10px;
        margin-bottom:14px;
        padding:6px 4px;
        background:#fff;
    }

    .ccbp-loan-table tbody td{
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:12px;
        padding:10px 12px;
        border-bottom:1px solid #f1f4f8;
        text-align:right;
    }

    .ccbp-loan-table tbody tr td:last-child{
        border-bottom:none;
    }

    .ccbp-loan-table tbody td::before{
        content:attr(data-label);
        font-size:11.5px;
        font-weight:700;
        text-transform:uppercase;
        letter-spacing:.03em;
        color:#94a3b8;
        text-align:left;
    }
}

@media (max-width:480px){

    .ccbp-summary-card{
        padding:14px 16px;
    }

    .ccbp-summary-count{
        font-size:22px;
    }
}


/* ===== FINAL MOBILE OVERRIDE ===== */

@media screen and (max-width:768px){

    .ccbp-dash-summary{
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:12px !important;
    }

    .ccbp-summary-card{
        display:block !important;
        width:100% !important;
        margin:0 !important;
        padding:14px !important;
    }

    .ccbp-summary-count{
        font-size:22px !important;
    }

    .ccbp-summary-label{
        font-size:12px !important;
        line-height:1.3;
    }

}
