﻿:root {
    --blue-color: #D74633;
    --green-color: #006730;
    --dark-color: #28363C;
    --white-color: #F6F7FA;
    --alt-white-color: #F1EBEB;
    --gray-color: #334046;
}

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,
body.dark .custom-table-2 td {
    color: var(--white-color) !important;
}

    body.dark .custom-table-2 td.blue,
    body.dark .custom-table-2 th.blue {
        color: var(--blue-color) !important;
        background: none !important; /* override any background */
    }

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: 165px;
    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(--white-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 80px;
    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 80px;
    color: black;
    text-align: left;
    border: none;
    border-top: none;
}

    .table-body-placeholder > div {
        padding: 10px;
        overflow: hidden;
        text-overflow: ellipsis;
        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 h3 {
        margin: 0;
    }

.scroll-container {
    max-height: 160px;
    overflow-y: auto;
    padding-right: 16px; /* Adjust to scrollbar width */
    box-sizing: content-box;
}

.custom-table-2 {
    border-collapse: collapse;
    width: 100%;
    text-align: left;
}

    .custom-table-2 th,
    .custom-table-2 td {
        border: none;
        padding: 6px 8px;
    }

    .custom-table-2 thead th {
        background: none;
        color: #1E73BE;
        font-weight: 700; /* fw-bold */
    }

    .custom-table-2 td.blue,
    .custom-table-2 th.blue {
        color: #FC5857 !important;
        background: none !important; /* override any background */
    }

.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;
        color: white !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;
}

.popup-header {
    display: flex;
    align-items: center; /* vertically center both items */
    justify-content: space-between; /* space between title and X */
    background-color: var(--blue-color);
    color: white;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
}

.close-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-icon {
    width: 20px;
    height: 20px;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
}

.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
}

.legend-dot {
    width: 15px;
    height: 15px;
    display: inline-block;
    border-radius: 50%;
}

.legend-box {
    background-color: #E6E6E6;
}

.legend-dot.inbound {
    background-color: #00CFE8;
}

.legend-dot.outbound {
    background-color: #EA5455;
}

.legend-dot.internal {
    background-color: #FF9F43;
}

.legend-dot.vas {
    background-color: #7367F0;
}

.calendar-container {
    background-color: var(--white-color);
    color: black;
}

.calendar-cell {
    height: 100px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .calendar-cell:hover {
        background-color: #e0f0ff;
    }

    .calendar-cell.inactive {
        opacity: 0.4;
        cursor: not-allowed;
    }

    .calendar-cell.today {
        font-weight: bold;
    }

    .calendar-cell.selected {
        background-color: #007bff !important;
        color: white;
    }

body.dark .calendar-container {
    background-color: #1e1e2f;
    color: white;
}

body.dark .calendar-cell:hover {
    background-color: #2c2c3c;
}

body.dark .calendar-cell.selected {
    background-color: #0056b3 !important;
}

body.dark .legend-box {
    background-color: #2c2c3c;
}

.theme-aware-button {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 750;
    background-color: var(--white-color);
    color: var(--blue-color);
    border: 1px solid var(--blue-color);
    transition: background-color 0.2s ease;
}

    .theme-aware-button:hover {
        background-color: #e6f0ff;
    }

.rounded-table {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 0.5rem;
}

    /* Top corners */
    .rounded-table thead .rounded-top-start {
        border-top-left-radius: 0.5rem;
    }

    .rounded-table thead .rounded-top-end {
        border-top-right-radius: 0.5rem;
    }

    /* Bottom corners */
    .rounded-table tbody .table-last-row td:first-child {
        border-bottom-left-radius: 0.5rem;
    }

    .rounded-table tbody .table-last-row td:last-child {
        border-bottom-right-radius: 0.5rem;
    }

.selected-order-bg {
    background-color: #E6E6E6; /* Bootstrap's light gray */
}

body.dark .selected-order-bg {
    background-color: #2c2c2c; /* or any darker gray */
}

.icon-button-light {
    background-color: transparent !important;
    color: white !important;
    border: none;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
}

    .icon-button-light:hover {
        background-color: rgba(255, 255, 255, 0.1); /* optional subtle hover effect */
    }

/* Specific override ONLY for custom-table with outer border */
.custom-table.with-outer-border {
    border: 1px solid black;
    border-radius: 0.5rem;
    overflow: hidden;
}

    /* Bottom border removal on the last row */
    .custom-table.with-outer-border tr:last-child td {
        border-bottom: none !important;
    }

/* Dark mode variant */
body.dark .custom-table.with-outer-border {
    border: 1px solid white;
}

/* Base badge styling */
.type-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    color: white;
}

    /* Color mappings */
    .type-badge.inbound {
        background-color: #00CFE8;
    }

    .type-badge.outbound {
        background-color: #EA5455;
    }

    .type-badge.internal {
        background-color: #FF9F43;
    }

    .type-badge.vas {
        background-color: #7367F0;
    }

/* Only in light mode */
body:not(.dark) .custom-table-light tbody tr td {
    background-color: #F0F0F0 !important;
}

.custom-table-light thead tr th {
    background-color: var(--blue-color) !important;
    color: white !important;
}

body.dark .custom-table-light thead tr th {
    background-color: var(--blue-color) !important;
    color: white !important;
}

.clickable {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

    .clickable:hover {
        background-color: #e0e0e0; /* light gray background on hover */
    }

body.dark .clickable:hover {
    background-color: #3a3a3a;
}

body.dark .bg-color-white {
    background-color: var(--gray-color) !important;
    color: white;
}

.bg-color-white {
    background-color: white !important;
    color: black;
}

.spacer-h5-mb1 {
    height: 1.75rem; /* ~28px */
}

.spacer-h5-mb1-mt4 {
    height: 3.25rem; /* ~52px */
}

.custom-switch:checked {
    background-color: #28a745 !important; /* Bootstrap green */
    border-color: #28a745 !important;
}

.table-body-placeholder > div.no-clip {
    overflow: visible; /* let the balloon escape */
    text-overflow: unset;
}

.balloon-menu-left {
    position: absolute;
    top: 0px;
    left: -180px; /* atur sesuai kebutuhan posisi kiri */
    color: black;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0,0,0,0.1);
    padding: 8px 12px;
    z-index: 9999;
    min-width: 160px;
}

    .balloon-menu-left div {
        padding: 6px 8px;
        cursor: pointer;
        border-radius: 5px;
    }

        .balloon-menu-left div:hover {
            background-color: #f0f0f0;
        }

.dropdown-enabled {
    background-color: #fff !important;
    color: #000 !important;
}

.dropdown-disabled {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
}

/* Default enabled (putih) */
.custom-batch-dropdown.rz-dropdown,
.custom-batch-dropdown .rz-dropdown-label {
    background-color: #fff !important;
    border-radius: 0.375rem !important;
    color: #000 !important;
}

/* Disabled state (abu-abu) */
.custom-batch-dropdown.dropdown-disabled.rz-dropdown,
.custom-batch-dropdown.dropdown-disabled .rz-dropdown-label {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    border-radius: 0.375rem !important;
}

/* Kalau enabled */
.input-group input:not(:disabled) {
    background-color: #fff !important;
    color: #000 !important;
}

/* Kalau disabled */
.input-group input:disabled {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
}

body.dark .dropdown-enabled,
body.dark .input-group input:not(:disabled) {
    background-color: #2f3b42 !important;
    color: #e0e0e0 !important;
    border: 1px solid #455a64 !important;
}

    body.dark .dropdown-enabled:hover,
    body.dark .input-group input:not(:disabled):hover {
        background-color: #3a474f !important;
        border-color: #607d8b !important;
    }

body.dark .dropdown-disabled,
body.dark .input-group input:disabled {
    background-color: #3a3a3a !important;
    color: #888 !important;
    border: 1px solid #444 !important;
    cursor: not-allowed !important;
}

body.dark .custom-batch-dropdown.rz-dropdown,
body.dark .custom-batch-dropdown .rz-dropdown-label {
    background-color: #2f3b42 !important;
    color: #e0e0e0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0.375rem !important;
}

body.dark .custom-batch-dropdown.dropdown-disabled.rz-dropdown,
body.dark .custom-batch-dropdown.dropdown-disabled .rz-dropdown-label {
    background-color: #3a3a3a !important;
    color: #888 !important;
    border: none !important;
}

footer.footer{
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.sku-image {
    width: 80px;
    height: 80px;
}