/* ===================================================== */
/* GLOBAL                                                */
/* ===================================================== */

body {
    overflow-x: hidden;
    background-color: #f4f6f9;
    font-size: 0.95rem;
}

h1, h2, h3, h4, h5 {
    font-weight: 600;
    color: #1f2937;
}

/* Remove readonly number spinners */
input[type=number][readonly]::-webkit-inner-spin-button,
input[type=number][readonly]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* ===================================================== */
/* SIDEBAR                                               */
/* ===================================================== */

.sidebar {
    width: 250px;
    min-height: 100vh;
    background: #1f2937;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 1050;
}

    .sidebar a {
        color: #cbd5e1;
        text-decoration: none;
        padding: 12px 20px;
        display: block;
        transition: 0.2s;
        font-size: 0.9rem;
    }

        .sidebar a:hover {
            background: #374151;
            color: #fff;
        }

.sidebar-footer {
    padding: 15px;
}

.logout-btn {
    width: 100%;
}

.content-wrapper {
    margin-left: 250px;
    padding: 25px;
}

/* ===================================================== */
/* COLLAPSIBLE SIDEBAR (DESKTOP)                         */
/* ===================================================== */

.sidebar {
    transition: width 0.25s ease, transform 0.3s ease;
}

    .sidebar.collapsed {
        width: 70px;
    }

        /* Hide text when collapsed */

        .sidebar.collapsed a span {
            display: none;
        }

        /* Center icons */

        .sidebar.collapsed a {
            text-align: center;
            padding: 12px 0;
        }

        /* Hide title */

        .sidebar.collapsed h5 {
            display: none;
        }

        /* Content shift */

        .sidebar.collapsed ~ .content-wrapper {
            margin-left: 70px;
        }

/* Collapse button */

.sidebar-toggle {
    cursor: pointer;
}

/* ===================================================== */
/* MOBILE TOPBAR + SIDEBAR                               */
/* ===================================================== */

.mobile-topbar {
    height: 56px;
    background: #ffffff;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1040;
}

.mobile-title {
    font-weight: 600;
    margin-left: 10px;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 1045;
}

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

@media (max-width: 768px) {

    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.mobile-open {
            transform: translateX(0);
        }

    .content-wrapper {
        margin-left: 0;
        padding: 15px;
    }
}
/* Mobile must always show full sidebar */

@media (max-width: 768px) {

    .sidebar.collapsed {
        width: 250px;
    }

        .sidebar.collapsed a span,
        .sidebar.collapsed h5,
        .sidebar.collapsed .logout-btn span {
            display: inline;
        }
    .content-wrapper {
        margin-left: 0 !important;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 250px;
    }

        .sidebar.mobile-open {
            transform: translateX(0);
        }
}

/* ===================================================== */
/* GLOBAL TABLE STYLING (Bootstrap-based)               */
/* ===================================================== */

.table {
    border-color: #e5e7eb;
}

    .table thead {
        background: #f9fafb;
        font-weight: 600;
        color: #374151;
    }

    .table tbody tr:hover {
        background-color: #f3f4f6;
    }

    .table td,
    .table th {
        padding: 0.75rem 1rem;
        vertical-align: middle;
    }



/* ===================================================== */
/* DATATABLE GLOBAL REFINEMENT                          */
/* ===================================================== */

table.dataTable tbody tr.table-success {
    transition: background-color 0.4s ease;
}

/* Clean DataTables spacing */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

/* Cleaner pagination */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
}

/* Responsive expand control */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before {
    background-color: #2563eb;
    border-radius: 50%;
}

table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before {
    background-color: #16a34a;
}


/* ===================================================== */
/* PAYMENT MODAL (GENERIC)                              */
/* ===================================================== */

.payment-modal {
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
}

.payment-modal-header {
    background: #f9fafb;
    border-bottom: 1px solid #eef2f6;
    padding: 1.25rem 1.5rem;
}

.payment-modal-body {
    padding: 1.5rem;
    max-height: 75vh;
    overflow-y: auto;
}

.payment-modal-footer {
    border-top: 1px solid #eef2f6;
    padding: 1rem 1.5rem;
}

.modal-summary {
    display: flex;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #eef2f6;
    border-bottom: 1px solid #eef2f6;
}

.summary-label {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #111827;
}

    .summary-value.highlight {
        color: #16a34a;
    }


/* ===================================================== */
/* MOBILE MODAL IMPROVEMENTS                            */
/* ===================================================== */

@media (max-width: 768px) {

    .modal-dialog {
        margin: 0;
    }

    .payment-modal-body {
        max-height: 70vh;
    }

    .modal-summary {
        flex-direction: column;
        gap: 12px;
        text-align: left;
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: 10px;
    }

        .modal-footer .btn {
            width: 100%;
            padding: 12px;
            border-radius: 12px;
        }
}


/* ===================================================== */
/* BUTTON SYSTEM                                         */
/* ===================================================== */

.btn-primary {
    background-color: #2563eb;
    border-color: #2563eb;
}

    .btn-primary:hover {
        background-color: #1d4ed8;
    }

.btn-clear {
    background-color: #16a34a;
    border-color: #16a34a;
    font-weight: 500;
}

    .btn-clear:hover {
        background-color: #15803d;
        border-color: #15803d;
    }


/* ===================================================== */
/* ADJUSTMENT COLORS                                    */
/* ===================================================== */

.adjustment-positive {
    border-color: #198754 !important;
    background-color: #e9f7ef;
}

.adjustment-negative {
    border-color: #dc3545 !important;
    background-color: #fdeaea;
}

.total-positive {
    color: #198754;
    font-weight: 600;
}

.total-negative {
    color: #dc3545;
    font-weight: 600;
}



ul.dtr-details li {
    display: flex;
    justify-content: space-between;
}