﻿:root {
    --blue-color: #D74633;
    --green-color: #006730;
    --dark-color: #28363C;
    --white-color: #F6F7FA;
    --alt-white-color: #F1EBEB;
    --gray-color: #2C2C2C;
}

body.dark .tab-button {
    background-color: var(--dark-color);
    color: var(--white-color);
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

    body.dark .tab-button.active {
        background-color: var(--green-color);
        color: white;
    }

    body.dark .tab-button:hover {
        background-color: var(--green-color);
        color: white;
        opacity: 0.9;
    }

body.dark .search-group input {
    background-color: var(--dark-color);
    color: var(--white-color);
}

body.dark .search-group i {
    color: var(--white-color);
}

body.dark .input-row input[type="date"],
body.dark .input-row input[type="text"] {
    background-color: var(--dark-color);
    color: var(--white-color);
}

    body.dark .input-row input[type="date"]::-webkit-datetime-edit {
        color: var(--white-color);
    }

body.dark .table-body-placeholder {
    border: var(--white-color);
    color: var(--white-color);
}



    body.dark .table-body-placeholder > div {
        padding: 10px;
        border-bottom: 1px solid var(--white-color);
    }

    body.dark .table-body-placeholder:nth-child(even) {
        background-color: var(--gray-color);
    }

    body.dark .table-body-placeholder:nth-child(odd) {
        background-color: var(--dark-color);
    }

body.dark .popup-content {
    background: var(--dark-color);
}

body.dark .custom-table th,
body.dark .custom-table td {
    color: var(--white-color) !important;
}

body.dark .custom-table thead,
body.dark .custom-table th,
body.dark .custom-table td,
body.dark .scroll-container {
    background-color: var(--dark-color) !important;
}

body.dark .custom-dropdown {
    background-color: var(--dark-color);
}

body.dark .cancel-btn {
    background: var(--gray-color) !important;
    color: var(--white-color) !important;
    /* Add transition for background-color and color */
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

body.dark .reject-btn {
    background: var(--dark-color) !important;
    color: var(--blue-color) !important;
    border: 2px solid #1E73BE !important;
    /* Add transition for background-color and color */
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

body.dark .accept-btn {
    /* Add transition for background-color and color */
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

    body.dark .cancel-btn:hover,
    body.dark .reject-btn:hover,
    body.dark .accept-btn:hover {
        opacity: 0.7 !important;
    }

body.dark .max-page,
body.dark .page-input,
body.dark .divider {
    color: var(--white-color);
}

.tab-button-group {
    display: flex;
    gap: 0;
}

/* Button Tabs */
.tab-button {
    padding: 6px 24px;
    width: 150px;
    font-size: 0.875rem;
    font-weight: 400;
    border: 2px solid var(--green-color);
    border-radius: 15px 0 0 0;
    background-color: var(--white-color);
    color: var(--green-color);
    /* Add transition for background-color and color */
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

    .tab-button.active {
        background-color: var(--green-color);
        color: white;
    }

    .tab-button:hover {
        background-color: var(--green-color);
        color: white;
        opacity: 0.9;
    }

/* Input Row */
.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

    .input-row input[type="date"],
    .input-row input[type="text"] {
        padding: 6px 10px;
        font-size: 0.875rem;
        border: 1.5px solid var(--gray-color);
        background-color: var(--white-color);
        border-radius: 4px;
        color: black;
    }

        /* Date */
        .input-row input[type="date"]::-webkit-datetime-edit {
            color: black;
            cursor: pointer;
        }

        .input-row input[type="date"]::placeholder {
            color: #ccc;
            cursor: pointer;
        }

/* Search Field */
.search-group {
    position: relative;
    width: 300px;
}

    .search-group input {
        padding-left: 36px !important; /* Enough space for icon */
        background-color: var(--gray-color);
        border: none;
        width: 100%;
        color: black;
        border-radius: 4px;
        font-size: 0.875rem;
    }

    .search-group i {
        position: absolute;
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
        color: black;
        font-size: 1rem;
        pointer-events: none;
    }

/* + New Request */
.new-request-btn {
    background-color: #8DD334;
    color: white;
    font-weight: bold;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 0.875rem;
    border: none; /* same as background */
    /* Add transition for background-color and color */
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease, border 0.3s ease;
}

    .new-request-btn:not(:disabled):hover {
        background-color: #157347;
    }

    .new-request-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

.card .card-header, .table-header {
    background-color: var(--blue-color);
    color: white;
    font-size: 1rem;
    font-weight: 600;
}

/* Table Header */
.table-header {
    text-align: left;
    display: grid;
    grid-template-columns: 50px 1fr 1fr 1fr 1fr 60px;
    border-radius: 6px 6px 0 0;
}

    .table-header > div {
        padding: 10px;
        border-bottom: 1px solid lightgray;
        /*        border-right: 1px solid white;*/
    }

        .table-header div:last-child {
            border-right: none;
        }

/* Table Body Placeholder */
.table-body-placeholder {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 1fr 1fr 60px;
    color: black;
    text-align: left;
    border: none;
    border-top: none;
}

    .table-body-placeholder > div {
        padding: 10px;
        border-bottom: 1px solid lightgray;
    }

    .table-body-placeholder > div.span-all {
        grid-column: 1/-1;
    }

    .table-body-placeholder:nth-child(even) {
        background-color: var(--alt-white-color);
    }

    .table-body-placeholder:nth-child(odd) {
        background-color: var(--white-color);
    }

.row-action-btn {
    background-color: var(--blue-color);
    color: white;
    font-weight: bold;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    /* Add transition for background-color and color */
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

    .row-action-btn:hover {
        opacity: 0.7;
    }

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1050; /* ← Higher than navbar (usually 1000) */
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: white;
    border-radius: 12px;
    width: 900px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.popup-header {
    position: relative; /* Add this line */
    background-color: var(--blue-color);
    color: white;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
}

.popup-header h3 {
    margin: 0;
}

.scroll-container {
    max-height: 160px;
    overflow-y: auto;
    padding-right: 16px; /* Adjust to scrollbar width */
    box-sizing: content-box;
}

.custom-table {
    border-collapse: collapse;
    width: 100%;
}

    .custom-table th,
    .custom-table td {
        padding: 8px;
        border-bottom: 1px solid var(--gray-color) !important; /* Or remove it if not needed */
        text-align: left;
        color: black !important;
        border-left: none !important; /* Remove left borders to prevent double lines */
        border-right: none !important;
        box-shadow: none !important;
        outline: none !important;
    }

    .custom-table td {
        background-color: white !important;
    }

    .custom-table thead th {
        position: sticky;
        top: 0;
        background-color: var(--white-color) !important;
        z-index: 2;
        border-bottom: 1px solid var(--gray-color) !important; /* normal bottom line */
        border-top: none !important;
        border-left: none !important;
        border-right: none !important;
        box-shadow: none !important;
        outline: none !important;
        padding: 8px;
        margin: 0;
    }

    .custom-table thead {
        background-color: inherit !important; /* override any theme vars */
        color: inherit !important;
        border: none !important; /* kill any accidental border from global styles */
    }

.custom-divider {
    border: none;
    border-top: 2px solid var(--blue-color);
    margin: 10px 0;
}

.custom-dropdown {
    padding: 5px 10px;
    border: 2px solid var(--gray-color);
    border-radius: 8px;
    font-size: 14px;
    min-width: 160px;
    cursor: pointer;
}

.btn {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    /* Add transition for background-color and color */
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.close-button {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: white;
    z-index: 2; /* make sure it floats above the header */
}

.cancel-btn {
    background: #eee !important;
    color: #333 !important;
    /* Add transition for background-color and color */
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease !important;
}

.reject-btn {
    background: white !important;
    color: var(--blue-color) !important;
    border: 2px solid var(--blue-color) !important;
    /* Add transition for background-color and color */
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease !important;
}

.accept-btn {
    background: var(--blue-color) !important;
    color: white !important;
    /* Add transition for background-color and color */
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease !important;
}

    .cancel-btn:hover,
    .reject-btn:hover,
    .accept-btn:hover {
        opacity: 0.7 !important;
    }


.spacer {
    flex-grow: 1;
}

.flex-row-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* prevent wrapping */
    gap: 1rem; /* optional */
}

.right-buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0; /* prevent shrinking */
}

.input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.total-cbm {
    white-space: nowrap;
    margin: 0;
}

.cbm-driver-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Flex ratios for each section */
.cbm-section {
    flex: 1.2; /* slightly more space for text */
    display: flex;
    align-items: center;
}

.driver-section {
    flex: 1; /* enough for label + dropdown */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.line-section {
    flex: 1.4; /* more space for the longer label + dropdown */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

    /* Optional: make labels not wrap awkwardly */
    .driver-section label,
    .line-section label {
        white-space: nowrap;
    }

.label-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aligns left with dropdown */
    line-height: 1; /* Tighter spacing */
}

    .label-stack small {
        margin-top: 2px; /* Slight spacing */
    }

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.pagination-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: sans-serif;
    font-weight: 500;
    color: #333;
}

.nav-button {
    background: var(--white-color);
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    color: #333;
}

    .nav-button:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

.page-input {
    width: 2.5rem;
    height: 2rem;
    text-align: center;
    border: 1px solid var(--gray-color);
    border-radius: 8px;
    font-size: 1rem;
    padding: 0;
}

    .page-input::-webkit-outer-spin-button,
    .page-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

.divider {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--gray-color);
}

.max-page {
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* optional spacing between checkbox and text */
}

.card-header .card-title{
    margin-bottom:0;
}

.table-body-placeholder img.tbp-image {
    width:100%;
    border-radius:1rem;

}

.foot-notes {
    font-style: italic;
    font-size: 0.8rem;
    font-weight: normal
}

footer.footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.detail-bar {
    overflow-y: hidden;
    height: 0px;
    padding: 0px !important;
}

    .detail-bar.show {
        height: auto;
    }

.uom-conv-label {
    font-style: italic;
    font-size: 0.8em;
}

.nowrap-group {
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
}

.sku-image {
    width: 80px;
    height: 80px;
}