/* Requests module: what Bootstrap and the design system do not cover. Tokens only, no raw colours. */
@layer modules {
    /* ---------- Field constructor ---------- */
    .field-list { margin: 0; padding: 0; list-style: none; }
    .field-row {
        display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
        padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border);
        background: var(--color-card);
    }
    .field-row:last-child { border-bottom: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
    /*
     * the row a link points at, and the place the dragged row will drop into (SortableJS's ghost): the
     * selected-row colour, with the readable shades .on-row-selected (app.css) gives a box, since a state has no class
     */
    .field-row:target, .field-row.is-dragging {
        background: var(--color-row-selected);
        --color-muted: var(--color-row-selected-muted); --bs-secondary-color: var(--color-row-selected-muted);
        --color-link: var(--color-row-selected-link);
        --bs-link-color-rgb: var(--color-row-selected-link-rgb); --bs-link-hover-color-rgb: var(--color-row-selected-link-rgb);
    }
    .field-row.is-dragging { position: relative; z-index: 2; box-shadow: var(--shadow-md); }
    .field-row__grip { display: grid; place-items: center; width: 28px; height: 36px; color: var(--color-muted); cursor: grab; touch-action: none; border-radius: var(--radius-sm); }
    .field-row__grip:hover { background: var(--color-hover-tint); color: var(--color-text); }
    .field-row__main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
    .field-row__title { color: var(--color-text); font-weight: 650; overflow-wrap: anywhere; }
    .field-row__meta { display: flex; flex-wrap: wrap; gap: 6px; }
    .field-row__rights { font-size: var(--text-xs); color: var(--color-muted); }
    .field-row__actions { display: flex; align-items: center; gap: 2px; }
    @media (max-width: 639px) {
        .field-row { grid-template-columns: auto minmax(0, 1fr); padding: var(--space-3); }
        .field-row__actions { grid-column: 2; }
    }

    .rights-table__role { width: 110px; }

    .options-block { padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg); }
    .options-block legend { padding: 0 var(--space-2); }
    .options-block__text { min-height: 140px; }

    /* ---------- Request forms ---------- */
    .request-title .badge { font-size: var(--text-sm); height: 26px; }
    .request-fields textarea.form-control { min-height: 110px; }
    .field__lock { vertical-align: -2px; }

    /* a picked file's button fills the field's height, as the CRM's padding is larger than Bootstrap's */
    .form-control[type="file"]::file-selector-button { padding: 8px 12px; margin: -8px 12px -8px -12px; }

    /* ---------- Bulk deletion ---------- */
    @media (min-width: 576px) { .bulk-filter__type { width: 220px; } }
    .bulk-table__check { width: 44px; }
    .bulk-table__client { max-width: 320px; }
    .bulk-table .badge { max-width: 220px; }

    /* ---------- Public pages (request form, status) ---------- */
    .public-card h1 { font-size: var(--text-2xl); }
    .public-footer { margin-top: var(--space-4); text-align: center; }
    .public-footer a { display: inline-flex; align-items: center; gap: 6px; }
    .public-done { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; }
    .public-done__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--color-success-soft); color: var(--color-success); }
    /* the status is what the customer came for: a long one wraps instead of being cut */
    .status-result__badge { height: auto; min-height: 26px; padding-block: 3px; border-radius: 13px; font-size: var(--text-sm); white-space: normal; overflow-wrap: anywhere; }
    .status-result__badge::before { flex-shrink: 0; }
    .status-digits { max-width: 140px; letter-spacing: .2em; font-variant-numeric: tabular-nums; }

    /* ---------- Registry ---------- */
    /* the card fills its grid card: sized to its content, every card had its own width and so its own label column */
    .request-card { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; min-width: 0; }
    .request-card__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-width: 0; }
    .request-card__number { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
    .request-card__token { font-weight: 700; font-size: var(--text-lg); color: var(--color-text); }
    .request-card__top .badge { max-width: 60%; }
    .request-card__lines { display: flex; flex-direction: column; gap: 4px; margin: 0; }
    .request-card__line { display: grid; grid-template-columns: minmax(90px, 36%) minmax(0, 1fr); gap: var(--space-2); font-size: var(--text-sm); }
    .request-card__line dt { color: var(--color-muted); overflow-wrap: anywhere; }
    .request-card__line dd { margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
    .request-card__date { font-size: var(--text-xs); color: var(--color-muted); font-variant-numeric: tabular-nums; }
}
