/* AWV action and ride pages (awv branch only). One stylesheet for the pages under Pages/Awv that
   share the ride table, so the overview, the edit dialogs and the move dialogs read alike. */

.awv-sub {
    margin: 4px 0 0;
    font-size: 14px;
    color: #5F6E85;
}

.awv-back {
    display: inline-block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #5263FF;
    text-decoration: none;
}

.awv-card {
    background: #ffffff;
    border: 1px solid #EBECED;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    overflow: hidden;
}

.awv-card h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.awv-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.awv-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.awv-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 160px;
    color: #5F6E85;
    font-size: 14px;
}

.awv-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.awv-table-wrap {
    overflow-x: auto;
}

.awv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.awv-table th {
    text-align: left;
    font-weight: 600;
    color: #5F6E85;
    padding: 8px 10px;
    border-bottom: 1px solid #EBECED;
    white-space: nowrap;
    font-size: 13px;
}

.awv-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #F3F4F6;
    color: #1A2B48;
    vertical-align: middle;
}

.awv-table tfoot td {
    border-top: 2px solid #EBECED;
    border-bottom: none;
    font-weight: 600;
}

.awv-strong {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.awv-row-link {
    cursor: pointer;
}

.awv-row-link:hover td {
    background: #F8FAFC;
}

.awv-actions-cell {
    text-align: right;
    white-space: nowrap;
}

.awv-minutes {
    max-width: 140px;
}

.awv-time,
.awv-number {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.awv-number {
    text-align: right;
}

/* The header of a number column sits over its right-aligned values: the plain header rule above
   is more specific than .awv-number, which left "Hours worked" and the rest hanging left. */
.awv-table th.awv-number {
    text-align: right;
}

/* Inside a sidebar or a dialog the table has a few hundred pixels, not a page: the column
   headers wrap onto two lines instead of pushing the last columns out past the edge. */
.awv-dispatch-runs .awv-table th,
.modal-body .awv-table th {
    white-space: normal;
    vertical-align: bottom;
    min-width: 64px;
}

/* A timestamp that breaks the action type's deviation rule (2.3-02). */
.awv-table td.is-deviation {
    background: #FDECEC;
    color: #B42318;
    font-weight: 600;
}

.awv-badges {
    white-space: nowrap;
}

.awv-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 4px;
    border-radius: 999px;
    font-size: 12px;
    background: #F3F4F6;
    color: #5F6E85;
}

.awv-badge.is-open {
    background: #E7F6EC;
    color: #1E7B3A;
}

.awv-badge.is-zero {
    background: #FFF4E5;
    color: #B26A00;
}

.awv-badge.is-merged {
    background: #EEF0FF;
    color: #3B47C4;
}

.awv-chart {
    position: relative;
    width: 100%;
}

.awv-empty-small {
    min-height: 60px;
}

/* A ride left out of the action: present, but visibly not counted. */
.awv-row-excluded td {
    color: #5F6E85;
}

.awv-badge.is-manual {
    background: #F1F5F9;
    color: #334155;
}

.awv-link-button {
    border: none;
    background: none;
    padding: 0 6px 0 0;
    font-size: 12px;
    color: #5263FF;
    cursor: pointer;
}

.awv-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.awv-link-button.is-danger {
    color: #B42318;
}

/* Decision categories (Decisions switch): one colour each wherever a decision or its type is
   shown, the pill in Settings and on the decision, the By zone cells and the dispatch list rows.
   DecisionCategoryRules.CssClass names the classes. */
.decision-category-pill {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.decision-category-dispatch {
    color: #E03131;
    background: #FFF0F0;
    border-color: #E03131 !important;
}

.decision-category-standby {
    color: #B76E00;
    background: #FFF4E0;
    border-color: #B76E00 !important;
}

.decision-category-noaction {
    color: #5F6E85;
    background: #F1F3F5;
    border-color: #5F6E85 !important;
}

/* A decision's row on the dispatch list: tinted in its category's background, with a bar in
   its colour down the left edge, so the row's own text stays readable. */
tr[data-decision-category="Dispatch"] > td { background: #FFF0F0; }
tr[data-decision-category="Standby"] > td { background: #FFF4E0; }
tr[data-decision-category="NoAction"] > td { background: #F1F3F5; }
tr[data-decision-category="Dispatch"] > td:first-child { box-shadow: inset 4px 0 0 #E03131; }
tr[data-decision-category="Standby"] > td:first-child { box-shadow: inset 4px 0 0 #B76E00; }
tr[data-decision-category="NoAction"] > td:first-child { box-shadow: inset 4px 0 0 #5F6E85; }

/* The sidebar is a fixed element, so it is a stacking context of its own and the zone picker's
   menu, which opens out over the page, sat under the page's own raised controls (the date range
   bar). While the menu is open the sidebar is lifted above them. */
.sidebar:has(.awv-zone-menu.show) {
    z-index: 100000;
}

/* The two-step run control (2.3-15): a badge per state. */
.awv-control-badge.is-pending {
    background: #F3F4F6;
    color: #5F6E85;
}

.awv-control-badge.is-checking {
    background: #EEF0FF;
    color: #3B47C4;
}

.awv-control-badge.is-approved {
    background: #E7F6EC;
    color: #1E7B3A;
}

.awv-control-badge.is-rejected {
    background: #FDECEC;
    color: #B42318;
}

/* The reference routes' check (2.2-24, 2.2-25): the map's red and orange, as badges. */
.awv-badge.is-missed {
    background: #FDECEC;
    color: #B42318;
}

.awv-badge.is-offroute {
    background: #FFF1E6;
    color: #C2410C;
}
