/* ============================================================
   Canvass Details — Mobile-Optimized Styles
   Breakpoint: max-width 768px
   These styles are loaded globally via index.html.
   Desktop styles are unaffected (hidden via display:none).
   ============================================================ */

/* ---- Clickable item list (replaces wide desktop table on mobile) ---- */
.cs-mobile-list {
    display: none;
    width: 100%;
    border: 1px solid #D1D9E4;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.cs-mobile-list .cs-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #EFEFEF;
}

.cs-mobile-list .cs-item:last-child {
    border-bottom: none;
}

.cs-mobile-list .cs-item i {
    color: #98A2B3;
    flex-shrink: 0;
}

/* ---- Angular-driven bottom sheet panel ---- */
.cs-sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.cs-sheet-backdrop.show {
    display: block;
}

.cs-item-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85vh;
    background: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cs-item-sheet.show {
    transform: translateY(0);
}

.cs-item-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #EFEFEF;
    flex-shrink: 0;
}

.cs-item-sheet-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1F2937;
}

.cs-item-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.cs-item-sheet-body > .label-grp {
    margin-bottom: 16px;
}

/* ---- Supplier card used inside the bottom sheet and mobile totals ---- */
.cs-supplier-card {
    border: 1px solid #EFEFEF;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.cs-supplier-card .cs-supplier-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.cs-supplier-card .cs-supplier-head span:first-child {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

/* Solid badge colors inside supplier heads — override the app-wide faded style */
.cs-supplier-head .badge-success   { background: #09C10F; color: #fff; }
.cs-supplier-head .badge-secondary { background: #6c757d; color: #fff; }
.cs-supplier-head .badge-warning   { background: #FF8800; color: #fff; }
.cs-supplier-head .badge-danger    { background: #F90929; color: #fff; }
.cs-supplier-head .badge-info      { background: #3E7FC9; color: #fff; }
.cs-supplier-head .badge-primary   { background: #CC1717; color: #fff; }

/* ---- Per-supplier totals block (mobile equivalent of tfoot) ---- */
.cs-mobile-totals {
    display: none;
}

.cs-totals {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cs-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 14px;
}

.cs-total-row .cs-total-label {
    color: #aaa;
}

.cs-total-row .cs-total-label.strong {
    color: #333;
    font-weight: 700;
}

.cs-total-row .cs-total-value {
    color: #333;
    font-weight: 600;
}

.cs-total-subhead {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-top: 4px;
}

.cs-amount-payable {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(204, 23, 23, 0.08);
    color: #CC1717;
    font-weight: 700;
    font-size: 14px;
}

/* ============================================================
   Media query: activate mobile layout at ≤ 768px
   ============================================================ */
@media screen and (max-width: 768px) {

    /* Hide the horizontal scrolling table; show the card list instead */
    .list-grp .table-fixed-2 {
        display: none;
    }

    .cs-mobile-list {
        display: block;
    }

    .cs-mobile-totals {
        display: block;
        margin-top: 16px;
    }
}
