/* DOK-832 — the attachment review progress bar, and the per-attachment review panel.
 *
 * Global rather than scoped (.razor.css): a scoped stylesheet never reaches inside a MudBlazor root,
 * and the review panel lives inside DokAttachmentsSection's MudTable row. Global is also what the two
 * call sites need — the same bar is drawn in the dossier screen and in a listing table cell.
 *
 * Colours come from --mud-palette-* only. No --dok-* token is invented here: an undeclared custom
 * property discards the whole declaration, so a typo would silently erase a rule rather than fail.
 */

/* ---------------------------------------------------------------------------------------------- */
/* Review progress bar                                                                              */
/* ---------------------------------------------------------------------------------------------- */

/* DEV-65 — no max-width here. On the dossier screen (Documents and Approval steps) the bar sits in a column
 * under the completeness panel, and it spans the row as that panel does; at 13rem it read as a stray chip
 * beside a full-width card. The compact variant below keeps its own cap for a table cell. */
.dok-review-progress {
    display: grid;
    gap: .35rem;
    min-width: 9.5rem;
    padding: .55rem .65rem;
    border: 1px dashed rgba(var(--mud-palette-secondary-rgb), .38);
    border-radius: 8px;
    background: rgba(var(--mud-palette-secondary-rgb), .06);
}

/* The listing cell is tight, and the bar sits UNDER the SLA bar in the same cell — the margin is what
 * keeps the two from reading as one control. */
.dok-review-progress--compact {
    min-width: 8.5rem;
    max-width: 11rem;
    margin-top: .4rem;
    padding: .45rem .55rem;
    gap: .3rem;
}

.dok-review-progress__head {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: var(--mud-palette-secondary);
    font-size: .78rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.dok-review-progress--compact .dok-review-progress__head {
    font-size: .72rem;
}

.dok-review-progress__label {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pushed right so the number lands in the same place on every row. */
.dok-review-progress__percent {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

/* DOK-2196 — the track is DokProgressBar's (dok-theme.css), in the secondary tone, the success tone once every file is
 * decided and the muted tone on a closed dossier. The segmented texture that told this bar apart from the SLA bar went
 * with the SLA bar (DOK-1139 took it out of the listing, DOK-2196 out of every other line): what sets this bar apart
 * from the completeness panel beside it is its colour, its icon and its words. */

.dok-review-progress__detail {
    color: var(--mud-palette-text-secondary);
    font-size: .68rem;
    font-weight: 780;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.dok-review-progress--complete {
    border-style: solid;
    border-color: rgba(var(--mud-palette-success-rgb), .34);
    background: rgba(var(--mud-palette-success-rgb), .09);
}

.dok-review-progress--complete .dok-review-progress__head {
    color: var(--dok-tone-success-ink);
}

/* Nothing to review: muted, so it reads as "not applicable" rather than "0% done". */
.dok-review-progress--empty {
    border-color: rgba(148, 163, 184, .28);
    background: rgba(148, 163, 184, .07);
}

.dok-review-progress--empty .dok-review-progress__head {
    color: var(--mud-palette-text-secondary);
}

/* DGI-2 — files exist but nobody has decided on any of them: muted like --empty, because reviewing
 * files is not a mandatory step and an in-progress colour on an untouched bar says it is. The track
 * keeps its neutral background (the fill is 0% wide, so nothing of the secondary colour shows) and the
 * percentage stays on screen; only the claim that somebody owes this work is withdrawn. The first
 * verdict moves the bar to --partial and every DOK-832 behaviour resumes unchanged. */
.dok-review-progress--not-started {
    border-color: rgba(148, 163, 184, .28);
    background: rgba(148, 163, 184, .07);
}

.dok-review-progress--not-started .dok-review-progress__head {
    color: var(--mud-palette-text-secondary);
}

/* DOK-903 — the dossier is closed, so this is a record and not a status. Muted like --not-started and
 * for a stronger version of the same reason: there, the obligation was optional; here it is impossible.
 * A closed dossier used to draw "0% — Not started" in the not-started tone with no actions and no
 * explanation, and a DEV test read that as the review feature being broken.
 *
 * The fill keeps its width, because what was reviewed before closing is worth seeing; what it loses is
 * the colour that reads as "in progress". Deliberately NOT display:none — DOK-832 asks for the bar on
 * every dossier, and hiding it would answer "why can I not decide?" by removing the question. */
.dok-review-progress--closed {
    border-color: rgba(148, 163, 184, .28);
    background: rgba(148, 163, 184, .07);
}

.dok-review-progress--closed .dok-review-progress__head,
.dok-review-progress--closed .dok-review-progress__detail {
    color: var(--mud-palette-text-secondary);
}

/* ---------------------------------------------------------------------------------------------- */
/* Per-attachment review panel (sits above the attachment's dynamic fields)                         */
/* ---------------------------------------------------------------------------------------------- */

.case-file-review {
    display: grid;
    gap: .5rem;
    margin-bottom: .85rem;
    padding: .6rem .75rem;
    border: 1px solid rgba(148, 163, 184, .22);
    border-left-width: 3px;
    border-radius: 8px;
    background: rgba(248, 250, 252, .6);
}

.case-file-review__state {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
    font-size: .8rem;
    font-weight: 800;
    line-height: 1.2;
}

.case-file-review__by {
    color: var(--mud-palette-text-secondary);
    font-size: .72rem;
    font-weight: var(--dok-font-weight-bold);
}

.case-file-review__reason {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    padding: .4rem .5rem;
    border-radius: 6px;
    background: rgba(var(--mud-palette-error-rgb), .08);
    color: var(--mud-palette-text-primary);
    font-size: .76rem;
    line-height: 1.35;
    white-space: pre-wrap;
}

.case-file-review__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.case-file-review__reason-editor {
    display: grid;
    gap: .45rem;
}

/* DOK-1465 — what the Genius made of the file, inside the verdict panel: a suggestion, so it is set apart from the
 * verdict by a dashed rule and a quieter weight, and only a reading that asks for a look is coloured. DOK-1466 draws
 * the validity it read under a Document's own date with the same look: one face for what the Genius suggests. */
.case-file-ai {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .35rem .5rem;
    border: 1px dashed rgba(148, 163, 184, .45);
    border-radius: 6px;
    color: var(--mud-palette-text-secondary);
    font-size: .76rem;
    line-height: 1.35;
}

.case-file-ai__text {
    flex: 1 1 14rem;
}

.case-file-ai__accept {
    flex: 0 0 auto;
}

.case-file-ai--attention {
    border-color: rgba(var(--mud-palette-warning-rgb), .55);
    background: rgba(var(--mud-palette-warning-rgb), .07);
    color: var(--dok-tone-warning-ink);
}

.case-file-ai--pending .mud-icon-root {
    color: var(--mud-palette-text-secondary);
}

/* ---------------------------------------------------------------------------------------------- */
/* Row-level verdict chip in the attachment table (visible without expanding the row)               */
/* ---------------------------------------------------------------------------------------------- */

/* DOK-1515 — the verdict is DokStatusPill, in the canonical chips' pill: outstanding work in the warning tone, the two
 * settled verdicts in theirs. Its own .dok-file-manager__review went with it. */

/* Unreviewed is the state the reviewer has to find in a long list, so it is the one that is marked
 * rather than the one that is plain — the issue asks that pending files be "facilmente identificáveis". */
.case-file-review--pending {
    border-left-color: var(--mud-palette-warning);
    background: rgba(var(--mud-palette-warning-rgb), .07);
}

.case-file-review--pending .case-file-review__state {
    color: var(--dok-tone-warning-ink);
}

.case-file-review--approved {
    border-left-color: var(--mud-palette-success);
    background: rgba(var(--mud-palette-success-rgb), .07);
}

.case-file-review--approved .case-file-review__state {
    color: var(--dok-tone-success-ink);
}

.case-file-review--rejected {
    border-left-color: var(--mud-palette-error);
    background: rgba(var(--mud-palette-error-rgb), .07);
}

.case-file-review--rejected .case-file-review__state {
    color: var(--mud-palette-error);
}
