    /* ================================================================
       cafesettlement.css
       Cafe Settlement Module — XSHL
       Uses existing CSS variables from the project's base stylesheet
       ================================================================ */

    /* ── Cafe button in settlement header ─────────────────────────── */
    .cs-btn-cafe {
        white-space: nowrap;
        font-size: .78rem;
        padding: .42rem .9rem;
        border-radius: 7px;
        display: inline-flex;
        align-items: center;
        gap: .4rem;
    }

    /* ── Modal header ─────────────────────────────────────────────── */
    .cs-modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem .75rem;
        border-bottom: 1px solid var(--border);
    }

    .cs-modal-title {
        font-size: .92rem;
        font-weight: 700;
        color: var(--text);
        display: flex;
        align-items: center;
        gap: .5rem;
    }

        .cs-modal-title i {
            color: var(--brand);
            font-size: .85rem;
        }

    /* ── Upload form ──────────────────────────────────────────────── */
    .cs-form-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: .75rem;
        padding: 1rem 1.25rem;
        background: var(--surface, #f9fafb);
        border-bottom: 1px solid var(--border);
    }

    .cs-field label {
        display: block;
        font-size: .7rem;
        font-weight: 600;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: .06em;
        margin-bottom: .3rem;
    }

    .cs-field input,
    .cs-field select {
        width: 100%;
        font-size: .8rem;
        padding: .38rem .6rem;
        border: 1px solid var(--border);
        border-radius: 6px;
        background: #fff;
        color: var(--text);
        transition: border-color .15s;
    }

        .cs-field input:focus,
        .cs-field select:focus {
            outline: none;
            border-color: var(--brand);
            box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 79,70,229), .08);
        }

        .cs-field input[type="file"] {
            padding: .28rem .6rem;
            cursor: pointer;
        }

    /* ── Upload action bar ────────────────────────────────────────── */
    .cs-upload-bar {
        display: flex;
        align-items: center;
        gap: .6rem;
        padding: .65rem 1.25rem;
        border-bottom: 1px solid var(--border);
        flex-wrap: wrap;
    }

    .cs-file-info {
        font-size: .72rem;
        color: var(--muted);
        flex: 1;
    }

    /* ── Preview section ──────────────────────────────────────────── */
.cs-preview-wrap {
    max-height: 420px;
    overflow-y: auto;
    padding: .75rem 1.25rem 1rem;
}

    .cs-preview-title {
        font-size: .72rem;
        font-weight: 700;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--muted);
        margin-bottom: .6rem;
        display: flex;
        align-items: center;
        gap: .4rem;
    }

    .cs-batch-info {
        font-size: .72rem;
        color: var(--muted);
        background: var(--surface, #f9fafb);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: .35rem .7rem;
        margin-bottom: .6rem;
        display: flex;
        gap: 1.5rem;
        flex-wrap: wrap;
    }

        .cs-batch-info span strong {
            color: var(--text);
        }

    /* ── Preview table ────────────────────────────────────────────── */
    .cs-tbl-scroll {
        overflow-x: auto;
        border: 1px solid var(--border);
        border-radius: 8px;
    }

    .cs-table {
        width: 100%;
        font-size: .76rem;
        border-collapse: collapse;
    }

        .cs-table thead th {
            background: var(--surface, #f4f5f7);
            color: var(--muted);
            font-weight: 700;
            font-size: .67rem;
            text-transform: uppercase;
            letter-spacing: .07em;
            padding: .55rem .7rem;
            border-bottom: 1px solid var(--border);
            white-space: nowrap;
        }

        .cs-table tbody td {
            padding: .5rem .7rem;
            border-bottom: 1px solid var(--border);
            color: var(--text);
            vertical-align: middle;
        }

        .cs-table tbody tr:last-child td {
            border-bottom: none;
        }

        .cs-table tbody tr:hover {
            background: rgba(0,0,0,.018);
        }

    /* ── Row states ───────────────────────────────────────────────── */
    .cs-row-warning {
        background: #fffbeb !important;
    }
    /* Invoice not found */
    .cs-row-surplus {
        background: #f0fdf4 !important;
    }
    /* Surplus - green tint */
    .cs-row-shortage {
        background: #fff7f7 !important;
    }
    /* Shortage - red tint */

    /* ── Adjustment badges ────────────────────────────────────────── */
    .cs-badge {
        display: inline-flex;
        align-items: center;
        gap: .25rem;
        padding: .18rem .5rem;
        border-radius: 20px;
        font-size: .66rem;
        font-weight: 700;
        letter-spacing: .04em;
        white-space: nowrap;
    }

    .cs-badge-surplus {
        background: #dcfce7;
        color: #16a34a;
    }

    .cs-badge-shortage {
        background: #fee2e2;
        color: #dc2626;
    }

    .cs-badge-exact {
        background: #e0e7ff;
        color: #4338ca;
    }

    .cs-badge-notfound {
        background: #fef9c3;
        color: #854d0e;
    }

    /* ── Status badges ────────────────────────────────────────────── */
    .cs-status {
        display: inline-flex;
        align-items: center;
        gap: .25rem;
        padding: .18rem .5rem;
        border-radius: 20px;
        font-size: .66rem;
        font-weight: 700;
    }

    .cs-status-pending {
        background: #fef3c7;
        color: #92400e;
    }

    .cs-status-approved {
        background: #dcfce7;
        color: #15803d;
    }

    .cs-status-rejected {
        background: #fee2e2;
        color: #b91c1c;
    }

    /* ── Approve footer ───────────────────────────────────────────── */
    .cs-approve-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: .75rem 1.25rem;
        border-top: 1px solid var(--border);
        flex-wrap: wrap;
        gap: .5rem;
        background: var(--surface, #f9fafb);
    }

    .cs-approve-summary {
        font-size: .75rem;
        color: var(--muted);
    }

        .cs-approve-summary strong {
            color: var(--text);
        }

    .cs-approve-actions {
        display: flex;
        gap: .5rem;
    }

    /* ── Records page ─────────────────────────────────────────────── */
    .cs-records-shell {
        padding: 1.25rem;
    }

    .cs-stat-strip {
        display: flex;
        gap: .75rem;
        flex-wrap: wrap;
        margin-bottom: 1rem;
    }

    .cs-stat {
        flex: 1;
        min-width: 130px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: .75rem 1rem;
        display: flex;
        align-items: center;
        gap: .65rem;
    }

    .cs-stat-icon {
        width: 34px;
        height: 34px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: .85rem;
        flex-shrink: 0;
    }

        .cs-stat-icon.total {
            background: #e8eafd;
            color: var(--brand);
        }

        .cs-stat-icon.pending {
            background: #fef9c3;
            color: #92400e;
        }

        .cs-stat-icon.approved {
            background: #dcfce7;
            color: #15803d;
        }

        .cs-stat-icon.surplus {
            background: #dcfce7;
            color: #16a34a;
        }

        .cs-stat-icon.shortage {
            background: #fee2e2;
            color: #dc2626;
        }

    .cs-stat-lbl {
        font-size: .67rem;
        color: var(--muted);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .06em;
    }

    .cs-stat-num {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text);
        line-height: 1.2;
    }

    .cs-stat-sub {
        font-size: .68rem;
        color: var(--muted);
    }

    /* ── Not found warning row ────────────────────────────────────── */
    .cs-notfound-row td {
        opacity: .65;
        font-style: italic;
    }

    /* ── Net diff display ─────────────────────────────────────────── */
    .cs-diff-pos {
        color: #16a34a;
        font-weight: 700;
    }

    .cs-diff-neg {
        color: #dc2626;
        font-weight: 700;
    }

    .cs-diff-zero {
        color: var(--muted);
    }


    /* ================================================================
       Layout helpers (in case smt-body flex is not in global CSS)
       ================================================================ */
    .smt-body {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
    }

    .smt-left-col {
        flex: 1;
        min-width: 0;
    }

    .smt-right-col {
        width: 220px;
        flex-shrink: 0;
    }

    /* ── Empty table state ────────────────────────────────────────── */
    .tbl-empty {
        text-align: center;
        padding: 3rem 1rem;
        color: var(--muted);
        font-size: .8rem;
    }

        .tbl-empty i {
            font-size: 2rem;
            display: block;
            margin-bottom: .5rem;
            opacity: .3;
        }

    /* ── Pagination dots ──────────────────────────────────────────── */
    .pg-dots {
        padding: 0 .3rem;
        color: var(--muted);
        font-size: .8rem;
        line-height: 1;
    }

    /* ── How to list ──────────────────────────────────────────────── */
    .howto-list {
        padding-left: 1.15rem;
        margin: 0;
    }

        .howto-list li {
            font-size: .72rem;
            color: var(--muted);
            margin-bottom: .28rem;
            line-height: 1.4;
        }


    /* ================================================================
       Records page — Table card, toolbar, footer, pagination
       (Added because invoicesettlement.css classes are not available
        on the cafe settlement records page)
       ================================================================ */

    /* ── Table card wrapper ───────────────────────────────────────── */
    .cs-tbl-card {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 10px;
        overflow: hidden;
    }

    /* ── Table toolbar ────────────────────────────────────────────── */
    .cs-tbl-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: .65rem 1rem;
        border-bottom: 1px solid var(--border);
        flex-wrap: wrap;
        gap: .5rem;
    }

    .cs-tbl-title {
        font-size: .8rem;
        font-weight: 700;
        color: var(--text);
    }

    /* ── Table scroll wrapper ─────────────────────────────────────── */
    .cs-tbl-body {
        overflow-x: auto;
        overflow-y: auto;
        max-height: calc(100vh - 320px);
    }

    /* ── Table footer ─────────────────────────────────────────────── */
    .cs-tbl-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: .55rem 1rem;
        border-top: 1px solid var(--border);
        flex-wrap: wrap;
        gap: .5rem;
        font-size: .72rem;
        color: var(--muted);
    }

    /* ── Pagination ───────────────────────────────────────────────── */
    .cs-pg {
        display: flex;
        align-items: center;
        gap: .25rem;
        flex-wrap: wrap;
    }

    .cs-pbn {
        padding: .22rem .55rem;
        border: 1px solid var(--border);
        border-radius: 5px;
        background: #fff;
        color: var(--text);
        font-size: .72rem;
        cursor: pointer;
        transition: background .12s, color .12s;
    }

        .cs-pbn:hover:not(:disabled) {
            background: var(--brand);
            color: #fff;
            border-color: var(--brand);
        }

        .cs-pbn.act {
            background: var(--brand);
            color: #fff;
            border-color: var(--brand);
        }

        .cs-pbn:disabled {
            opacity: .4;
            cursor: not-allowed;
        }

    .cs-pg-dots {
        padding: 0 .25rem;
        color: var(--muted);
        font-size: .8rem;
    }
/* Fix page header — title + breadcrumb same row */
.smt-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

    .smt-page-header h4 {
        margin: 0;
    }

/* ── Skip/Include toggle button ──────────────────────────────── */
.btn-outline-warn {
    padding: .22rem .55rem;
    border: 1px solid #f59e0b;
    border-radius: 5px;
    background: #fffbeb;
    color: #92400e;
    font-size: .68rem;
    cursor: pointer;
    transition: background .12s, color .12s;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

    .btn-outline-warn:hover {
        background: #f59e0b;
        color: #fff;
    }