/*
============================================================
TTT_DISPATCH_DEMAND_QUEUE_WEB_V1
============================================================
*/

#ttt-demand-queue-overlay,
#ttt-demand-assign-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
}

#ttt-demand-assign-overlay {
    z-index: 12100;
}

.ttt-demand-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .58);
}

.ttt-demand-window {
    position: absolute;
    inset: 4vh 3vw;
    background: #f5f7fb;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 24px 80px
        rgba(0,0,0,.28);
}

.ttt-demand-head {
    min-height: 68px;
    padding: 14px 18px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ttt-demand-head h2 {
    margin: 0;
    font-size: 20px;
}

.ttt-demand-head p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 12px;
}

.ttt-demand-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: #eef2f7;
    font-size: 22px;
    cursor: pointer;
}

.ttt-demand-body {
    flex: 1;
    overflow: auto;
    padding: 16px;
}

.ttt-demand-filters {
    display: grid;
    grid-template-columns:
        150px
        150px
        150px
        130px
        130px
        minmax(220px, 1fr)
        auto;
    gap: 9px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    padding: 12px;
    margin-bottom: 12px;
}

.ttt-demand-filter label {
    display: block;
    font-size: 11px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 5px;
}

.ttt-demand-filter input,
.ttt-demand-filter select {
    width: 100%;
    height: 38px;
    border: 1px solid #d5dce6;
    border-radius: 8px;
    background: #fff;
    padding: 7px 9px;
    outline: none;
}

.ttt-demand-filter input:focus,
.ttt-demand-filter select:focus {
    border-color: #647ea9;
    box-shadow:
        0 0 0 3px
        rgba(100,126,169,.10);
}

.ttt-demand-filter-btn {
    align-self: end;
    height: 38px;
    border: 0;
    border-radius: 8px;
    padding: 0 15px;
    background: #172033;
    color: #fff;
    font-weight: 750;
    cursor: pointer;
}

.ttt-demand-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 11px;
}

.ttt-demand-summary-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 7px 11px;
    font-size: 12px;
}

.ttt-demand-summary-item strong {
    margin-left: 4px;
}

.ttt-demand-table-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    overflow: auto;
}

.ttt-demand-table {
    width: 100%;
    min-width: 1250px;
    border-collapse: collapse;
}

.ttt-demand-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    padding: 10px 9px;
    border-bottom: 1px solid #dfe5ec;
    text-align: left;
    font-size: 11px;
    color: #475569;
    white-space: nowrap;
}

.ttt-demand-table td {
    padding: 10px 9px;
    border-bottom: 1px solid #edf1f5;
    vertical-align: top;
    font-size: 12px;
}

.ttt-demand-table tr:hover td {
    background: #fbfcfe;
}

.ttt-demand-route strong {
    display: block;
}

.ttt-demand-route span {
    display: block;
    color: #64748b;
    margin: 3px 0;
}

.ttt-demand-weight {
    font-weight: 800;
    white-space: nowrap;
}

.ttt-demand-weight small {
    display: block;
    color: #64748b;
    margin-top: 3px;
}

.ttt-demand-status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-weight: 750;
    font-size: 10px;
    background: #fff1d6;
    color: #925d00;
}

.ttt-demand-status.ASSIGNED {
    background: #e8f6ee;
    color: #167445;
}

.ttt-demand-fleet {
    line-height: 1.55;
}

.ttt-demand-fleet strong {
    display: block;
}

.ttt-demand-fleet small {
    display: block;
    color: #64748b;
}

.ttt-demand-action {
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    padding: 7px 11px;
    font-weight: 750;
    cursor: pointer;
    background: #172033;
    color: #fff;
    white-space: nowrap;
}

.ttt-demand-action.secondary {
    background: #edf1f6;
    color: #334155;
}

.ttt-demand-empty {
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
}


/* =========================================================
ASSIGN
========================================================= */

.ttt-demand-assign-card {
    position: absolute;
    width: min(650px, calc(100% - 30px));
    max-height: 90vh;
    overflow: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 17px;
    box-shadow:
        0 24px 80px
        rgba(0,0,0,.3);
}

.ttt-demand-assign-head {
    padding: 17px 19px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.ttt-demand-assign-head h3 {
    margin: 0;
}

.ttt-demand-assign-body {
    padding: 18px;
}

.ttt-demand-proposal-card {
    background: #f7f9fc;
    border: 1px solid #e1e7ef;
    border-radius: 11px;
    padding: 12px;
    margin-bottom: 14px;
    line-height: 1.55;
}

.ttt-demand-form-label {
    display: block;
    margin-top: 13px;
}

.ttt-demand-form-label > span {
    display: block;
    font-size: 12px;
    font-weight: 750;
    margin-bottom: 6px;
}

.ttt-demand-form-label select,
.ttt-demand-form-label textarea {
    width: 100%;
    border: 1px solid #d3dbe6;
    border-radius: 9px;
    padding: 10px;
    background: #fff;
}

.ttt-demand-vehicle-result {
    margin-top: 13px;
    border: 1px solid #dbe3ec;
    border-radius: 11px;
    padding: 12px;
    background: #fbfcfe;
}

.ttt-demand-vehicle-result.pending {
    color: #64748b;
}

.ttt-demand-vehicle-result.error {
    border-color: #efc8c8;
    background: #fff2f2;
    color: #a22626;
}

.ttt-demand-vehicle-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ttt-demand-vehicle-box {
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 9px;
}

.ttt-demand-vehicle-box small {
    display: block;
    color: #64748b;
    margin-bottom: 4px;
}

.ttt-demand-vehicle-box strong {
    display: block;
}

.ttt-demand-assign-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.ttt-demand-assign-actions button {
    min-height: 40px;
    border: 0;
    border-radius: 9px;
    padding: 9px 15px;
    font-weight: 750;
    cursor: pointer;
}

.ttt-demand-confirm {
    background: #172033;
    color: #fff;
}

.ttt-demand-confirm:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.ttt-demand-cancel {
    background: #edf1f6;
    color: #334155;
}


/* =========================================================
NAV
========================================================= */

.ttt-demand-nav-badge {
    margin-left: auto;
    min-width: 22px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff0cf;
    color: #845500;
    font-size: 10px;
    font-weight: 800;
    padding: 0 6px;
}


/* =========================================================
RESPONSIVE
========================================================= */

@media (max-width: 1050px) {
    .ttt-demand-filters {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {

    .ttt-demand-window {
        inset: 1vh 1vw;
        border-radius: 12px;
    }

    .ttt-demand-filters {
        grid-template-columns: 1fr 1fr;
    }

    .ttt-demand-vehicle-grid {
        grid-template-columns: 1fr;
    }
}
