/* ============================================================================
   Work item children panel — the grid of what sits under an item, and the
   quick-add row beneath it.

   Sized against the rest of the application rather than invented: the pill and
   label metrics come from case-detail.css and tag-pill.css, so a child row reads
   the same as a tag or a status anywhere else.
   ========================================================================== */

.wic {
    --wic-line: #dde2ea;
    --wic-line-2: #e3e6ec;
    --wic-ink: #101a33;
    --wic-muted: #5b6472;
    --wic-muted-2: #838c9b;
    --wic-brand: var(--dxds-primary-90, #4147d5);
    --wic-brand-soft: var(--dxds-primary-30, #dcdefa);
    --wic-brand-softer: var(--dxds-primary-10, #f0f1fd);

    display: flex;
    flex-direction: column;
    width: 100%;
    font-size: 12.5px;
}

.wic-empty {
    padding: 14px 2px;
    color: var(--wic-muted-2);
    font-size: 12.5px;
}

/* ── Grid ─────────────────────────────────────────────────────────────────── */

.wic-grid {
    width: 100%;
    border-collapse: collapse;
}

.wic-grid th {
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--wic-muted);
    padding: 7px 8px;
    border-bottom: 1px solid var(--wic-line);
    white-space: nowrap;
}

.wic-grid td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--wic-line-2);
    vertical-align: middle;
}

.wic-nr {
    width: 54px;
    font-weight: 700;
    color: var(--wic-brand);
    font-variant-numeric: tabular-nums;
}

.wic-col { width: 130px; }

.wic-num {
    width: 74px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.wic-muted { color: var(--wic-muted); }

.wic-title { color: var(--wic-ink); font-weight: 600; }

.wic-type,
.wic-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
    white-space: nowrap;
}

.wic-type { margin-right: 7px; }

/* ── Quick add ────────────────────────────────────────────────────────────── */

/* The row that decides whether breaking work down is cheap. Tinted so it reads as
   an invitation rather than as another grid row. */
.wic-add {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 9px 8px;
    background: var(--wic-brand-softer);
    border-top: 1px solid var(--wic-brand-soft);
}

.wic-types {
    display: flex;
    gap: 3px;
    background: #fff;
    border: 1px solid var(--wic-line);
    border-radius: 7px;
    padding: 2px;
}

.wic .wic-type-btn.dxbl-btn {
    height: 22px;
    padding: 0 9px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--wic-muted);
    background: transparent;
    border: 0;
}

.wic .wic-type-btn.is-on.dxbl-btn {
    background: var(--wic-brand-softer);
    color: var(--wic-brand);
}

.wic .wic-title-box { flex: 1 1 260px; min-width: 200px; }

.wic .wic-hours-box { width: 92px; flex: none; }

.wic .wic-add-btn.dxbl-btn {
    height: 28px;
    padding: 0 14px;
    font-size: 12.5px;
    font-weight: 700;
}

.wic-hint {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--wic-muted-2);
    white-space: nowrap;
}

.wic-error {
    padding: 8px 10px;
    margin: 6px 0 0;
    border-radius: 6px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 12px;
}

/* ============================================================================
   Work item type picker — a radio group whose options carry their own icon and
   colour, so the five kinds of work are legible before anything is clicked.
   ========================================================================== */

.wits {
    --wits-accent: var(--dxds-primary-90, #4147d5);
}

/* The options sit in a row with real gaps rather than the stacked default. */
.wits.dxbl-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* The tile *is* the control, so the stock radio circle beside it is a second thing
   saying the same thing. Hidden rather than removed: the input keeps the keyboard
   and the accessible name, it just stops being drawn. */
.wits .dxbl-checkbox-check-element {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.wits .dxbl-checkbox {
    margin: 0;
    background: none;
}

.wits .dxbl-checkbox > label {
    margin: 0;
    padding: 0;
    cursor: pointer;
}

/* Focus lands on the hidden input, so the ring has to be drawn on the tile instead —
   and only for keyboard focus. :focus-within also fires on a click, which left a ring
   sitting around the pill somebody had just chosen, concentric with its own border. */
.wits .dxbl-checkbox:has(input:focus-visible) .wits-item {
    outline: 2px solid var(--wits-accent);
    outline-offset: 2px;
}

.wits-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px 4px 8px;
    border: 1px solid #dde2ea;
    border-radius: 999px;
    background: #fff;
    font-size: 12.5px;
    font-weight: 600;
    color: #2c3346;
    line-height: 20px;
    white-space: nowrap;
}

/* Selected reads as the type's own colour: a pale wash of it behind, the colour
   itself on the rim and in the label. */
.wits-item.is-on {
    /* One line, not two. The border is already the type's colour; an inset ring on top
       of it was a second rim a pixel inside the first, which reads as a doubled edge
       rather than as emphasis. The border weight stays at 1px like every other pill —
       a thicker one would move the chosen pill half a pixel against its neighbours —
       so the accent colour and the wash behind it carry the selection on their own. */
    border-color: var(--wits-accent);
    background: color-mix(in srgb, var(--wits-accent) 10%, #fff);
    color: var(--wits-accent);
}

.wits-icon {
    flex: none;
    display: inline-flex;

    /* The glyph reads in its own type's colour on every pill, chosen or not — that is what
       distinguishes the five options before the labels are read. */
    color: var(--wits-accent);
}

.wits-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.wits-name { letter-spacing: .1px; }

/* ============================================================================
   Screenshot picker — a request rather than an assumption, and what came back
   shown rather than counted.
   ========================================================================== */

.shot-hint {
    margin-top: 5px;
    font-size: 11.5px;
    line-height: 1.45;
    color: #6b7280;
    max-width: 62ch;
}

/* Present from the start so JS can own the <img> src; revealed once one is taken. */
.shot-result { display: none; }
.shot-result.is-on { display: block; }

.shot-preview {
    display: block;
    max-width: 260px;
    max-height: 120px;
    border: 1px solid #dde2ea;
    border-radius: 6px;
    background: #fff;
}

.shot-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.shot-size {
    font-size: 11.5px;
    color: #6b7280;
    margin-right: 4px;
}

/* ============================================================================
   Effort card — the figures put next to each other, because apart they mean
   nothing: an estimate against an approval is a variance, a budget against a
   rollup is a decision somebody still has time to take.
   ========================================================================== */

.eff-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 18px;
    padding: 7px 0;
}

.eff-row + .eff-row { border-top: 1px solid #eef0f3; }

.eff-lead {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #9ca3af;
    min-width: 88px;
}

.eff-fig { display: inline-flex; align-items: baseline; gap: 6px; }

.eff-lbl {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    color: #6b7280;
}

.eff-val {
    font-size: 14px;
    font-weight: 700;
    color: #101a33;
    font-variant-numeric: tabular-nums;
}

.eff-cur { font-size: 11px; font-weight: 600; color: #9ca3af; }

.eff-badge {
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
}

.eff-pending { background: #fef3c7; color: #92400e; }
.eff-settled { background: #d1fae5; color: #065f46; }
.eff-refused { background: #fee2e2; color: #991b1b; }

/* Over the estimate reads as a warning; under it is merely a number. */
.eff-var { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.eff-var.is-over, .eff-val.is-over { color: #b91c1c; }
.eff-var.is-under { color: #047857; }

.eff-actions { padding-top: 8px; }
.eff-error { padding-top: 6px; font-size: 12px; color: #b91c1c; }

/* ============================================================================
   Links grid — one list out of two collections, the incoming half reworded.
   ========================================================================== */

.wil-empty { padding: 8px 0; font-size: 12.5px; color: #838c9b; }

.wil-grid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wil-grid td { padding: 6px 8px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }

/* The relation leads the row: it is what turns a list of numbers into sentences. */
.wil-rel {
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: lowercase;
    color: #6b7280;
    width: 1%;
}

.wil-nr { white-space: nowrap; font-variant-numeric: tabular-nums; color: #5b6472; width: 1%; }
.wil-col { width: 1%; white-space: nowrap; }
.wil-x { width: 1%; text-align: right; }

.wil-type,
.wil-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.wil-type { margin-right: 7px; }
.wil-title { color: #101a33; font-weight: 600; }

.wil-add { display: flex; align-items: center; gap: 6px; padding-top: 8px; }
.wil-type-box { width: 150px; }
.wil-item-box { width: 320px; }
.wil-error { padding-top: 6px; font-size: 12px; color: #b91c1c; }

/* ============================================================================
   Work item type glyph — the kind of work, in the list and the tree.
   ========================================================================== */

/* The glyph alone, in the type's own colour, inherited through `currentColor`. No frame
   around it: a box per row drew a second grid down the column, and in the tree it competed
   with the indentation that is the point of that view. */
.wit-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    color: #5b6472;
}

.wit-glyph svg {
    width: 17px;
    height: 17px;
    display: block;
}

/* ============================================================================
   List cells — a person as a disc.
   ========================================================================== */

/* The assignee cell borrows .pwt-cell from the case list so a person reads the same in
   both, but that class stacks its two rows vertically for the party-with-tags variant.
   One name and one icon belong on a line, which is what PartyPropertyEditor sets inline
   for the same reason — stated here instead, since this cell has a class of its own. */
.pwt-cell.wpc {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
}

/* ============================================================================
   Details values. The button beside each one is an XAF Action placed by the
   layout, so nothing here draws it — this only has to make the value read as a
   value rather than as an empty input.
   ========================================================================== */

.wfa {
    display: flex;
    align-items: center;
    min-height: 26px;
    width: 100%;
}

.wfa-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: #212934;
}

.wfa-empty {
    font-size: 13px;
    color: #98a1ae;
    font-style: italic;
}

/* Glyph and title on one line, the title taking whatever is left. */
.wtc {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.wtc-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #101a33;
}
