/*
 * Moduł Szkolenia — strona pracownika (Moje szkolenia, widżet pulpitu, odtwarzacz).
 * Motyw CERB (DESIGN.md): fiolet #9810fa, przyciski-pigułki, karty 16 px, ciemny tryb przez .dark.
 * Mobile first (projekt od 375 px), cele dotyku >= 44 px, widoczny focus, kontrast >= 4.5:1, prefers-reduced-motion.
 * Klasy z prefiksem trn-; plik nie ma globalnych selektorów, więc nie wpływa na pozostałe strony panelu.
 * Ładowany przez FilamentAsset (pakiet krokodyl/training) — wymaga `php artisan filament:assets` po wdrożeniu.
 */

.trn,
.trn-shell {
    --trn-accent: var(--primary-600, #9810fa);
    --trn-accent-hover: var(--primary-700, #7e0fda);
    --trn-accent-active: var(--primary-800, #6c0eba);
    --trn-accent-text: #fff;
    /* Akcent jako kolor TEKSTU i obrysu na jasnym tle (>= 4,5:1 na bieli); w trybie ciemnym jaśniejszy odcień. */
    --trn-accent-fg: var(--primary-600, #9810fa);
    --trn-accent-fg-hover: var(--primary-800, #6c0eba);
    --trn-soft: #f3e8ff;
    --trn-surface: #fff;
    --trn-page: #fafafa;
    --trn-text: #18181b;
    --trn-muted: #52525b;
    --trn-border: #8b8b94;
    --trn-sep: #e4e4e7;
    --trn-ok: #15803d;
    --trn-ok-soft: #dcfce7;
    --trn-bad: #b91c1c;
    --trn-bad-soft: #fee2e2;
    --trn-warn: #92400e;
    --trn-warn-soft: #fef3c7;
    --trn-info-soft: #f3e8ff;
    /* Obrys fokusu pełnym kolorem: >= 3:1 względem jasnego i ciemnego tła (WCAG 1.4.11). */
    --trn-focus: #9810fa;
    --trn-radius: 16px;
    --trn-shadow: 0 1px 5px rgba(24, 24, 27, 0.06);
}

.dark .trn,
.dark .trn-shell {
    --trn-soft: rgba(152, 16, 250, 0.2);
    --trn-surface: #27272a;
    --trn-page: #18181b;
    --trn-text: #f4f4f5;
    --trn-muted: #c4c4cc;
    --trn-border: #71717a;
    --trn-sep: #3f3f46;
    --trn-ok: #4ade80;
    --trn-ok-soft: rgba(22, 163, 74, 0.22);
    --trn-bad: #fca5a5;
    --trn-bad-soft: rgba(239, 68, 68, 0.22);
    --trn-warn: #fcd34d;
    --trn-warn-soft: rgba(245, 158, 11, 0.2);
    --trn-info-soft: rgba(152, 16, 250, 0.2);
    --trn-focus: #d8b4fe;
    --trn-accent-fg: #d8b4fe;
    --trn-accent-fg-hover: #f3e8ff;
    --trn-shadow: none;
}

.trn-shell {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--trn-page);
    color: var(--trn-text);
}

.trn,
.trn *,
.trn *::before,
.trn *::after {
    box-sizing: border-box;
}

.trn {
    color: var(--trn-text);
    font-size: 15px;
    line-height: 22px;
}

.trn-player {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.trn-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Typografia ---------- */

.trn-h1 {
    margin: 0 0 4px;
    font-size: 24px;
    line-height: 30px;
    font-weight: 700;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}

.trn-h1:focus {
    outline: none;
}

.trn-h2 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
}

.trn-lead {
    margin: 6px 0 16px;
    color: var(--trn-muted);
    font-size: 16px;
    line-height: 24px;
}

.trn-muted {
    color: var(--trn-muted);
}

.trn-eyebrow {
    margin: 0 0 4px;
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--trn-muted);
}

.trn-eyebrow--accent {
    color: var(--trn-accent-fg);
}

.trn-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--trn-accent-fg);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.trn-link:hover {
    color: var(--trn-accent-fg-hover);
}

.trn-link--button {
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.trn-icon {
    width: 20px;
    height: 20px;
    flex: none;
}

.trn-icon--lg {
    width: 24px;
    height: 24px;
}

.trn-icon--hero {
    width: 72px;
    height: 72px;
    color: var(--trn-ok);
}

.trn-icon--ok {
    width: 32px;
    height: 32px;
    color: var(--trn-ok);
}

/* ---------- Fokus ---------- */

.trn a:focus-visible,
.trn button:focus-visible,
.trn summary:focus-visible,
.trn input:focus-visible,
.trn [tabindex]:focus-visible,
.trn-shell a:focus-visible,
.trn-shell button:focus-visible {
    outline: 3px solid var(--trn-focus);
    outline-offset: 2px;
    border-radius: 8px;
}

.trn-main:focus {
    outline: none;
}

/* Link „Przejdź do treści”: ukryty, dopóki nie dostanie fokusu (wtedy wyraźny, nad całą stroną). */
.trn-skip {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 12px 20px;
    border-radius: 9999px;
    background: #18181b;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);
}

.trn-skip:focus,
.trn-skip:focus-visible {
    transform: none;
    outline: 3px solid #d8b4fe;
    outline-offset: 2px;
}

/* ---------- Przyciski (pigułki, min. 44 px) ---------- */

.trn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    min-width: 48px;
    padding: 10px 24px;
    border: 1px solid transparent;
    border-radius: 9999px;
    font: inherit;
    font-size: 15px;
    line-height: 20px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.trn-btn--primary {
    background: var(--trn-accent);
    color: var(--trn-accent-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(152, 16, 250, 0.28);
}

.trn-btn--primary:hover {
    background: var(--trn-accent-hover);
}

.trn-btn--primary:active {
    background: var(--trn-accent-active);
    transform: translateY(0.5px);
}

.trn-btn--secondary {
    background: var(--trn-surface);
    color: var(--trn-text);
    border-color: var(--trn-border);
}

.trn-btn--secondary:hover {
    background: var(--trn-soft);
    border-color: var(--trn-accent);
}

.trn-btn--ghost {
    background: transparent;
    color: var(--trn-text);
}

.trn-btn--ghost:hover {
    background: var(--trn-soft);
}

.trn-btn--block {
    display: flex;
    width: 100%;
}

.trn-btn--large {
    min-height: 52px;
    font-size: 16px;
}

.trn-btn--small {
    min-height: 44px;
    padding: 6px 16px;
    font-size: 14px;
}

.trn-btn[disabled],
.trn-btn.is-disabled,
.trn-btn[aria-disabled='true'] {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.trn-btn.is-disabled:hover,
.trn-btn[aria-disabled='true']:hover {
    background: var(--trn-accent);
}

.trn-btn--secondary.is-disabled:hover {
    background: var(--trn-surface);
}

.trn-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 8px;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: var(--trn-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.trn-iconbtn:hover {
    background: var(--trn-soft);
}

.trn-iconbtn-label {
    /* Na telefonie etykieta jest ukryta wizualnie, ale zostaje nazwą przycisku dla czytników ekranu. */
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 640px) {
    .trn-iconbtn-label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }
}

/* ---------- Karty i bloki ---------- */

.trn-card {
    background: var(--trn-surface);
    border: 1px solid var(--trn-sep);
    border-radius: var(--trn-radius);
    box-shadow: var(--trn-shadow);
    padding: 20px 16px 24px;
}

@media (min-width: 640px) {
    .trn-card {
        padding: 28px 28px 32px;
    }
}

.trn-alert {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 500;
}

.trn-alert--danger {
    background: var(--trn-bad-soft);
    color: var(--trn-bad);
}

.trn-alert--info {
    background: var(--trn-info-soft);
}

.trn-alert--success {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--trn-ok-soft);
    color: var(--trn-ok);
}

.trn-notice {
    margin: 12px 16px 0;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--trn-warn-soft);
    color: var(--trn-warn);
    font-weight: 600;
}

.trn-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 10px;
    border-radius: 9999px;
    background: var(--trn-soft);
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
}

.trn-chip--danger {
    background: var(--trn-bad-soft);
    color: var(--trn-bad);
}

.trn-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 10px;
    margin: 18px 0 22px;
    padding: 0;
}

.trn-fact {
    background: var(--trn-soft);
    border-radius: 14px;
    padding: 12px 16px;
}

.trn-fact dt {
    margin: 0;
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    color: var(--trn-muted);
}

.trn-fact dd {
    margin: 2px 0 0;
    font-size: 15px;
    line-height: 22px;
    font-weight: 600;
}

.trn-fact--danger dd {
    color: var(--trn-bad);
}

.trn-fact-note {
    font-weight: 500;
}

.trn-facts--center {
    text-align: center;
}

/* ---------- Pasek postępu ---------- */

.trn-progress {
    height: 6px;
    background: var(--trn-sep);
    overflow: hidden;
}

.trn-progress > span {
    display: block;
    height: 100%;
    background: var(--trn-accent);
    transition: width 0.3s ease;
}

.trn-progress--card {
    flex: 1;
    height: 8px;
    border-radius: 9999px;
}

.trn-progress--card > span {
    border-radius: 9999px;
}

.trn-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 8px;
}

.trn-progress-text {
    flex: none;
    font-size: 13px;
    line-height: 18px;
    color: var(--trn-muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- Układ odtwarzacza ---------- */

.trn-preview-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 16px;
    padding: 10px 16px;
    background: var(--trn-warn-soft);
    color: var(--trn-warn);
    font-weight: 500;
}

.trn-preview-banner-text {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.trn-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--trn-surface);
    border-bottom: 1px solid var(--trn-sep);
    padding-top: env(safe-area-inset-top);
}

.trn-topbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 960px;
    margin: 0 auto;
    padding: 6px 8px;
}

.trn-topbar-title {
    flex: 1;
    min-width: 0;
}

.trn-topbar-course,
.trn-topbar-step {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trn-topbar-course {
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
}

.trn-topbar-step {
    font-size: 13px;
    line-height: 18px;
    color: var(--trn-muted);
    font-variant-numeric: tabular-nums;
}

.trn-steps {
    max-width: 960px;
    max-height: 60vh;
    margin: 0 auto;
    padding: 4px 16px 16px;
    overflow-y: auto;
    border-top: 1px solid var(--trn-sep);
}

.trn-steps-summary {
    margin: 10px 0;
    font-size: 13px;
    color: var(--trn-muted);
}

.trn-steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.trn-steps-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid var(--trn-sep);
    border-radius: 14px;
    background: var(--trn-surface);
    color: var(--trn-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.trn-steps-item:hover {
    border-color: var(--trn-accent);
}

.trn-steps-item--current {
    border-color: var(--trn-accent);
    background: var(--trn-soft);
}

.trn-steps-item--locked {
    color: var(--trn-muted);
    cursor: not-allowed;
}

.trn-steps-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    border: 2px solid var(--trn-border);
    font-size: 13px;
    font-weight: 700;
}

.trn-steps-item--done .trn-steps-mark {
    background: var(--trn-ok);
    border-color: var(--trn-ok);
    color: #fff;
}

.dark .trn-steps-item--done .trn-steps-mark {
    color: #052e16;
}

.trn-steps-item--current .trn-steps-mark {
    border-color: var(--trn-accent);
    color: var(--trn-accent-fg);
}

.trn-steps-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.trn-steps-title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.trn-steps-meta {
    font-size: 13px;
    line-height: 18px;
    color: var(--trn-muted);
}

.trn-step {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.trn-main {
    flex: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 16px 24px;
}

.trn-main--narrow {
    max-width: 680px;
    padding-bottom: 120px;
}

.trn-step-title {
    margin: 0;
    font-size: 22px;
    line-height: 28px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.trn-step-kind {
    margin: 2px 0 16px;
    font-size: 13px;
    line-height: 18px;
    color: var(--trn-muted);
}

.trn-start-nav {
    margin-bottom: 8px;
}

.trn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--trn-text);
    font-weight: 600;
    text-decoration: none;
}

.trn-back:hover {
    color: var(--trn-accent-fg);
}

/* ---------- Dolny pasek (przyklejony) ---------- */

.trn-bar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin-top: auto;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--trn-surface);
    border-top: 1px solid var(--trn-sep);
    box-shadow: 0 -4px 14px rgba(24, 24, 27, 0.06);
}

.trn-bar > * {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.trn-bar--single > .trn-btn {
    max-width: 680px;
}

.trn-bar--quiz {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.trn-bar-actions {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 10px;
}

.trn-bar-actions .trn-btn {
    padding-left: 14px;
    padding-right: 14px;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .trn-bar-actions {
        display: flex;
        justify-content: space-between;
    }

    .trn-bar-actions .trn-btn {
        min-width: 160px;
    }
}

.trn-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 22px;
    margin: 0 auto 10px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
}

.trn-hint-icon {
    flex: none;
    padding-top: 1px;
}

.trn-hint--ok {
    color: var(--trn-ok);
}

.trn-hint--wait {
    color: var(--trn-text);
}

/* ---------- Przeglądarka PDF / slajdów ---------- */

.trn-viewer-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    border: 1px solid var(--trn-sep);
    border-radius: var(--trn-radius);
    background: #e4e4e7;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}

.dark .trn-viewer-stage {
    background: #18181b;
}

.trn-viewer-stage:fullscreen {
    border-radius: 0;
    border: 0;
    background: #000;
}

.trn-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    background: #fff;
}

.trn-viewer-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.75);
    color: #18181b;
    font-weight: 500;
    text-align: center;
}

.dark .trn-viewer-overlay {
    background: rgba(24, 24, 27, 0.75);
    color: #f4f4f5;
}

.trn-viewer-overlay--error {
    background: var(--trn-bad-soft);
    color: var(--trn-bad);
}

.trn-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--trn-sep);
    border-top-color: var(--trn-accent);
    border-radius: 9999px;
    animation: trn-spin 0.8s linear infinite;
}

@keyframes trn-spin {
    to {
        transform: rotate(360deg);
    }
}

.trn-viewer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    margin-top: 10px;
}

.trn-viewer-spacer {
    flex: 1;
}

.trn-counter {
    margin: 0;
    min-width: 96px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.trn-keyboard-hint {
    display: none;
    margin: 4px 0 0;
    font-size: 13px;
}

@media (hover: hover) and (min-width: 1024px) {
    .trn-keyboard-hint {
        display: block;
    }
}

.trn-touch-hint {
    margin: 8px 0 0;
    font-size: 13px;
}

@media (min-width: 640px) {
    .trn-touch-hint {
        display: none;
    }
}

.trn-original {
    margin: 8px 0 0;
}

/* ---------- Wideo ---------- */

.trn-video {
    display: block;
    width: 100%;
    max-height: 70vh;
    border-radius: var(--trn-radius);
    background: #000;
}

.trn-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--trn-warn-soft);
    color: var(--trn-warn);
    font-weight: 500;
}

.trn-video-progress {
    margin: 10px 0 0;
    color: var(--trn-muted);
    font-variant-numeric: tabular-nums;
}

.trn-captions-note {
    margin: 10px 0 0;
    font-size: 13px;
}

/* ---------- Pakiet SCORM (ramka z materiałem) ---------- */

.trn-scorm {
    display: block;
}

.trn-scorm-frame {
    display: block;
    width: 100%;
    height: 72vh;
    min-height: 420px;
    margin-top: 12px;
    border: 2px solid var(--trn-border);
    border-radius: var(--trn-radius);
    background: #fff;
}

@media (max-width: 480px) {
    .trn-scorm-frame {
        height: 78vh;
        min-height: 360px;
    }
}

/* Transkrypcja nagrania: przycisk rozwijający region tekstowy pod odtwarzaczem. */
.trn-transcript {
    margin: 16px 0 0;
}

.trn-transcript-body {
    margin: 12px 0 0;
    padding: 16px;
    max-height: 24rem;
    overflow-y: auto;
    border: 1px solid var(--trn-border, currentColor);
    border-radius: 12px;
}

.trn-transcript-body[hidden],
.trn-transcript [x-cloak] {
    display: none;
}

/* ---------- Lekcja tekstowa ---------- */

.trn-prose {
    max-width: 72ch;
    font-size: 17px;
    line-height: 28px;
    overflow-wrap: anywhere;
}

.trn-reading-note {
    margin-top: 16px;
}

/* ---------- Oświadczenie ---------- */

.trn-statement {
    margin: 0 0 18px;
    padding: 16px 18px;
    border-left: 4px solid var(--trn-accent);
    border-radius: 0 14px 14px 0;
    background: var(--trn-soft);
    font-size: 17px;
    line-height: 26px;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.trn-doc {
    margin: 0 0 18px;
}

.trn-doc > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.trn-doc > summary::-webkit-details-marker {
    display: none;
}

.trn-doc > summary::before {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.trn-doc[open] > summary::before {
    transform: rotate(45deg);
}

.trn-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 48px;
    padding: 12px 16px;
    margin: 0 0 14px;
    border: 1px solid var(--trn-border);
    border-radius: 14px;
    background: var(--trn-surface);
    cursor: pointer;
}

.trn-check:focus-within {
    outline: 3px solid var(--trn-focus);
    outline-offset: 2px;
}

.trn-check input {
    flex: none;
    width: 24px;
    height: 24px;
    margin: 0;
    accent-color: var(--trn-accent);
    cursor: pointer;
}

.trn-btn--block-sm {
    display: flex;
    width: 100%;
}

@media (min-width: 640px) {
    .trn-btn--block-sm {
        display: inline-flex;
        width: auto;
    }
}

/* ---------- Ekran końcowy ---------- */

.trn-done {
    text-align: center;
}

.trn-done-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.trn-done-actions {
    display: grid;
    gap: 10px;
    margin: 22px 0 0;
}

.trn-done-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 20px;
    margin-top: 18px;
}

.trn-done-links .trn-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.trn-next {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid var(--trn-sep);
    border-radius: 14px;
    text-align: left;
}

.trn-next-name {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
}

.trn-next .trn-btn {
    margin-top: 12px;
}

.trn-blocked {
    text-align: left;
}

/* ---------- Reguły zaliczenia (ekran startowy) ---------- */

.trn-rules {
    margin: 0 0 16px;
    padding: 16px;
    border: 1px solid var(--trn-sep);
    border-radius: 14px;
}

.trn-rules-sentence {
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
}

.trn-rules-list {
    margin: 8px 0 0;
    padding-left: 22px;
    list-style: disc;
    color: var(--trn-text);
}

.trn-rules-list li {
    margin: 0 0 6px;
    padding-left: 2px;
}

.trn-saved-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
}

/* ---------- Moje szkolenia ---------- */

.trn-my {
    display: grid;
    gap: 20px;
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
}

.trn-my-head .trn-h1 {
    margin-bottom: 0;
}

.trn-section {
    margin: 0;
}

.trn-list {
    display: grid;
    gap: 12px;
}

.trn-todo {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    background: var(--trn-surface);
    border: 1px solid var(--trn-sep);
    border-radius: var(--trn-radius);
    box-shadow: var(--trn-shadow);
}

.trn-todo--hero {
    border: 2px solid var(--trn-accent);
    padding: 18px 16px;
}

.trn-todo--urgent {
    border-color: var(--trn-bad);
}

.trn-todo-body {
    min-width: 0;
}

.trn-todo-title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 24px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.trn-todo--hero .trn-todo-title {
    font-size: 20px;
    line-height: 26px;
}

.trn-todo-due {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin: 0;
}

.trn-todo-due--urgent {
    color: var(--trn-bad);
    font-weight: 600;
}

.trn-todo-time {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0;
}

.trn-todo-action .trn-btn {
    width: 100%;
}

@media (min-width: 640px) {
    .trn-todo {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        padding: 18px 22px;
    }

    .trn-todo--hero {
        padding: 22px 26px;
    }

    .trn-todo-body {
        flex: 1;
    }

    .trn-todo-action {
        flex: none;
    }

    .trn-todo-action .trn-btn {
        width: auto;
        min-width: 170px;
    }
}

.trn-empty {
    text-align: center;
}

.trn-empty .trn-icon--hero {
    display: block;
    margin: 0 auto 8px;
}

.trn-completed {
    background: var(--trn-surface);
    border: 1px solid var(--trn-sep);
    border-radius: var(--trn-radius);
    padding: 4px 16px;
}

.trn-completed-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    cursor: pointer;
    list-style: none;
}

.trn-completed-summary::-webkit-details-marker {
    display: none;
}

/* Strzałka pokazuje, że listę można rozwinąć (summary jest flexem, więc systemowy znacznik znika). */
.trn-completed-summary::after {
    content: "";
    flex: none;
    width: 10px;
    height: 10px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s;
}

.trn-completed[open] > .trn-completed-summary::after {
    transform: rotate(-135deg);
}

@media (prefers-reduced-motion: reduce) {
    .trn-completed-summary::after {
        transition: none;
    }
}

.trn-completed-summary .trn-h2 {
    margin: 0;
}

.trn-completed-list {
    list-style: none;
    margin: 0;
    padding: 0 0 12px;
    display: grid;
    gap: 4px;
}

.trn-completed-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--trn-sep);
}

@media (min-width: 640px) {
    .trn-completed-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.trn-completed-title {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.trn-completed-main .trn-muted {
    margin: 2px 0 0;
    font-size: 14px;
}

/* ---------- Widżet pulpitu ---------- */

.trn-widget-inner {
    display: grid;
    gap: 12px;
}

.trn-widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.trn-widget-head .trn-h2 {
    margin: 0;
}

.trn-widget-empty {
    display: flex;
    align-items: center;
    gap: 14px;
}

.trn-widget-empty-title {
    margin: 0;
    font-weight: 700;
}

.trn-widget-empty .trn-muted {
    margin: 0;
}

/* ---------- Okładki szkoleń i wyszukiwarka katalogu ---------- */

.trn-cover {
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 180px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--trn-soft);
}

.trn-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trn-cover--icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--trn-accent-fg);
}

.trn-cover-icon {
    width: 40px;
    height: 40px;
}

/* Zastępcza okładka (sama ikona) na telefonie jest niska: więcej kart mieści się na ekranie, bez długiego przewijania. */
@media (max-width: 639px) {
    .trn-cover--icon {
        aspect-ratio: auto;
        height: 72px;
    }

    .trn-todo--hero .trn-cover--icon {
        height: 96px;
    }
}

@media (min-width: 640px) {
    .trn-cover {
        width: 128px;
        max-height: none;
    }
}

.trn-filter {
    display: grid;
    gap: 12px;
    margin: 12px 0;
}

.trn-filter-field {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.trn-filter-label {
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
}

.trn-filter-input {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--trn-border);
    border-radius: 12px;
    background: var(--trn-surface);
    color: var(--trn-text);
    font: inherit;
}

.trn-filter-input:focus-visible {
    outline: 3px solid var(--trn-focus);
    outline-offset: 2px;
}

@media (min-width: 640px) {
    .trn-filter {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
        align-items: end;
    }
}

/* ---------- Ruch ---------- */

@media (prefers-reduced-motion: reduce) {
    .trn *,
    .trn *::before,
    .trn *::after,
    .trn-shell * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (forced-colors: active) {
    .trn-btn,
    .trn-card,
    .trn-todo {
        border: 1px solid CanvasText;
    }

    .trn-progress > span {
        background: Highlight;
    }
}

/*
 * Puste wartości („—”, „Brak aktywności”) w infolistach i tabelach modułu. Domyślny gray-400/500 Filament ma kontrast
 * poniżej 4,5:1 (WCAG 1.4.3), więc podnosimy go do gray-600 (jasny motyw, ok. 7,6:1 na bieli) i gray-400 (ciemny motyw,
 * ok. 7:1 na gray-900). Jedyny selektor niezależny od klasy .trn: strony Filament modułu nie mają wspólnego przodka.
 */
.fi-in-placeholder,
.fi-ta-placeholder {
    color: var(--gray-600, #52525b);
}

.dark .fi-in-placeholder,
.dark .fi-ta-placeholder {
    color: var(--gray-400, #a1a1aa);
}

/*
 * Pozycje ścieżki szkoleń („Moje szkolenia”). Lista bez punktorów; pozycja to kolumna (tytuł i stan, pod spodem
 * przycisk), a od 640 px wiersz. Podstawa flex dotyczy tylko układu wierszowego: w kolumnie wyznaczałaby wysokość
 * i robiła puste przestrzenie między pozycjami (375 px).
 */
.trn-path-items {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.trn-path-item {
    gap: 8px;
}

.trn-path-item-main {
    min-width: 0;
}

/* Ikona stanu stoi w jednej linii ze słowem stanu (svg bywa domyślnie blokowy i spadał do osobnego wiersza). */
.trn-path-item-main .trn-icon {
    display: inline-block;
    vertical-align: -4px;
    margin-right: 2px;
}

@media (min-width: 640px) {
    .trn-path-item {
        flex-wrap: wrap;
        gap: 4px 12px;
    }

    .trn-path-item-main {
        flex: 1 1 12rem;
    }
}

/* ---------- Mój zespół: kafelki podsumowania (trzy w rzędzie także na telefonie) ---------- */

.trn-team-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 16px;
}

.trn-team-stat {
    min-width: 0;
    padding: 10px 12px;
    background: var(--trn-surface);
    border: 1px solid var(--trn-sep);
    border-radius: 12px;
}

.trn-team-stat-label {
    margin: 0;
    font-size: 13px;
    line-height: 18px;
    color: var(--trn-muted);
    overflow-wrap: anywhere;
}

.trn-team-stat-value {
    margin: 4px 0 0;
    font-size: 24px;
    line-height: 30px;
    font-weight: 600;
}

.trn-team-stat-value--danger {
    color: var(--trn-bad);
}

@media (min-width: 640px) {
    .trn-team-stats {
        gap: 12px;
    }

    .trn-team-stat {
        padding: 16px;
    }
}

/* Macierz raportu: przełączanie tabela/karty bez klas .hidden i md:* (globalne style wtyczek ładowane po motywie nadpisują
   narzędzia Tailwinda, przez co tabela znikała na komputerze). */
.trn-matrix-desktop {
    display: none;
}

.trn-matrix-cards {
    display: block;
}

@media (min-width: 768px) {
    .trn-matrix-desktop {
        display: block;
    }

    .trn-matrix-cards {
        display: none;
    }
}
