/* ============================================================
   Rise — application-specific overrides

   Selektory specyficzne dla domeny Rise (zlecenia, podzlecenia,
   ekrany auth, Quick Actions trigger, Lato Light wordmark).
   Cały reszta design system Rise (tokeny --brand-*/--ink-*/--status-*,
   komponenty .r-*, modale, toasty) żyje w bibliotece
   Standalone/Codli.Design i jest ładowana przez
   _content/Codli.Design/css/codli-design.css w index.html.

   Ten plik definiuje:
   - .rise-qa     — override <QuickActionMenu> (granatowy trigger)
   - .rise-card-* — karty zleceń + wariant podzlecenia z accent rail
   - .rise-row, .rise-pin, .rise-sub-* — utility kart zleceń
   - .auth-*      — shell ekranów logowania/rejestracji/odzyskiwania
   - .rise-wordmark — Lato Light dla nazwy "Rise" (branding invariant)

   v0.4 (2026-05-07): wciągnięte z Codli.Design extras.css:
   - .request-actions, request-details-modal (.r-meta-*, .r-detail-*)
   - .r-table* — tabela zleceń z hierarchią parent/child
   - chipy filtrów statusów + .r-filter-*
   - .r-dashboard-* + selektor wariantów Classic/Kanban/Focus
   - .r-history-* — chat bubbles + event rows historii statusów
   - .request-details-meta-person, .r-table-title-link, .r-details-footer-*
   - .r-compound-* — karta podzlecenia w modalu
   - .r-spec-toggle-* — lista specjalizacji w EditUserModal (Admin)
   - .r-mcp-* — MCP agent switcher (integracje)
   ============================================================ */

/* ============================================================
   QUICK ACTIONS PANEL — wariant Rise dla <QuickActionMenu Class="rise-qa">.
   Mockup: drawer wysuwany z prawej krawędzi, biały panel 320px,
   granatowy trigger 36×56 z błyskawicą, sekcje mono-uppercase,
   akcje z chip-ikoną 28×28, footer ze skrótem klawiszowym.
   ============================================================ */
.rise-qa {
    --blazing-qa-panel-width: 320px;
    --blazing-qa-trigger-width: 36px;
}

.rise-qa .blazing-qa-trigger {
    background: var(--brand-700);
    color: white;
    border-radius: 10px 0 0 10px;
    box-shadow: 0 6px 20px rgba(26, 35, 126, 0.35),
                inset 1px 0 0 rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: right 300ms cubic-bezier(0.32, 0.72, 0.24, 1),
                background var(--d-fast),
                box-shadow var(--d-fast);
}

.rise-qa .blazing-qa-trigger:hover {
    background: var(--brand-600);
    box-shadow: 0 6px 24px rgba(26, 35, 126, 0.45),
                inset 1px 0 0 rgba(255, 255, 255, 0.1);
}

.rise-qa .blazing-qa-trigger:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus-ring),
                0 6px 20px rgba(26, 35, 126, 0.35);
}

.rise-qa .blazing-qa-trigger svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    /* "zap" path leans left in its viewBox — nudge 1px to optically center it */
    transform: translateX(1px);
}

.rise-qa .blazing-qa-panel {
    background: var(--bg-surface);
    border-left: 1px solid var(--border-subtle);
    box-shadow: -12px 0 32px rgba(7, 9, 37, 0.08);
    color: var(--text-primary);
}

/* Header */
.r-qa-header {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
}

.r-qa-header-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    background: var(--brand-700);
    color: #fff;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.r-qa-header-icon svg { width: 14px; height: 14px; stroke-width: 2; }

.r-qa-header-text { flex: 1; min-width: 0; }

.r-qa-header-title {
    font-size: var(--t-body);
    font-weight: 600;
    letter-spacing: var(--tracking-snug);
    color: var(--text-primary);
}

.r-qa-header-context {
    margin-top: 2px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.r-qa-header-context-detail {
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-sans);
}

.r-qa-header-close {
    margin-top: -2px;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    border: 0;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background var(--d-fast), color var(--d-fast);
}

.r-qa-header-close:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.r-qa-header-close svg { width: 14px; height: 14px; }

/* Body */
.rise-qa .blazing-qa-panel-body { padding: 4px 0 12px; }

/* Section header */
.r-qa-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 8px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.r-qa-section-header-count { color: var(--ink-400); }

/* Action row (button) */
.r-qa-action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: 10px 18px;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    transition: background var(--d-fast);
    font-family: inherit;
}

.r-qa-action:hover { background: var(--bg-muted); }
.r-qa-action:focus-visible { outline: none; background: var(--bg-muted); box-shadow: inset 3px 0 0 var(--brand-500); }

.r-qa-action.is-danger { color: var(--status-rejected-fg); }

.r-qa-action-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--bg-muted);
    color: var(--brand-700);
}

.r-qa-action-icon svg { width: 14px; height: 14px; stroke-width: 2; }

.r-qa-action.is-primary .r-qa-action-icon {
    background: var(--brand-700);
    color: #fff;
}

.r-qa-action.is-danger .r-qa-action-icon {
    background: var(--status-rejected-bg);
    color: var(--status-rejected-fg);
}

.r-qa-action-body { flex: 1; min-width: 0; }

.r-qa-action-label {
    display: block;
    font-size: var(--t-small);
    font-weight: 500;
    line-height: 1.3;
}

.r-qa-action-hint {
    display: block;
    margin-top: 1px;
    font-size: var(--t-micro);
    color: var(--text-tertiary);
}

.r-qa-action .r-kbd { flex-shrink: 0; }

/* Toggle row */
.r-qa-toggle-row {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: 8px 18px;
}

.r-qa-toggle-row.is-child { padding-left: 36px; }

.r-qa-toggle-row-text { flex: 1; min-width: 0; }

.r-qa-toggle-row-label {
    display: block;
    font-size: var(--t-small);
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.r-qa-toggle-row-hint {
    display: block;
    margin-top: 1px;
    font-size: var(--t-micro);
    color: var(--text-tertiary);
}

/* Filter pills container */
.r-qa-pills {
    padding: 4px 18px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.r-qa-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--r-pill);
    border: 1px solid var(--border-subtle);
    background: #fff;
    color: var(--text-secondary);
    font-size: var(--t-caption);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--d-fast), border-color var(--d-fast), color var(--d-fast);
    font-family: inherit;
}

.r-qa-pill:hover { border-color: var(--border-default); }

.r-qa-pill.is-on {
    border-color: var(--brand-300);
    background: var(--brand-50);
    color: var(--brand-700);
}

.r-qa-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--ink-300);
    flex-shrink: 0;
}

.r-qa-pill.is-on .r-qa-pill-dot { background: var(--brand-500); }

/* Separator */
.r-qa-separator {
    height: 1px;
    background: var(--border-subtle);
    margin: 8px 0;
    border: 0;
}

/* Footer */
.r-qa-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-muted);
    font-size: var(--t-micro);
    color: var(--text-tertiary);
}

.r-qa-footer-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.r-qa-footer-shortcut > span:last-child { margin-left: 4px; }

.r-qa-footer-context { font-family: var(--font-mono); }

/* ============================================================
   KARTA ZLECENIA — kluczowy komponent
   ============================================================ */
.rise-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--d-fast), box-shadow var(--d-fast), transform var(--d-fast);
    display: flex;
    flex-direction: column;
}
.rise-card:hover { border-color: var(--brand-300); box-shadow: var(--shadow-md); }
.rise-card.is-pinned {
    border-color: var(--brand-200);
    box-shadow: 0 0 0 1px var(--brand-100), var(--shadow-xs);
}

.rise-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    gap: 8px;
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border-subtle);
    min-width: 0;
}
.rise-card-cat {
    font-size: var(--t-caption);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: var(--tracking-snug);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.rise-row { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.rise-pin { color: var(--brand-600); display: grid; place-items: center; }

.rise-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    /* Bez min-width: 0 dziecko (.rise-sub-meta-row) z długim tekstem
       potrafi rozepchać body poza szerokość karty (overflow: hidden tylko
       przycina wizualnie — meta-row idzie poza prawą krawędź). */
    min-width: 0;
}
.rise-card-title {
    font-size: var(--t-body);
    font-weight: 600;
    line-height: var(--lh-snug);
    color: var(--text-primary);
    letter-spacing: var(--tracking-snug);
}
.rise-card-desc {
    margin: 0;
    font-size: var(--t-small);
    color: var(--text-secondary);
    line-height: var(--lh-normal);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rise-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    min-width: 0;
}
.rise-card-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--t-micro);
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Stopka akcji wewnątrz karty zlecenia (RequestActionButtons) */
.rise-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px solid var(--border-subtle);
}

/* Wariant podzlecenia */
.rise-card-sub {
    display: flex;
    flex-direction: row;
    padding-left: 0;
}
.rise-card-sub .rise-sub-rail {
    width: 4px;
    background: linear-gradient(180deg, var(--brand-400), var(--brand-700));
    flex-shrink: 0;
}
.rise-card-sub .rise-card-body { padding: 12px 14px; }
.rise-sub-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    min-width: 0;
}
/* Pin button wrapper — nie kurczy się i nie nakłada na meta-text. */
.rise-sub-meta-row > .r-row {
    flex-shrink: 0;
}

.rise-sub-meta {
    /* display: flex (nie inline-flex) — z flex-basis: 0 pozwala na poprawne
       skracanie szerokości w wąskich kartach (inline-flex+auto basis nie
       skracał poniżej max-content nawet z min-width: 0). */
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--t-micro);
    color: var(--brand-700);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}
/* SVG i tekst "PODZLECENIE" nie kurczą się — tylko parent-title (ellipsis). */
.rise-sub-meta > svg,
.rise-sub-meta > span:not(.rise-sub-parent) { flex-shrink: 0; }
.rise-sub-sep { color: var(--ink-300); flex-shrink: 0; }
.rise-sub-parent {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
/* ============================================================
   AUTH SHELL — Login / Register / ForgotPassword / ResetPassword
   Wzór: Codli Design (codli-docs-login.jsx).
   Desktop: dwie kolumny — brand (themed solid + dot pattern) | form.
   Mobile: jedna kolumna — gradient bg + hero + biała karta formularza.
   ============================================================ */
.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    width: 100%;
    min-height: 100vh;
    background: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-sans);
}

/* ── Lewy panel (brand) ── */
.auth-brand {
    position: relative;
    overflow: hidden;
    background: var(--brand-700);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 40px 48px;
}
.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 20px 20px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 60%, black 0%, transparent 75%);
            mask-image: radial-gradient(ellipse at 30% 60%, black 0%, transparent 75%);
    pointer-events: none;
}
.auth-brand::after {
    content: '';
    position: absolute;
    top: -160px;
    right: -160px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }

.auth-brand-top {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.auth-brand-chip {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: rgba(255,255,255,0.95);
    color: var(--brand-700);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: -0.04em;
    font-family: var(--font-sans);
}

.auth-brand-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    animation: auth-brand-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.auth-brand-logo {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    animation: auth-brand-breathe 7s ease-in-out 1.2s infinite;
    will-change: transform;
}
.auth-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.auth-brand-name {
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 32px 0 16px;
    text-wrap: balance;
}

@keyframes auth-brand-enter {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes auth-brand-breathe {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
    .auth-brand-center,
    .auth-brand-logo { animation: none; }
}
.auth-brand-tagline {
    font-size: 16px;
    color: rgba(255,255,255,0.72);
    line-height: 1.5;
    margin: 0;
    max-width: 360px;
}

.auth-brand-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.auth-brand-foot-dot {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
}
.auth-brand-status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.auth-brand-status-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.18);
}

/* ── Prawy panel (formularz) ── */
.auth-form {
    position: relative;
    display: flex;
    flex-direction: column;
}
.auth-form-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 48px;
}
.auth-form-eyebrow {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.auth-form-eyebrow strong {
    color: var(--brand-700);
    font-weight: 500;
}

.auth-form-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 48px 48px;
    max-width: 460px;
    margin: 0 auto;
    width: 100%;
}
.auth-form-mobile-hero { display: none; }
.auth-form-mobile-foot { display: none; }
.auth-form-title {
    font-size: 36px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.auth-form-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 32px;
}
.auth-form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-form-fields .r-field { gap: 6px; }
.auth-form-fields .r-input {
    width: 100%;
}
.auth-form-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.auth-form .r-btn-primary {
    width: 100%;
    height: 48px;
    margin-top: 8px;
}
.auth-form-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
    color: var(--text-tertiary);
    font-size: 11px;
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.auth-form-divider::before,
.auth-form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}
.auth-form-sso {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.auth-form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    margin-top: 2px;
}
.auth-form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-700);
}

.auth-form-link {
    font-size: 12px;
    color: var(--brand-700);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}
.auth-form-link:hover { text-decoration: underline; }

.auth-form-bottom {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-tertiary);
    gap: var(--s-3);
    flex-wrap: wrap;
}
.auth-form-bottom a,
.auth-form-bottom .auth-form-link {
    color: var(--brand-700);
    font-weight: 500;
    text-decoration: none;
}
.auth-form-bottom-domain {
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
}

/* Lang switcher (PL / EN) — fixed top-right.
   Desktop: tone "on-light" (osadzony nad białym formularzem).
   Mobile: tone "on-dark" (na gradiencie). */
.auth-lang {
    position: fixed;
    top: 24px;
    right: 28px;
    z-index: 50;
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--bg-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-xs);
}
.auth-lang-btn {
    border: 0;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    font-family: var(--font-mono);
}
.auth-lang-btn.is-active {
    background: var(--bg-surface);
    color: var(--brand-700);
    box-shadow: var(--shadow-xs);
}
@media (max-width: 960px) {
    .auth-lang {
        top: 18px;
        right: 18px;
        background: rgba(255,255,255,0.1);
        border-color: rgba(255,255,255,0.18);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: none;
    }
    .auth-lang-btn { color: rgba(255,255,255,0.7); }
    .auth-lang-btn.is-active {
        background: rgba(255,255,255,0.95);
        color: var(--brand-700);
    }
}

.auth-form-back {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
}
.auth-form-back a {
    color: var(--brand-700);
    font-weight: 500;
    text-decoration: none;
}
.auth-form-back a:hover { text-decoration: underline; }

.auth-alert {
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    font-size: var(--t-small);
    margin-bottom: var(--s-3);
}
.auth-alert-error {
    background: var(--status-rejected-bg);
    color: var(--status-rejected-fg);
}
.auth-alert-success {
    background: var(--status-done-bg);
    color: var(--status-done-fg);
}

/* Wordmark "Rise" — zawsze Lato Light, niezależnie od kontekstu (sidebar, splash, ekrany auth). */
.rise-wordmark {
    font-family: 'Lato', var(--font-sans), sans-serif !important;
    font-weight: 300 !important;
    letter-spacing: 0.01em;
}
/* ==========================================================================
   PHASE M3 — Auth screens + form modals
   ========================================================================== */

/* M3.1 — Auth screens phone/tablet.
   Brand "kapuza" na górze (themed solid + dot pattern + accent glow),
   biały formularz pod nią. Wzór: codli-docs-login.jsx::ScreenCodliLoginMobile. */
@media (max-width: 960px) {
    .auth-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        background: var(--bg-app);
        color: var(--text-primary);
        min-height: 100vh;
    }

    .auth-brand {
        padding: 20px 24px 22px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .auth-brand::before {
        background-size: 18px 18px;
        -webkit-mask-image: radial-gradient(ellipse at 30% 100%, black 0%, transparent 75%);
                mask-image: radial-gradient(ellipse at 30% 100%, black 0%, transparent 75%);
    }
    .auth-brand::after {
        top: -120px;
        right: -120px;
        width: 280px;
        height: 280px;
    }
    .auth-brand-center {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    .auth-brand-logo {
        width: 36px;
        height: 36px;
    }
    .auth-brand-logo img { width: 100%; height: 100%; }
    .auth-brand-name {
        font-size: 22px;
        font-weight: 600;
        letter-spacing: -0.02em;
        margin: 0;
    }

    .auth-form {
        background: var(--bg-app);
    }
    .auth-form-top { display: none; }
    .auth-form-inner {
        max-width: 100%;
        margin: 0;
        padding: 28px 24px 16px;
        gap: 16px;
    }
    .auth-form-card {
        background: transparent;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }
    .auth-form-title { font-size: 28px; line-height: 1.1; margin: 0 0 4px; }
    .auth-form-subtitle { font-size: 13px; margin: 0 0 4px; }
    .auth-form .r-btn-primary { margin-top: 4px; }

    .auth-form-mobile-foot {
        display: flex;
        justify-content: center;
        padding: 16px 0 20px;
        font-size: 11px;
        color: var(--text-tertiary);
        font-family: var(--font-mono);
        letter-spacing: 0.06em;
    }
}

@media (max-width: 480px) {
    .auth-form-title { font-size: 24px; }
}

/* ============================================================
   REQUEST ACTION BUTTONS — kontener przycisków akcji w karcie/tabeli
   ============================================================ */
.request-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* ============================================================
   REQUEST DETAILS MODAL — meta grid, hero, podzlecenia, historia
   ============================================================ */
.request-details {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}
.request-details-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
}
.request-details-title {
    font-size: var(--t-h2);
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    line-height: var(--lh-tight);
    margin: 0;
    color: var(--text-primary);
}
.request-details-desc {
    font-size: var(--t-body);
    line-height: var(--lh-relaxed);
    color: var(--text-primary);
    margin: 0;
    white-space: pre-line;
}
.request-details-parent {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3);
    background: var(--brand-50);
    border-radius: var(--r-md);
    width: fit-content;
}
.request-details-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-4);
    padding: var(--s-4);
    background: var(--bg-muted);
    border-radius: var(--r-md);
    border: 1px solid var(--border-subtle);
}
@media (max-width: 720px) {
    .request-details-meta { grid-template-columns: repeat(2, 1fr); }
}
.request-details-meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    min-width: 0;
}
.request-details-meta-value {
    font-size: var(--t-body);
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.request-details-children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--s-3);
}
.request-details-history summary {
    list-style: none;
    display: flex;
    align-items: center;
}
.request-details-history summary::-webkit-details-marker { display: none; }
.request-details-history summary::before {
    content: '▸';
    margin-right: var(--s-2);
    color: var(--text-tertiary);
    transition: transform var(--d-fast);
    display: inline-block;
}
.request-details-history[open] summary::before {
    transform: rotate(90deg);
}

/* ============================================================
   TABELA ZLECEŃ (.r-table) — używana w Pages/Requests + Dashboard tables
   ============================================================ */
.r-table-wrap {
    overflow-x: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
}
.r-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--t-small);
}
.r-table thead th {
    text-align: left;
    padding: var(--s-3) var(--s-4);
    font-size: var(--t-micro);
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--text-tertiary);
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}
.r-table tbody td {
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    color: var(--text-primary);
}
.r-table tbody tr:last-child td { border-bottom: 0; }
.r-table tbody tr:hover { background: var(--bg-muted); }
.r-table tbody tr.is-subrequest > td:first-child,
.r-table tbody tr.is-subrequest > td.r-table-pin-col + td {
    padding-left: var(--s-8);
}
.r-table-pin-col { width: 36px; text-align: center; }

.r-table-title-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    min-width: 200px;
}
.r-table-hierarchy-rail {
    position: absolute;
    left: -16px; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--brand-300), var(--brand-500));
    border-radius: 999px;
}
.r-table-hierarchy-meta {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    font-size: var(--t-micro);
    color: var(--brand-700);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
}
.r-table-hierarchy-parent {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}
.r-table-title {
    font-size: var(--t-body);
    font-weight: 500;
    color: var(--text-primary);
    line-height: var(--lh-snug);
}
.r-table-deadline {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--s-2);
    border-radius: var(--r-sm);
    font-size: var(--t-caption);
}
.r-table-deadline.deadline-failed   { background: var(--status-rejected-bg); color: var(--status-rejected-fg); }
.r-table-deadline.deadline-succeed  { background: var(--status-done-bg); color: var(--status-done-fg); }
.r-table-deadline.deadline-warning  { background: var(--status-pending-bg); color: var(--status-pending-fg); }
.r-table-deadline.deadline-danger   { background: var(--status-rejected-bg); color: var(--status-rejected-fg); }

.r-table-actions-cell {
    text-align: right;
    white-space: nowrap;
}

.r-table-empty {
    padding: var(--s-8);
    text-align: center;
    color: var(--text-tertiary);
    margin-top: var(--s-4);
}
.r-table-empty p { margin: 0; }

/* ============================================================
   FILTR ZLECEŃ — chipy statusów + grid filtrów
   ============================================================ */
.requests-filter {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    margin-bottom: var(--s-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
}
.requests-filter-section {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}
.requests-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}
.requests-filter-chip {
    cursor: pointer;
    border: 1px solid transparent;
    background: var(--bg-muted);
    color: var(--text-secondary);
    transition: opacity var(--d-fast), box-shadow var(--d-fast);
    height: 26px;
    padding: 0 var(--s-3);
    opacity: 0.7;
}
.requests-filter-chip:hover { opacity: 1; }
.requests-filter-chip.is-active {
    opacity: 1;
    box-shadow: var(--shadow-focus-ring);
}
.requests-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--s-3);
}
.r-field { display: flex; flex-direction: column; gap: 0; }

/* Dwukolumnowy układ dat dla pierwszego ekranu (download requests) */
.requests-date-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--s-4);
}

/* ============================================================
   DASHBOARD — selektor wariantów + Classic / Kanban / Focus
   ============================================================ */
.dashboard-mode-toolbar {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-bottom: var(--s-6);
    padding: var(--s-2) var(--s-3);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    width: fit-content;
}
.dashboard-mode-toolbar .r-section-meta { margin-right: var(--s-3); }
.dashboard-mode-toolbar .r-btn.is-active { box-shadow: var(--shadow-xs); }

/* Dashboard mode picker (Personalisation page) */
.dashboard-mode-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-3);
}
@media (max-width: 720px) {
    .dashboard-mode-picker { grid-template-columns: 1fr; }
}
.dashboard-mode-tile {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    padding: var(--s-4);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    cursor: pointer;
    text-align: left;
    transition: border-color var(--d-fast), box-shadow var(--d-fast);
    font-family: inherit;
    color: var(--text-primary);
}
.dashboard-mode-tile:hover { border-color: var(--brand-300); }
.dashboard-mode-tile.is-active {
    border-color: var(--brand-700);
    box-shadow: var(--shadow-focus-ring);
}
.dashboard-mode-tile-preview {
    background: var(--bg-muted);
    border-radius: var(--r-sm);
    color: var(--brand-600);
    aspect-ratio: 80 / 56;
}
.dashboard-mode-tile-preview svg {
    display: block;
    width: 100%;
    height: 100%;
}
.dashboard-mode-tile-name {
    font-weight: 600;
    font-size: var(--t-body);
    color: var(--text-primary);
}

/* Stat cards (Classic) */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--s-3);
    margin-bottom: var(--s-8);
}
/* Stat-cards responsive breakpoints aligned with mobile system (640/1024).
   Phone (≤640) → 2-col, tablet (641–1023) → 3-col, desktop (≥1024) → 5-col. */
@media (max-width: 1023px) {
    .dashboard-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}

.dashboard-stat-card {
    position: relative;
    overflow: hidden;
    padding: var(--s-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}
.dashboard-stat-rail {
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--stat-solid, var(--brand-500));
}
.dashboard-stat-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-2);
}
/* Pozwól długim labelom statusu (np. "Oczekiwanie na akceptację") zawijać
   się w dwie linie zamiast wychodzić poza kartę. Badge globalnie ma
   flex-shrink: 0; w stat-card musimy mu pozwolić się zmieścić, żeby nie
   wypchnął ikony poza krawędź karty. */
.dashboard-stat-card .r-badge {
    white-space: normal;
    height: auto;
    min-height: 22px;
    padding: 4px var(--s-2);
    line-height: 1.15;
    text-align: left;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}
.dashboard-stat-icon { color: var(--stat-solid, var(--brand-500)); display: flex; flex-shrink: 0; }
.dashboard-stat-count {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    line-height: 1;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Kanban */
.dashboard-kanban {
    display: grid;
    grid-template-columns: repeat(5, minmax(260px, 1fr));
    gap: var(--s-3);
    overflow-x: auto;
}
/* Make status badge in kanban header shrink so column number stays visible */
.dashboard-kanban-head .r-badge {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.dashboard-kanban-head .r-badge-text {
    overflow: hidden;
    text-overflow: ellipsis;
}
.dashboard-kanban-col {
    background: var(--bg-muted);
    border-radius: var(--r-lg);
    padding: var(--s-3);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    min-height: 240px;
    min-width: 0;
}
.dashboard-kanban-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-2);
    padding: 0 var(--s-1);
}
.dashboard-kanban-body {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}
.dashboard-kanban-empty {
    padding: var(--s-5) var(--s-3);
    text-align: center;
    color: var(--text-tertiary);
    font-size: var(--t-caption);
    background: var(--bg-surface);
    border: 1.5px dashed var(--border-default);
    border-radius: var(--r-md);
}

/* Focus */
.dashboard-focus-hero {
    background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
    color: var(--text-on-dark);
    border-radius: var(--r-xl);
    padding: var(--s-8);
    box-shadow: var(--shadow-md);
}
.dashboard-focus-hero-meta {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-bottom: var(--s-3);
}
.dashboard-focus-hero-tag {
    font-size: var(--t-micro);
    letter-spacing: var(--tracking-caps);
    color: rgba(255,255,255,0.6);
}
.dashboard-focus-hero-title {
    font-size: var(--t-h1);
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    line-height: var(--lh-tight);
    margin: 0 0 var(--s-3);
    color: var(--text-on-dark);
}
.dashboard-focus-hero-desc {
    font-size: var(--t-h4);
    color: rgba(255,255,255,0.85);
    line-height: var(--lh-normal);
    margin: 0 0 var(--s-5);
    max-width: 720px;
}
.dashboard-focus-hero-foot {
    display: flex;
    align-items: center;
    gap: var(--s-6);
    flex-wrap: wrap;
    color: rgba(255,255,255,0.85);
    font-size: var(--t-small);
}

.dashboard-focus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--s-4);
}

/* ============================================================
   HISTORIA ZMIAN ZLECENIA — Messenger-style chat bubbles + event rows.
   Autor wpisu po lewej (rise-500), zalogowany user po prawej (ink-100).
   Konsekutywne wpisy tej samej osoby grupują się — header (avatar + imię
   + rola + data) renderuje się tylko nad pierwszym dymkiem grupy.
   ============================================================ */
.r-history { display: flex; flex-direction: column; gap: var(--s-3); }

.r-chat-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}
.r-chat-row.is-right { flex-direction: row-reverse; }

/* Slot na avatar — w grupie tylko ostatni dymek "trzyma" widoczny avatar,
   pozostałe rzędy mają miejsce zarezerwowane (visibility: hidden) żeby
   bąble pozostały wyrównane. */
.r-chat-avatar-slot {
    width: 32px;
    flex-shrink: 0;
    align-self: flex-end;
}
.r-chat-avatar-slot .r-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
}
.r-chat-row.is-grouped .r-chat-avatar-slot { visibility: hidden; }

.r-chat-stack {
    display: flex;
    flex-direction: column;
    max-width: 460px;
    min-width: 0;
}
.r-chat-row.is-right .r-chat-stack { align-items: flex-end; }
.r-chat-row.is-left  .r-chat-stack { align-items: flex-start; }

.r-chat-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.r-chat-row.is-left  .r-chat-meta { padding-left: 14px; }
.r-chat-row.is-right .r-chat-meta { padding-right: 14px; }

.r-chat-meta-name {
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 500;
}

.r-chat-roletag {
    font-size: 9.5px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
    background: var(--bg-muted);
    color: var(--text-secondary);
}
.r-chat-roletag.is-author     { background: #e7e9fb; color: var(--brand-700); }
.r-chat-roletag.is-assignee   { background: #e8f0e6; color: #3d6b46; }
.r-chat-roletag.is-admin      { background: #fdf1d6; color: #8a6510; }

[data-theme="dark"] .r-chat-roletag.is-author    { background: rgba(125, 139, 217, 0.20); color: #c5cdf0; }
[data-theme="dark"] .r-chat-roletag.is-assignee  { background: rgba( 80, 160,  90, 0.20); color: #a8d4a3; }
[data-theme="dark"] .r-chat-roletag.is-admin     { background: rgba(180, 140,  30, 0.22); color: #f4d99c; }

.r-chat-bubble {
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.55;
    box-shadow: 0 1px 2px rgba(7, 9, 37, 0.08);
    word-break: break-word;
    margin-top: 2px;
}
/* Konwencja kolorów (Messenger / Teams):
   – „inni" po lewej → szary bubble (ink-100 z border-subtle, ciemny tekst)
   – „ja" po prawej → brand color (rise-500, biały tekst, bez bordera) */
.r-chat-row.is-left  .r-chat-bubble {
    background: var(--bg-muted);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 18px 18px 18px 4px;
}
.r-chat-row.is-right .r-chat-bubble {
    background: var(--brand-500);
    color: white;
    border-radius: 18px 18px 4px 18px;
}
/* W grupie consecutive bąbli — zaokrąglamy mniej po stronie autora,
   tail (4px) zostaje tylko na ostatnim dymku grupy. */
.r-chat-row.is-grouped.is-left  .r-chat-bubble { border-radius: 4px 18px 18px 4px; }
.r-chat-row.is-grouped.is-right .r-chat-bubble { border-radius: 18px 4px 4px 18px; }
.r-chat-row.is-grouped.is-last.is-left  .r-chat-bubble { border-radius: 4px 18px 18px 4px; }
.r-chat-row.is-grouped.is-last.is-right .r-chat-bubble { border-radius: 18px 4px 4px 18px; }
.r-chat-row.is-last.is-left  .r-chat-bubble { border-bottom-left-radius: 4px; }
.r-chat-row.is-last.is-right .r-chat-bubble { border-bottom-right-radius: 4px; }

.r-chat-files {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* Inline preview obrazków w dymku (Messenger-style — klikalne miniatury).
   Obraz wypełnia całą szerokość bąbla; CSS przycina wysokość, gdy zdjęcie
   jest bardzo wysokie. Bąbel z obrazkiem rozciąga się do max szerokości
   stacka (`:has()` wybiera tylko bąble z miniaturami). */
.r-chat-bubble:has(.r-chat-images) { width: 100%; }
.r-chat-images {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    width: 100%;
}
.r-chat-image-btn {
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    line-height: 0;
    width: 100%;
    max-height: 360px;
    transition: transform var(--d-fast);
}
.r-chat-image-btn:hover { transform: scale(1.02); }
.r-chat-image-btn .codli-api-picture {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: cover;
    margin: 0;
    display: block;
    border-radius: 12px;
}

/* File chip — kafelek pliku (inside bubble lub poza, np. w modalu uploadu). */
.r-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 8px;
    background: var(--bg-muted);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    max-width: 240px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background var(--d-fast);
}
.r-file-chip:hover { background: var(--ink-200); }
.r-file-chip-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
    background: #e7e9fb;
    color: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
}
[data-theme="dark"] .r-file-chip-icon { background: rgba(125, 139, 217, 0.18); }
.r-file-chip-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.r-file-chip-name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.r-file-chip-size {
    display: block;
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.r-file-chip.is-dark {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.18);
}
.r-file-chip.is-dark:hover { background: rgba(255, 255, 255, 0.28); }
.r-file-chip.is-dark .r-file-chip-icon { background: rgba(255, 255, 255, 0.16); color: white; }
.r-file-chip.is-dark .r-file-chip-name  { color: white; }
.r-file-chip.is-dark .r-file-chip-size  { color: rgba(255, 255, 255, 0.7); }

/* Event row — system-message: zmiana statusu, deadline, wykonawcy, utworzenie. */
.r-history-event {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 0;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}
.r-history-event-time {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
}
.r-history-event-dot {
    width: 3px;
    height: 3px;
    border-radius: 2px;
    background: var(--ink-200);
    flex-shrink: 0;
}
.r-history-event-actor { color: var(--text-primary); font-weight: 500; }
.r-history-event-pill {
    padding: 2px 8px;
    background: var(--bg-muted);
    border: 1px solid var(--border-subtle);
    border-radius: 5px;
    font-size: 11px;
    font-family: var(--font-mono);
}
.r-history-event-transition {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}
.r-history-event-transition .r-badge {
    font-size: 10px;
    padding: 2px 7px;
    line-height: 1.4;
}
.r-history-event-arrow {
    display: inline-flex;
    align-items: center;
    color: var(--text-tertiary);
    line-height: 1;
}
.r-history-event-arrow svg { display: block; }

/* ============================================================
   REQUEST DETAILS — meta-cell z awatarem (Zlecający / Wykonawca)
   ============================================================ */
.request-details-meta-person {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}
.request-details-meta-person .r-avatar { flex-shrink: 0; }

/* Klikalny tytuł podzlecenia w widoku tabeli (otwiera szczegóły dziecka). */
.r-table-title-link {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--text-primary);
    font: inherit;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: color var(--d-fast);
}
.r-table-title-link:hover { color: var(--brand-600); text-decoration: underline; }
.r-table-title-link:focus-visible { outline: none; box-shadow: var(--shadow-focus-ring); border-radius: 4px; }

/* Footer modala szczegółów — dwie kolumny: pomocnicze (lewa) + zmiany statusu (prawa). */
.r-details-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
}
.r-details-footer-left,
.r-details-footer-right {
    display: flex;
    gap: var(--s-2);
    flex-wrap: wrap;
    align-items: center;
}
.r-details-footer-right { margin-left: auto; }
.r-details-footer-right .codli-task-actions {
    display: flex;
    gap: var(--s-2);
    flex-wrap: wrap;
}

/* ============================================================
   COMPOUND TASK CARD — karta podzlecenia w modalu szczegółów.
   Klikalny tytuł otwiera szczegóły wybranego podzlecenia.
   ============================================================ */
.r-compound-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    padding: var(--s-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    transition: border-color var(--d-fast), box-shadow var(--d-fast);
}
.r-compound-card:hover { border-color: var(--brand-300); box-shadow: var(--shadow-sm); }

.r-compound-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-3);
}
.r-compound-head-left { min-width: 0; flex: 1; }
.r-compound-title {
    appearance: none;
    background: none;
    border: none;
    padding: 2px 0 0;
    margin: 0;
    text-align: left;
    font-size: var(--t-h5);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    cursor: pointer;
    transition: color var(--d-fast);
}
.r-compound-title:hover { color: var(--brand-600); text-decoration: underline; }
.r-compound-title:focus-visible { outline: none; box-shadow: var(--shadow-focus-ring); border-radius: 4px; }

.r-compound-spec {
    font-size: var(--t-caption);
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}
.r-compound-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: var(--t-small);
}
.r-compound-desc {
    font-size: var(--t-small);
    color: var(--text-secondary);
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Modal "Dodaj pliki" — kontener stackuje sekcje pionowo, footer ma sticky-look. */
.r-upload-modal {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.r-upload-help {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.r-upload-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   SPEC TOGGLE LIST — lista specjalizacji w EditUserModal
   ============================================================ */
.r-spec-toggle-list {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    padding: var(--s-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    background: var(--bg-surface);
}
.r-spec-toggle-row {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    cursor: pointer;
    user-select: none;
}
.r-spec-toggle-label {
    font-size: var(--t-body);
    color: var(--text-primary);
}

/* ============================================================
   MCP AGENT SWITCHER — nowy design (zastępuje legacy .mcp-agent-*)
   ============================================================ */
.r-mcp-switcher {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}
.r-mcp-switcher-header h4 { margin: 0 0 var(--s-1) 0; }
.r-mcp-switcher-header p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}
.r-mcp-config-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    flex-wrap: wrap;
}
.r-mcp-config-path {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}
.r-mcp-config-code {
    background: var(--bg-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    padding: var(--s-3) var(--s-4);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-primary);
    overflow-x: auto;
    white-space: pre;
    margin: 0;
}
.r-mcp-config-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0;
}

/* ============================================================
   HISTORIA ZMIAN ZLECENIA — legacy RequestHistoryRecord
   v0.5.x: rename z .codli-request-history-record-* na .r-history-record-*
   z tokenami theme-aware. Komponent docelowo do redesignu na chat
   bubbles z extras.css (.r-history-event-*). To jest interim styling.
   ============================================================ */
.r-history-record {
    padding: var(--s-3);
    margin-bottom: var(--s-3);
    background: var(--bg-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    transition: background var(--d-fast), border-color var(--d-fast);
}
.r-history-record-info { font-size: var(--t-body); }
.r-history-record-author { font-size: var(--t-caption); color: var(--text-secondary); }
.r-history-record-content { padding: var(--s-3) 0; }
.r-history-record-content > pre {
    font-size: var(--t-small);
    font-family: var(--font-mono);
    margin: 0;
    white-space: pre-line;
    color: var(--text-primary);
}
.r-history-pictures { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
