/* Lozenges, issue type / priority icons, keys, avatars and status badges
   (render helpers in the shared JS: loz(), typeIcon(), priIcon(), avatar() …). */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: var(--fs-2xs);
    font-weight: 700;
    white-space: nowrap;
}

.status-badge.inprog {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.done {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.todo {
    background: var(--canvas);
    color: var(--muted-ink);
}

.status-badge.hold {
    background: #e2e870;
    color: #92400e;
}

.loz {
    display: inline-block;
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 16px;
    border-radius: 4px;
    padding: 1px 7px;
    text-transform: uppercase;
    white-space: nowrap;
}

.lz-todo {
    background: var(--line);
    color: var(--ink-3);
}

.lz-prog {
    background: var(--primary-soft);
    color: var(--primary-hover);
}

.lz-rev {
    background: var(--orange-soft);
    color: var(--orange-ink);
}

.lz-done {
    background: var(--success-soft);
    color: var(--success-ink);
}

.lz-red {
    background: var(--danger-soft);
    color: var(--danger-ink);
}

.lz-amber {
    background: var(--warning-line);
    color: var(--warning-ink);
}

.lz-plum {
    background: var(--plum-soft);
    color: var(--plum-ink);
}

.typeic {
    display: inline-flex;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    color: #fff;
    font-size: var(--fs-2xs);
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ty-story {
    background: var(--success);
}

.ty-task {
    background: #2684FF;
}

.ty-bug {
    background: #E5493A;
}

/* Other work: a meeting, a round of testing, a call, or an activity named by hand. */
.ty-meeting {
    background: var(--plum);
}

.ty-testing {
    background: #0891B2;
}

.ty-call {
    background: var(--warning);
}

.ty-other {
    background: var(--muted-ink);
}

.pri {
    font-weight: 700;
    font-size: var(--fs-sm);
    width: 16px;
    display: inline-block;
    text-align: center;
}

.pri-highest {
    color: #CD1317;
}

.pri-high {
    color: #E9494A;
}

.pri-medium {
    color: #E97F33;
}

.pri-low {
    color: #2D8738;
}

.pts {
    background: var(--surface-3);
    color: var(--ink-3);
    border-radius: var(--r-pill);
    padding: 1px 8px;
    font-size: var(--fs-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.key {
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 500;
    white-space: nowrap;
}

.key.struck {
    text-decoration: line-through;
}

.av {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    font-size: var(--fs-2xs);
    font-weight: 700;
    flex-shrink: 0;
}

.epic-tag {
    background: var(--plum-soft);
    color: var(--plum-ink);
    border-radius: 4px;
    padding: 1px 7px;
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    font-weight: 600;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background: #fce7f3;
    color: #9d174d;
}

/* Labelled fact chips (factChip() in common/render.js): due date, completed, and the like. */
.fact-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 2px 10px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.fact-chip__k {
    font-weight: 500;
    color: var(--muted-ink);
}

.fact-chip--ok {
    background: var(--success-soft);
    border-color: var(--success-line);
    color: var(--success-ink);
}

.fact-chip--ok .fact-chip__k {
    color: var(--success-ink);
    opacity: .75;
}

.fact-chip--soon {
    background: var(--warning-soft);
    border-color: var(--warning-line);
    color: var(--warning-ink);
}

.fact-chip--late {
    background: var(--danger-soft);
    border-color: var(--danger-line);
    color: var(--danger-ink);
}

.fact-chip--late .fact-chip__k,
.fact-chip--soon .fact-chip__k {
    color: inherit;
    opacity: .75;
}

.fact-chip--info {
    background: var(--info-soft);
    border-color: var(--info-soft);
    color: var(--info-ink);
}

.fact-chip--none {
    background: transparent;
    border-style: dashed;
    color: var(--faint-ink);
}

/* The remark on a send-back or reopen (reworkRemark() in common/render.js): a quoted note under the line that
   says it was sent back. Used on the worksheet banner, the issue drawer, and the review cards. */
.rw-remark {
    margin: 8px 0 0;
    padding: 8px 12px;
    border-inline-start: 3px solid currentColor;
    border-radius: 0 var(--r-md) var(--r-md) 0;
    background: rgba(255, 255, 255, .7);
    color: var(--ink);
    font-size: var(--fs-md);
    font-weight: 400;
    line-height: var(--lh-normal);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.rw-remark__k {
    display: block;
    margin-bottom: 2px;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--muted-ink);
}

.log .rw-remark {
    margin-top: 4px;
    font-size: var(--fs-sm);
}

/* The confirmation that asks for the remark. */
.rw-swal .swal2-textarea {
    min-height: 120px;
    font-size: var(--fs-md);
    line-height: 1.5;
    text-align: start;
}

.rw-swal .swal2-input-label {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--ink-2);
}

/* A send-back made before remarks were asked for. */
.rw-remark--none {
    background: transparent;
    border-inline-start-style: dashed;
    color: var(--muted-ink);
    font-size: var(--fs-sm);
    font-style: italic;
}

.rw-remark--none .btn {
    margin-inline-start: var(--sp-2);
    font-style: normal;
}

/* ── the "sent back" banner (reworkBanner() in common/render.js) ─────────────
   A header — what happened, the cause, the details — and the remark in a block of its own beneath it. */
.rw-banner {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border: 1px solid;
    border-radius: var(--r-lg);
    font-size: var(--fs-md);
    line-height: var(--lh-normal);
}

.rw-banner--defect {
    background: var(--danger-soft);
    border-color: var(--danger-line);
    color: #7A271A;
}

.rw-banner--client {
    background: var(--info-soft);
    border-color: #B2DDFF;
    color: #194185;
}

.rw-banner__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px var(--sp-3);
}

.rw-banner__ico {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .75);
    font-size: var(--fs-md);
    font-weight: 700;
}

.rw-banner__title {
    font-size: var(--fs-lg);
    font-weight: 700;
}

.rw-banner__cause {
    padding: 2px 10px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .75);
    font-size: var(--fs-xs);
    font-weight: 700;
    white-space: nowrap;
}

.rw-banner__meta {
    flex-basis: 100%;
    padding-inline-start: 38px;
    font-size: var(--fs-sm);
    opacity: .85;
}

.rw-banner .rw-remark {
    margin: 0;
    padding: var(--sp-3) var(--sp-4);
    border-inline-start-width: 4px;
    background: #fff;
    box-shadow: var(--shadow-xs);
}

.rw-banner .rw-remark--none {
    background: transparent;
    box-shadow: none;
}

/* On a review card the banner sits between the title row and the facts. */
.ws-card > .rw-banner {
    margin: 0 0 var(--sp-3);
}
