#customerLedgerScreen{

    padding:15px;

    background:#f5f7fb;

}

.ledger-header{

    margin-bottom:14px;

    background:#fff;

    border-radius:14px;

    padding:12px;

    box-shadow:0 2px 10px rgba(0,0,0,.06);

}

.ledger-customer h2{

    margin:0;

    font-size:22px;

}

.ledger-customer small{

    color:#777;

}



.ledger-list{

    display:flex;

    flex-direction:column;

    gap:10px;

}

.ledger-bottom{

    margin-top:20px;

}




.ledger-card{

    background:#fff;

    border-radius:12px;

    padding:14px;

    box-shadow:0 2px 8px rgba(0,0,0,.08);

    cursor:pointer;

    transition:.2s;

}

.ledger-card:active{

    transform:scale(.98);

}

.ledger-row{

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:10px;

}

.ledger-row strong{

    display:inline-block;

    font-size:15px;

    margin-bottom:4px;

}

.ledger-row small{

    color:#777;

    font-size:12px;

}

.ledger-amount{

    font-size:17px;

    font-weight:700;

}

.ledger-sale{

    color:#16a34a;

    font-weight:700;

    font-size:9px;

}

.ledger-payment{

    color:#d32f2f;


    font-weight:700;

    font-size:9px;

}

.ledger-badge{

    display:inline-block;

    padding:3px 8px;

    border-radius:20px;

    font-size:11px;

    font-weight:600;

    margin-bottom:6px;

}

.badge-sale{

    background:#e3f2fd;

    color:#1565c0;

}

.badge-payment{

    background:#e8f5e9;

    color:#2e7d32;

}



/*=========================================
LEDGER TABLE UI
=========================================*/

.ledger-tabs{

    display:flex;

    gap:15px;

    margin:18px 0 12px;

    border-bottom:1px solid #e5e5e5;

}

.ledger-tab{

    background:none;

    border:none;

    padding:10px 0;

    font-size:15px;

    font-weight:600;

    color:#777;

    cursor:pointer;

}

.ledger-tab.active{

    color:#1565c0;

    border-bottom:3px solid #1565c0;

}

.ledger-table{

    width:100%;

    background:#fff;

    border-radius:14px;

    overflow:hidden;

    border:1px solid #e8e8e8;

    box-shadow:0 3px 14px rgba(0,0,0,.06);

}

.ledger-head{

    display:grid;

    grid-template-columns:
    46px
    50px
    42px
    54px
    54px
    56px;

    column-gap:1px;

    background:#f6f7f9;

    padding:6px 2px;

    border-bottom:1px solid #e5e7eb;

    font-size:9px;

    font-weight:700;

    text-align:center;

    position:sticky;

    top:0;

    z-index:5;

}

#customerLedgerList .ledger-row{

    display:grid;

    grid-template-columns:
    46px
    50px
    42px
    54px
    54px
    56px;

    column-gap:1px;

    align-items:center;

    padding:6px 2px;

    min-height:34px;

    font-size:9px;

    font-weight:500;

    line-height:1.1;

    border-bottom:1px solid #eee;

    background:#fff;

    cursor:pointer;

    transition:.2s;
    text-align:center;
}


#customerLedgerList .ledger-row:hover{

    background:#f7fbff;

}




.ledger-balance{

    font-size:9px;

    font-weight:700;

    color:#111827;

}


#customerLedgerList .ledger-row:nth-child(even){

    background:#fafafa;

}

#customerLedgerList .ledger-row:active{

    background:#eef6ff;

}

#customerLedgerList .ledger-row:hover{

    background:#eef6ff;

}


.ledger-head div,
#customerLedgerList .ledger-row div{

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;

    padding:0 1px;

}


#customerLedgerList{

    width:100%;

}

.ledger-total{

    background:#0d3f86;

    color:#fff;

    font-weight:700;

}

.ledger-total div{

    padding:10px 6px;

    font-size:12px;

}

@media(max-width:768px){
    
    
    .ledger-profile{

    gap:10px;

}

.ledger-avatar{

    width:46px;

    height:46px;

}

.ledger-avatar .material-icons{

    font-size:24px;

}

.ledger-profile-info h2{

    font-size:16px;

}

.ledger-summary{

    gap:6px;

}

.ledger-mini-card{

    padding:8px 4px;

}

.ledger-mini-card strong{

    font-size:13px;

}



    #customerLedgerScreen{

        padding:8px;

    }

    

    .ledger-customer h2{

        font-size:18px;

    }

    .ledger-customer small{

        font-size:12px;

    }

    
    .ledger-summary{

    margin-bottom:14px;

}

.ledger-summary-card{

    background:#fff;

    border-radius:14px;

    padding:14px;

    box-shadow:0 2px 10px rgba(0,0,0,.08);

    border:1px solid #ececec;

}

.ledger-summary-title{

    font-size:12px;

    color:#777;

    margin-bottom:6px;

}

.ledger-summary-value{

    font-size:24px;

    font-weight:700;

    color:#d32f2f;

}


    .ledger-tabs{

        gap:8px;

        margin:10px 0;

    }

    .ledger-tab{

        font-size:10px;

        padding:6px 0;

    }

    .ledger-table{

        width:100%;

        overflow:hidden;

        border-radius:10px;

    }

    

    #customerLedgerList .ledger-row{

        width:100%;

    }

}




/*==================================
LEDGER PROFILE
==================================*/

.ledger-profile{

    display:flex;

    align-items:center;

    gap:12px;

}

.ledger-avatar{

    width:54px;

    height:54px;

    border-radius:50%;

    background:#0d9488;

    display:flex;

    align-items:center;

    justify-content:center;

    color:#fff;

    flex-shrink:0;

}

.ledger-avatar .material-icons{

    font-size:30px;

}

.ledger-profile-info{

    flex:1;

}

.ledger-profile-info h2{

    margin:0;

    font-size:18px;

}

.ledger-phone{

    font-size:12px;

    color:#666;

    margin-top:2px;

}

/*==================================
SUMMARY
==================================*/

.ledger-summary{

    display:flex;

    gap:8px;

    margin-bottom:14px;

}

.ledger-mini-card{

    flex:1;

    background:#fff;

    border-radius:12px;

    padding:8px 4px;

    text-align:center;

    border:1px solid #ececec;

    box-shadow:0 2px 8px rgba(0,0,0,.05);

}

.ledger-mini-card span{

    display:block;

    font-size:9px;

    color:#777;

    margin-bottom:4px;

}

.ledger-mini-card strong{

    display:block;

    font-size:12px;

    color:#1565c0;

}

/* Payments Card */
#ledgerTotalPayments{

    color:#16a34a;

}

/* Receivable Card */
.ledger-mini-card.balance strong{

    color:#d32f2f;

}



.ledger-empty{

    padding:30px 10px;

    text-align:center;

    color:#888;

    font-size:13px;

    font-weight:600;

}


.ledger-opening-row{

    background:#e8f1ff !important;

    font-weight:700;

    border-bottom:2px solid #9ec5ff;

}

.ledger-opening-row div{

    color:#0d47a1;

}



/*==================================
LEDGER TOP BAR
==================================*/

.ledger-topbar{

    display:flex;

    align-items:center;

    gap:12px;

    margin-bottom:12px;

}

.ledger-back-btn{

    width:40px;

    height:40px;

    border:none;

    border-radius:10px;

    background:#ffffff;

    box-shadow:0 2px 8px rgba(0,0,0,.08);

    display:flex;

    align-items:center;

    justify-content:center;

    cursor:pointer;

}

.ledger-back-btn .material-icons{

    font-size:22px;

    color:#1565c0;

}

.ledger-top-title{

    flex:1;

    background:#fff;

    border-radius:10px;

    padding:10px 14px;

    font-size:16px;

    font-weight:700;

    box-shadow:0 2px 8px rgba(0,0,0,.08);

}