/* The aniTa signals wherever a page lists them: the «Insights» of the aniTa flyout (AniTaInsightsPanel), the
   popover of a row mark (AniTaSignalPopover, through AniTaSignalList) and the actions of one case
   (AniTaSignalActions). Shared here, and not in a scoped stylesheet, because the lines and the actions are
   rendered by different components: a scoped rule reaches only its own component's elements. A section
   title per kind, then one block per signal; a signal new for the user carries a purple line on its left.
   Predictions use their own teal so they never read as a severity. */

.anita-signals-section {
    padding: 8px 12px 3px;
    color: #6b7c93;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.anita-signals-section.prediction {
    color: #0e7490;
}

.anita-signal {
    padding: 7px 12px 8px;
}

.anita-signal + .anita-signal {
    border-top: 1px solid #dbe3ee;
}

.anita-signal.new {
    box-shadow: inset 3px 0 0 #6d28d9;
}

.anita-signal-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
}

/* The title takes the room left on the severity's line, so a long title wraps beside it instead of
   leaving the severity alone on a line. */
.anita-signal-line strong {
    flex: 1 1 0;
    min-width: 0;
    font-weight: 600;
}

.anita-signal-sev {
    flex-shrink: 0;
    padding: 1px 7px;
    border-radius: 9px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.anita-signal-sev.critical { color: #b42318; background: #fdecea; }
.anita-signal-sev.high { color: #c2410c; background: #fff1e6; }
.anita-signal-sev.medium { color: #a16207; background: #fef6e0; }
.anita-signal-sev.low { color: #4b5d73; background: #eef2f7; }
.anita-signal-sev.none { color: #4b5d73; background: #f4f6f9; }

.anita-signal-prob {
    flex-shrink: 0;
    color: #0e7490;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.anita-signal-tag {
    color: #6d28d9;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
}

.anita-signal-meta {
    margin-top: 1px;
    color: #6b7c93;
    font-size: 0.74rem;
}

.anita-signal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
}

.anita-signal-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    color: #1f2d3d;
    background: #fff;
    border: 1px solid #dbe3ee;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
}

.anita-signal-btn:hover {
    background: #eef3f9;
}

.anita-signal-btn:disabled {
    opacity: 0.6;
}

.anita-signal-btn.primary {
    color: #fff;
    background: #0a43e8;
    border-color: #0a43e8;
}

.anita-signal-btn.primary:hover {
    background: #0634ba;
}

.anita-signal-btn.ai {
    color: #6d28d9;
    border-color: #e6dcfc;
}

.anita-signal-state {
    padding: 1px 8px;
    color: #027a48;
    background: #ecfdf3;
    border-radius: 9px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* A grid cell that carries the row's mark before its value (the number of a load order). The gap keeps the
   purple ring of a new mark, drawn outside the circle, off the first digit. */
.anita-mark-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

/* A list's «Todas | Com casos N» switch (AniTaListCasesToggle): two segments in one aniTa-purple frame, the
   one in force filled, and the count in a chip on «Com casos». A host may style every span of its header —
   Planeamento V2's `.planning-v2-panel-heading span` makes them grey, smaller and block, which left the count
   grey on purple —, so the spans inside the switch are reached with two classes and win over it. */
.anita-list-filter {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #e6dcfc;
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
}

.anita-list-filter .jump-ui-button {
    gap: 6px;
    color: #6d28d9;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.anita-list-filter .jump-ui-button + .jump-ui-button {
    border-left: 1px solid #e6dcfc;
}

.anita-list-filter .jump-ui-button--primary {
    color: #fff;
    background: #6d28d9;
}

.anita-list-filter .jump-ui-button:focus-visible {
    box-shadow: inset 0 0 0 2px #c4b5fd;
}

.anita-list-filter .jump-ui-button-icon {
    display: inline-block;
    color: inherit;
    font-size: inherit;
    line-height: 1;
}

.anita-list-filter .anita-list-filter-count {
    display: inline-block;
    padding: 0 6px;
    color: #fff;
    background: #6d28d9;
    border-radius: 9px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

.anita-list-filter .jump-ui-button--primary .anita-list-filter-count {
    color: #6d28d9;
    background: #fff;
}

/* The cases of a record on the line beneath it (AniTaRecordCasesLine), in the detail row of a grid: one
   compact line per case, the actions right after its age. The detail cell is as wide as every column of the
   grid, wider than the box on screen, so the block is held to the grid's visible width (a container query on
   the grid) and stays in view while the user scrolls sideways (sticky, which needs the cell not to clip it);
   a line too long for that width wraps. A case new for the user keeps the purple line on its left. */
.dxbl-grid:has(.anita-record-cases) {
    container-type: inline-size;
}

.dxbl-grid .dxbl-grid-table > tbody > tr > td.jump-grid-detail-cell:has(.anita-record-cases) {
    overflow: visible;
}

.anita-record-cases {
    position: sticky;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    box-sizing: border-box;
    padding-left: 20px;
    font-size: 0.78rem;
}

.dxbl-grid .anita-record-cases {
    width: calc(100cqw - 40px);
}

.anita-record-case {
    display: flex;
    flex-wrap: wrap;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 2px 6px;
    background: #faf7ff;
    border-radius: 4px;
}

.anita-record-case.new {
    box-shadow: inset 3px 0 0 #6d28d9;
}

.anita-record-case-title {
    min-width: 0;
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.anita-record-case-age {
    flex-shrink: 0;
    color: #6b7c93;
}

.anita-record-case .anita-signal-actions {
    flex-wrap: nowrap;
    margin: 0 0 0 6px;
}

/* The cases as the strip at the foot of a card (AniTaRecordCasesLine InCard, Planeamento V2): one line per case —
   the severity as a dot, «novo», what the case says about the record, its age, a «Tratado» tick and a «⋯» menu —
   so a list of cards keeps its rhythm. The sentence takes what is left and opens the record's popover. */
.anita-record-cases.in-card {
    position: static;
    display: block;
    width: auto;
    padding: 0;
    border-top: 1px solid #e6dcfc;
    background: #fbf9ff;
    font-size: 0.72rem;
    cursor: default;
    container-type: inline-size;
}

.anita-record-cases.in-card .anita-record-case {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    width: auto;
    padding: 3px 4px 3px 12px;
    background: transparent;
    border-radius: 0;
}

.anita-record-cases.in-card .anita-record-case + .anita-record-case {
    border-top: 1px dashed #e6dcfc;
}

.anita-record-case-sev {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #64748b;
}

.anita-record-case-sev.critical { background: #b42318; }
.anita-record-case-sev.high { background: #c2410c; }
.anita-record-case-sev.medium { background: #a16207; }

.anita-record-case-sentence {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    color: #0a1a3a;
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 600;
    text-align: left;
}

/* The text cuts with an ellipsis in an inner span: a button centres content wider than itself and clips it on
   both sides, so «BRAGA ALVES LDA» showed as «VES LDA». */
.anita-record-case-sentence-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button.anita-record-case-sentence {
    cursor: pointer;
}

button.anita-record-case-sentence:hover {
    color: #6d28d9;
    text-decoration: underline;
}

button.anita-record-case-sentence:focus-visible,
.anita-record-case-elsewhere:focus-visible,
.anita-signal-icon:focus-visible {
    outline: 2px solid #6d28d9;
    outline-offset: 1px;
    border-radius: 3px;
}

.anita-record-cases.in-card .anita-record-case-age {
    color: #6b7c93;
    font-size: 0.66rem;
    white-space: nowrap;
}

.anita-record-cases.in-card .anita-signal-actions {
    flex: none;
    flex-wrap: nowrap;
    gap: 1px;
    margin: 0;
}

/* On a narrow card (the orders pane at a quarter of a 1440 px screen leaves about 220 px) the sentence keeps the
   room: the age stays in the popover and «novo» in the purple line on the case's left. */
@container (max-width: 300px) {
    .anita-record-cases.in-card .anita-record-case-age,
    .anita-record-cases.in-card .anita-record-case .anita-signal-tag {
        display: none;
    }
}

/* The other cards of the same record point at the card above that lists its cases. */
.anita-record-case-elsewhere {
    display: flex;
    align-items: center;
    gap: 3px;
    width: 100%;
    padding: 3px 8px 3px 10px;
    color: #6b5aa6;
    background: transparent;
    border: 0;
    font: inherit;
    font-style: italic;
    text-align: left;
    cursor: pointer;
}

.anita-record-case-elsewhere:hover {
    color: #6d28d9;
    text-decoration: underline;
}

/* The compact actions of a one-line case (AniTaSignalActions Compact): icon buttons, quiet until hovered. */
.anita-signal-actions.compact {
    margin: 0;
}

.anita-signal-icon {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    padding: 0;
    color: #5b6f8d;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
}

.anita-signal-icon:hover {
    background: #eef2f7;
}

.anita-signal-icon.ok {
    color: #0a7a4b;
}

.anita-signal-icon.ok:hover {
    background: #e3f6ec;
}

.anita-signal-icon:disabled {
    opacity: 0.6;
    cursor: default;
}

/* The vehicles of a «viaturas a descarregar perto» case in a popover (AniTaNearbyVehicles): the closest first,
   an unload already done in grey. */
.anita-nearby-vehicles {
    width: 100%;
    margin: 6px 0 2px;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.anita-nearby-vehicles th {
    padding: 2px 4px;
    color: #6b7c93;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid #eef2f7;
}

.anita-nearby-vehicles td {
    max-width: 140px;
    overflow: hidden;
    padding: 3px 4px;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom: 1px solid #f3f5f9;
}

.anita-nearby-vehicles .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.anita-nearby-vehicles tr.done td {
    color: #8a9ab2;
}

/* Where on a form an aniTa case asks the user to act (AniTaZoneDot): a small purple dot after the label of a
   tab, a sub-tab or a counter, ringed when a case of it is new for the user. Global and not isolated, because
   it sits inside other components' buttons. */
.anita-zone-dot {
    display: inline-block;
    flex: none;
    width: 8px;
    height: 8px;
    margin-left: 6px;
    vertical-align: middle;
    border-radius: 50%;
    background: #6d28d9;
    cursor: pointer;
}

.anita-zone-dot.new {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3.5px #6d28d9;
}

/* The line on the card of the operation a case is about: «aniTa · carga daqui a menos de 48 h sem viagem». */
.anita-operation-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: #6d28d9;
    font-size: 11px;
    font-weight: 600;
}
