/* =====================================================================
   Motyw „modern" — listy plików i kontenerów Remository.

   Wyjście komponentu to `<div>`-y z klasami rem-*, a nie tabela, więc
   zamiast markupu tabeli z makiety odwzorowujemy jej formę: biała karta
   (.panel), wiersze z ikoną w kolorowym kaflu, tytuł, meta i licznik
   po prawej. Kod komponentu pozostaje nietknięty — aktualizacja Remository
   niczego tu nie zepsuje.

   Kolejność: theme-modern.css → theme-joomla.css → theme-remository.css
   ===================================================================== */

/* --- Nagłówek listy ---------------------------------------------------- */
/* Tytuł nad listą. Remository używa raz <h2>, raz <h3> - zależnie od tego,
   czy to główna strona repozytorium czy podkatalog - więc łapiemy wszystkie
   poziomy i rozmiar bierzemy z bloku, nie z tagu.

   Poprzednia wersja celowała w .rem-list-wrapper > .rem-row:first-child
   i działała tylko na głównej stronie repozytorium: na podstronach pierwszym
   .rem-row jest ścieżka ("Powrót do ..."), a nie nagłówek, więc tytuł
   podkatalogu wypadał z reguły zupełnie. */
.theme-modern .rem-list-heading-block h1,
.theme-modern .rem-list-heading-block h2,
.theme-modern .rem-list-heading-block h3,
.theme-modern .rem-list-heading-block h4 {
    font-size: var(--m-fs-h2);
    font-weight: 600;
    letter-spacing: -.2px;
    margin: 0;
    display: inline;
}

/* Oba bloki nagłówków mają w HTML identyczne klasy - rozróżnia je dopiero
   skrypt, dokładając rem-heading-container i rem-heading-files. Dlatego
   powyższa reguła daje obu rozmiar h2, a tytuł strony podnosimy do h1 tutaj.
   Gdyby skrypt nie wstał, oba nagłówki będą po prostu równe - bez odwrócenia
   hierarchii.

   Selektor ma dwie klasy bloku (0,3,1), żeby wygrywał szczegółowością,
   a nie kolejnością w pliku. */
.theme-modern .rem-list-heading-block.rem-heading-container h1,
.theme-modern .rem-list-heading-block.rem-heading-container h2,
.theme-modern .rem-list-heading-block.rem-heading-container h3,
.theme-modern .rem-list-heading-block.rem-heading-container h4 {
    font-size: var(--m-fs-h1);
}

.theme-modern .rem-header-counter {
    color: var(--m-muted);
    font-size: 14px;
    margin-left: 10px;
    font-variant-numeric: tabular-nums;
}

/* --- Wiersz kontenera i wiersz pliku -----------------------------------
   W widoku kafelkowym komponent nadaje kartom ramkę i padding 1rem
   (.rem-grid.rem-folder .rem-folder-card) - zdejmujemy je tak samo
   szczegółowym selektorem. */
.theme-modern .rem-grid .rem-file-card,
.theme-modern .rem-file .rem-file-card {
    border: 0;
    min-height: 0;
    margin-bottom: 0;
    padding: 12px 10px;
}

/* --- Kontenery jako tabela --------------------------------------------
   Markup wierszy pochodzi z nadpisania layoutu
   (html/layouts/com_remository/containers/displaycontainers.php).
   Kolumny rysujemy siatką, bo wiersze nie są elementami <table>. */
.theme-modern .rem-folder,
.theme-modern .rem-folder.rem-grid {
    display: block;
    background: var(--m-surface);
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius-lg);
    padding: 6px 16px 10px;
}

.theme-modern .rem-thead,
.theme-modern .rem-trow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 104px 104px 76px;
    align-items: center;
    gap: 14px;
}

.theme-modern .rem-thead {
    padding: 12px 10px;
    border-bottom: 1px solid var(--m-border);
    color: var(--m-text);
    font-size: 13px;
    font-weight: 500;
}

.theme-modern .rem-trow {
    padding: 11px 10px;
    border-bottom: 1px solid var(--m-divider);
    transition: background .15s;
}

.theme-modern .rem-trow:last-child {
    border-bottom: 0;
}

.theme-modern .rem-trow:hover {
    background: #fafbfc;
}

.theme-modern .rem-trow[hidden] {
    display: none;
}

/* Kolumna nazwy: ikona, nazwa, opis i podfoldery */
.theme-modern .rem-tcell-name {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.theme-modern .rem-tname {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.theme-modern .rem-tname > a {
    color: var(--m-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-modern .rem-tname > a:hover {
    color: var(--m-primary);
}

.theme-modern .rem-tdesc {
    font-size: 12px;
    color: var(--m-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-modern .rem-subchips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.theme-modern .rem-subchip {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--m-th);
    color: var(--m-text-2);
    font-size: 11px;
    text-decoration: none;
}

.theme-modern .rem-subchip:hover {
    background: var(--m-primary-soft);
    color: var(--m-primary);
}

/* Kolumny liczbowe */
.theme-modern .rem-tcell-num {
    font-size: 13px;
    color: var(--m-text-2);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Akcje */
.theme-modern .rem-tcell-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.theme-modern .rem-tcell-actions a {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--m-radius);
    color: var(--m-text-2);
    text-decoration: none;
}

.theme-modern .rem-tcell-actions a:hover {
    background: var(--m-hover);
    color: var(--m-text);
}

.theme-modern .rem-tcell-actions i {
    font-size: 18px;
}

/* Ikona kontenera - selektor z wierszem, bo dalej w pliku ikony plików
   mają własny, większy rozmiar */
.theme-modern .rem-trow .rem-folder-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    padding: 5px;
    box-sizing: border-box;
    background: var(--m-primary-soft);
    border-radius: var(--m-radius-sm);
    object-fit: contain;
}

/* Telefon: wiersz rozpada się na kartę, etykiety z data-label */
@media (max-width: 767.98px) {
    .theme-modern .rem-folder,
    .theme-modern .rem-folder.rem-grid {
        background: transparent;
        border: 0;
        padding: 0;
    }

    .theme-modern .rem-thead {
        display: none;
    }

    .theme-modern .rem-trow {
        grid-template-columns: 1fr auto;
        gap: 8px 14px;
        padding: 14px;
        margin-bottom: 10px;
        background: var(--m-surface);
        border: 1px solid var(--m-border);
        border-radius: var(--m-radius-lg);
    }

    .theme-modern .rem-tcell-name {
        grid-column: 1 / -1;
    }

    .theme-modern .rem-tcell-num {
        text-align: left;
        font-size: 12px;
        color: var(--m-muted);
    }

    .theme-modern .rem-tcell-num::before {
        content: attr(data-label) ": ";
    }

    .theme-modern .rem-tcell-actions {
        grid-column: 2;
        grid-row: 2;
    }
}
/* --- Pasek filtrowania (dokładany skryptem powyżej 12 pozycji) ---------- */
.theme-modern .rem-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.theme-modern .rem-filter .search-box {
    width: 280px;
}

.theme-modern .rem-filter input {
    width: 100%;
    border: 0;
    background: transparent;
    outline: 0;
}

.theme-modern .rem-filter-info {
    font-size: 13px;
    color: var(--m-muted);
    font-variant-numeric: tabular-nums;
}

/* Lista plików jako jedna karta z liniami, nie zbiór osobnych kafelków */
.theme-modern .rem-file {
    background: var(--m-surface);
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius-lg);
    padding: 6px 14px;
}

.theme-modern .rem-file .rem-file-card {
    border-bottom: 1px solid var(--m-divider);
}

.theme-modern .rem-file .rem-file-card:last-child {
    border-bottom: 0;
}

.theme-modern .rem-folder-card,
.theme-modern .rem-file-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 10px;
    margin: 0;
    border-bottom: 1px solid var(--m-divider);
    border-radius: var(--m-radius);
    transition: background .15s;
}

.theme-modern .rem-folder-card:hover,
.theme-modern .rem-file-card:hover {
    background: #fafbfc;
}

.theme-modern .rem-list-wrapper .rem-folder-card:last-of-type,
.theme-modern .rem-list-wrapper .rem-file-card:last-of-type {
    border-bottom: 0;
}

/* Ikona w miękkim kaflu — odpowiednik .kpi-icon z makiety */
.theme-modern .rem-folder-icon,
.theme-modern .rem-file-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 6px;
    box-sizing: border-box;
    background: var(--m-primary-soft);
    border-radius: var(--m-radius);
    object-fit: contain;
}

.theme-modern .rem-file-card-file-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Tytuł */
.theme-modern .rem-folder-card h3,
.theme-modern .rem-file-card h3 {
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 2px;
    line-height: 1.35;
}

.theme-modern .rem-folder-card h3 a,
.theme-modern .rem-file-card h3 a {
    color: var(--m-text);
    text-decoration: none;
}

.theme-modern .rem-folder-card h3 a:hover,
.theme-modern .rem-file-card h3 a:hover {
    color: var(--m-primary);
}

/* Opis i metryka pliku: kto, kiedy, ile pobrań */
.theme-modern .rem-file-card-text {
    min-width: 0;
    flex: 1;
}

.theme-modern .rem-file-card-text > div,
.theme-modern .rem-folder-card-desc {
    font-size: 13px;
    color: var(--m-muted);
}

.theme-modern .rem-file-card-text > div strong {
    font-weight: 500;
    color: var(--m-text-2);
}

.theme-modern .rem-file-card-text p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--m-muted);
}

/* Licznik zawartości kontenera po prawej */
.theme-modern .rem-folder-counter {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--m-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.theme-modern .rem-file-card-thumbnail {
    margin-left: auto;
    flex-shrink: 0;
}

/* --- Moduł „Pliki supportu" (mod_remositorycat) ------------------------
   remository.module.css rysuje wiersze jako komórki tabeli z szarą ramką
   i cieniem przy najechaniu. Zdejmujemy to na rzecz cichych wierszy
   z jedną linią rozdzielającą - selektory muszą być co najmniej tak
   szczegółowe jak tamte (.rem-module .rem-table-row). */
.theme-modern .rem-module {
    display: block;
    background: var(--m-surface);
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius-lg);
    padding: 12px 14px;
    margin-bottom: 20px;
}

.theme-modern .rem-module .rem-table-row,
.theme-modern .rem-module .rem-table-row.ontab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--m-divider);
    border-radius: 0;
    box-shadow: none;
}

.theme-modern .rem-module .rem-table-row:last-child,
.theme-modern .rem-module .rem-table-row.ontab:last-child {
    border-bottom: 0;
}

.theme-modern .rem-module .rem-table-row:hover {
    background: var(--m-little-purple);
    border-color: var(--m-divider);
    box-shadow: none;
}

.theme-modern .rem-table-cell {
    min-width: 0;
}

.theme-modern .rem-table-cell a {
    color: var(--m-text);
    text-decoration: none;
    font-size: 14px;
}

.theme-modern .rem-table-cell a:hover {
    color: var(--m-primary);
}

.theme-modern .rem-module-item-icon img {
    width: 30px;
    height: 30px;
    display: block;
}

/* Licznik w ostatniej komórce wiersza modułu */
.theme-modern .rem-table-row .rem-table-cell:last-child {
    margin-left: auto;
    color: var(--m-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* --- Pasek narzędzi (sortowanie, przełącznik widoku, szukaj) ----------- */
.theme-modern .rem-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.theme-modern .rem-toolbar select,
.theme-modern .rem-toolbar input[type="text"] {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius);
    background: #fff;
    font-size: 14px;
    color: var(--m-text);
}

.theme-modern .rem-font-sm {
    font-size: 13px;
}

.theme-modern .rem-font-md {
    font-size: 14px;
}

/* --- Przycisk edycji modułu (widoczny tylko dla Super Usera) ------------
   Cassiopeia pozycjonuje go względem własnego kontenera, którego nie mamy.
   Dociskamy go do rogu modułu, żeby nie wypływał na topbar. */
.theme-modern .content {
    position: relative;
    background: url("../images/tlo_robot.png");
    background-repeat: no-repeat;
    background-size: auto;
    background-position: top center;
}

.theme-modern .jmodedit {
    position: absolute;
    right: 8px;
    z-index: 2;
    padding: 4px 8px;
}

/* --- Telefon ----------------------------------------------------------- */
@media (max-width: 767.98px) {
    .theme-modern .rem-list-wrapper {
        background: transparent;
        border: 0;
        padding: 0;
    }

    .theme-modern .rem-folder-card,
    .theme-modern .rem-file-card {
        border: 1px solid var(--m-border);
        border-radius: var(--m-radius-lg);
        background: var(--m-surface);
        margin-bottom: 10px;
        padding: 14px;
        align-items: flex-start;
    }

    .theme-modern .rem-folder-counter {
        margin-left: 0;
        width: 100%;
        padding-left: 52px;
    }

    .theme-modern .rem-folder-card {
        flex-wrap: wrap;
    }
}

/* --- Przyciski zarządzania plikiem i przesyłania ------------------------
   Komponent wymusza na nich width:100% (.rem-page-wrapper .rem-single-manage
   button oraz .rem-upload-wrapper .rem-upload-submit button), przez co cztery
   przyciski rozciągały się na całą szerokość strony. Zwężamy je do treści
   i dosuwamy grupę do prawej krawędzi. */
.theme-modern .rem-single-manage,
.theme-modern .rem-upload-wrapper .rem-upload-submit {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin: 4px 0 16px;
}

.theme-modern .rem-single-manage > div {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    padding: 0;
}

.theme-modern .rem-single-manage a {
    text-decoration: none;
}

.theme-modern .rem-page-wrapper .rem-single-manage button,
.theme-modern .rem-upload-wrapper .rem-upload-submit button {
    width: auto;
    min-width: 0;
    padding: 0 18px;
}

.theme-modern .rem-upload-wrapper .rem-upload-submit button {
    padding: 0 28px;
}

/* Na telefonie przyciski wracają do pełnej szerokości - tam wąskie,
   rozrzucone przyciski trudniej trafić kciukiem. */
@media (max-width: 575.98px) {
    .theme-modern .rem-single-manage,
    .theme-modern .rem-upload-wrapper .rem-upload-submit {
        flex-direction: column;
    }

    .theme-modern .rem-single-manage > div {
        width: 100%;
    }

    .theme-modern .rem-page-wrapper .rem-single-manage button,
    .theme-modern .rem-upload-wrapper .rem-upload-submit button {
        width: 100%;
    }
}

/* --- Lista plików jako tabela ------------------------------------------
   Wiersze pochodzą z nadpisania layoutu
   (html/layouts/com_remository/file/displayfilesummary.php). Siatkę i wygląd
   wiersza dziedziczą po .rem-trow z sekcji kontenerów - tutaj są tylko
   kolumny właściwe plikom. */
.theme-modern .rem-file {
    display: block;
    background: var(--m-surface);
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius-lg);
    padding: 6px 16px 10px;
}

.theme-modern .rem-thead-file,
.theme-modern .rem-trow-file {
    grid-template-columns: minmax(0, 1fr) 160px 150px 96px 132px;
}

.theme-modern .rem-tcell-meta {
    font-size: 13px;
    color: var(--m-text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-modern .rem-tcell-meta a {
    color: var(--m-text-2);
    text-decoration: none;
}

.theme-modern .rem-tcell-meta a:hover {
    color: var(--m-primary);
}

.theme-modern .rem-trow-file .rem-tname {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
}

.theme-modern .rem-trow-file .rem-tname a {
    color: var(--m-text);
    text-decoration: none;
}

.theme-modern .rem-trow-file .rem-tname a:hover {
    color: var(--m-primary);
}

.theme-modern .rem-trow-file .rem-file-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    padding: 5px;
    box-sizing: border-box;
    background: var(--m-primary-soft);
    border-radius: var(--m-radius-sm);
    object-fit: contain;
}

/* Pobieranie jako przycisk w wierszu */
.theme-modern .rem-tcell-download a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 12px;
    border-radius: var(--m-radius);
    background: var(--m-primary-soft);
    color: var(--m-primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.theme-modern .rem-tcell-download a:hover {
    background: var(--m-primary);
    color: #fff;
}

.theme-modern .rem-tcell-download i {
    font-size: 17px;
}

.theme-modern .rem-tmuted {
    font-size: 12px;
    color: var(--m-muted);
}

/* Telefon: wiersz pliku jako karta, etykiety kolumn z data-label */
@media (max-width: 767.98px) {
    .theme-modern .rem-file {
        background: transparent;
        border: 0;
        padding: 0;
    }

    .theme-modern .rem-thead-file {
        display: none;
    }

    .theme-modern .rem-trow-file {
        grid-template-columns: 1fr auto;
        gap: 8px 14px;
        padding: 14px;
        margin-bottom: 10px;
        background: var(--m-surface);
        border: 1px solid var(--m-border);
        border-radius: var(--m-radius-lg);
    }

    .theme-modern .rem-trow-file .rem-tcell-name {
        grid-column: 1 / -1;
    }

    .theme-modern .rem-tcell-meta::before,
    .theme-modern .rem-trow-file .rem-tcell-num::before {
        content: attr(data-label) ": ";
        color: var(--m-muted);
    }

    .theme-modern .rem-trow-file .rem-tcell-num {
        text-align: left;
        font-size: 12px;
    }

    .theme-modern .rem-tcell-download {
        grid-column: 1 / -1;
    }

    .theme-modern .rem-tcell-download a {
        width: 100%;
        justify-content: center;
        height: 40px;
    }
}

/* Gdy komponent ma wyłączone pobieranie z listy, kolumny akcji nie ma
   - siatka ma wtedy cztery kolumny zamiast pięciu. */
.theme-modern .rem-trow-file-nodl {
    grid-template-columns: minmax(0, 1fr) 160px 150px 96px;
}

/* --- Strzałka powrotu przy nazwie katalogu ------------------------------
   Przycisk wstawia skrypt do wiersza z tytułem katalogu. Celowo NIE zmieniamy
   układu .rem-list-heading-block - komponent dzieli ten blok na kolumny 8/4
   i trzyma w prawej sortowanie listy; przestawienie go na flex wypychało
   sortowanie do drugiego wiersza. */
.theme-modern .rem-back-btn,
.theme-modern .rem-head-icon {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-left: 14px;
    margin-right: 8px;
    border: 1px solid var(--m-brand);
    border-radius: var(--m-radius);
    background: var(--m-brand);
    color: #fff;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}

.theme-modern .rem-back-btn:hover {
    background: var(--m-brand-hover);
    border-color: var(--m-brand-hover);
    color: #fff;
}

.theme-modern .rem-back-btn:focus-visible {
    box-shadow: var(--m-brand-focus);
}

.theme-modern .rem-back-btn i,
.theme-modern .rem-head-icon i {
    font-size: 20px;
    line-height: 1;
}

/* --- Nagłówek listy plików ---------------------------------------------
   Klasy rem-heading-files i rem-heading-container nadaje skrypt - Remository
   daje obu blokom tę samą klasę i inaczej nie dało się ich rozróżnić.
   To tutaj zmieniasz rozmiar nagłówka plików i kolor jego znacznika. */
.theme-modern .rem-list-heading-block.rem-heading-files h1,
.theme-modern .rem-list-heading-block.rem-heading-files h2,
.theme-modern .rem-list-heading-block.rem-heading-files h3,
.theme-modern .rem-list-heading-block.rem-heading-files h4 {
    font-size: var(--m-fs-h2);
}

/* Znacznik nie jest klikalny, więc bez reakcji na najechanie. Resztę wyglądu
   (rozmiar pudełka, zaokrąglenie) dzieli z przyciskiem powrotu. */
.theme-modern .rem-head-icon {
    background: var(--m-primary);
    border-color: var(--m-primary);
    cursor: default;
}

/* --- Ikony z fontu zamiast obrazków komponentu --------------------------
   Kontenery i pliki mają ikony z fontu Tabler, dobierane w nadpisaniach
   layoutów. Powód: media/com_remository/images jest nadpisywane przy
   aktualizacji Remository, a font należy do szablonu.

   Klasy rem-folder-icon i rem-file-icon zostają te same, więc rozmiar
   i kafelek opisane wyżej nadal działają - dochodzi tylko wyśrodkowanie
   znaku i jego wielkość. */
.theme-modern .rem-folder-icon,
.theme-modern .rem-file-icon {
    display: inline-grid;
    place-items: center;
    color: var(--m-primary);
}

.theme-modern .rem-folder-icon i,
.theme-modern .rem-file-icon i {
    font-size: 19px;
    line-height: 1;
}

/* --- Przycisk pobierania w widoku pliku ---------------------------------
   Komponent rozciąga go na całą szerokość kolumny (width:100%, 16 px, waga 700).
   Zwężamy do treści i sprowadzamy do wyglądu pozostałych przycisków motywu.

   Ikonę dokładamy znakiem z fontu, a nie w znacznikach: nadpisanie tego widoku
   przechwytuje wynik szablonu komponentu i nie chcemy mnożyć w nim podmian
   w tekście. Kod znaku odpowiada ikonie ti-download z podzbioru fontu. */
.theme-modern .rem-page-wrapper .rem-download-link a,
.theme-modern .rem-download-link a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: auto;
    min-height: 44px;
    padding: 0 20px;
    border-radius: var(--m-radius);
    background: var(--m-primary);
    border: 1px solid var(--m-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    box-sizing: border-box;
    transition: background .15s, border-color .15s;
}

.theme-modern .rem-page-wrapper .rem-download-link a:hover,
.theme-modern .rem-download-link a:hover {
    background: var(--m-primary-hover);
    border-color: var(--m-primary-hover);
    color: #fff;
}

.theme-modern .rem-download-link a::before {
    content: "\ea96";
    font-family: "tabler-icons";
    font-size: 19px;
    font-weight: 400;
    line-height: 1;
    flex-shrink: 0;
}

/* Kolumna z przyciskiem: do prawej krawędzi, bez rozciągania */
.theme-modern .rem-download-link {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 575.98px) {
    .theme-modern .rem-download-link {
        justify-content: stretch;
    }

    .theme-modern .rem-page-wrapper .rem-download-link a,
    .theme-modern .rem-download-link a {
        width: 100%;
        justify-content: center;
    }
}

/* --- Przyciski zarządzania plikiem --------------------------------------
   Komponent daje im klasy btn-warning i btn-primary, przez co „Nie publikuj"
   i „Usuń zgłoszenie" wyglądały identycznie - mimo że jedno jest odwracalne,
   a drugie nie. Rozpoznajemy je po adresie, a nie po kolejności: zestaw
   przycisków zależy od uprawnień i kolejność bywa inna.

   Kolory wypełnień odczytane ze wzoru: złoty dla wycofania publikacji,
   wiodący dla edycji, granat dla miniatur, czerwień marki dla usunięcia. */
.theme-modern .rem-single-manage a {
    display: inline-flex;
}

.theme-modern .rem-page-wrapper .rem-single-manage button,
.theme-modern .rem-single-manage button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--m-radius);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, border-color .15s;
}

.theme-modern .rem-single-manage button::before {
    font-family: "tabler-icons";
    font-size: 19px;
    font-weight: 400;
    line-height: 1;
    flex-shrink: 0;
}

/* Wycofanie publikacji - odwracalne. Ciemny napis, bo na złotym tle
   biały ma zbyt mały kontrast. */
.theme-modern .rem-page-wrapper .rem-single-manage a[href*="view-userpublish"] button,
.theme-modern .rem-single-manage a[href*="view-userpublish"] button {
    background: var(--m-gold);
    border-color: var(--m-gold);
    color: #241a00;
}

.theme-modern .rem-single-manage a[href*="view-userpublish"] button::before {
    content: "\ecf0";
}

.theme-modern .rem-single-manage a[href*="view-userpublish"] button:hover {
    background: var(--m-gold-hover);
    border-color: var(--m-gold-hover);
}

/* Edycja zgłoszenia - działanie podstawowe */
.theme-modern .rem-page-wrapper .rem-single-manage a[href*="view-userupdate"] button,
.theme-modern .rem-single-manage a[href*="view-userupdate"] button {
    background: var(--m-primary);
    border-color: var(--m-primary);
}

.theme-modern .rem-single-manage a[href*="view-userupdate"] button::before {
    content: "\ea98";
}

.theme-modern .rem-single-manage a[href*="view-userupdate"] button:hover {
    background: var(--m-primary-hover);
    border-color: var(--m-primary-hover);
}

/* Miniatury - czynność pomocnicza */
.theme-modern .rem-page-wrapper .rem-single-manage a[href*="view-thumbupdate"] button,
.theme-modern .rem-single-manage a[href*="view-thumbupdate"] button {
    background: var(--m-navy);
    border-color: var(--m-navy);
}

.theme-modern .rem-single-manage a[href*="view-thumbupdate"] button::before {
    content: "\eb0a";
}

.theme-modern .rem-single-manage a[href*="view-thumbupdate"] button:hover {
    background: var(--m-navy-hover);
    border-color: var(--m-navy-hover);
}

/* Usunięcie - nieodwracalne */
.theme-modern .rem-page-wrapper .rem-single-manage a[href*="view-userdelete"] button,
.theme-modern .rem-single-manage a[href*="view-userdelete"] button {
    background: var(--m-brand);
    border-color: var(--m-brand);
}

.theme-modern .rem-single-manage a[href*="view-userdelete"] button::before {
    content: "\eb41";
}

.theme-modern .rem-single-manage a[href*="view-userdelete"] button:hover {
    background: var(--m-brand-hover);
    border-color: var(--m-brand-hover);
}
/* Blok mobilny listy nowych plików mieszka tutaj, a nie w theme-joomla.css:
   układ poziomy wiersza modułu definiuje ten plik, który wczytuje się
   później - reguła z wcześniejszego arkusza przy równej szczegółowości
   przegrywała i wiersz nie zwijał się na telefonie. */
/* --- Lista nowych plików na telefonie ------------------------------------
   Moduł wypisuje wiersz jako komórki obok siebie; przy wąskim ekranie
   tytuł, ścieżka i data nachodziły na siebie. Układamy je w pion: ikona
   z lewej, a obok kolejno tytuł, ścieżka i data. */
@media (max-width: 767.98px) {
    /* Wiersze nieparzyste mają dodatkową klasę .ontab, ujętą wyżej w regule
       układu poziomego - bez niej tutaj zwijałby się tylko co drugi. */
    .theme-modern .tensoft-newest .rem-table-row,
    .theme-modern .tensoft-newest .rem-table-row.ontab {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 4px 12px;
        align-items: start;
        padding: 12px 4px;
    }

    .theme-modern .tensoft-newest .rem-module-item-icon {
        grid-column: 1;
        grid-row: 1 / span 3;
    }

    .theme-modern .tensoft-newest .rem-module-item-title,
    .theme-modern .tensoft-newest .rem-module-item-container,
    .theme-modern .tensoft-newest .rem-module-item-calendar {
        grid-column: 2;
        min-width: 0;
    }

    .theme-modern .tensoft-newest .rem-module-item-title {
        font-size: 14px;
        line-height: 1.35;
    }

    .theme-modern .tensoft-newest .rem-module-item-container {
        flex-wrap: wrap;
        font-size: 12px;
    }

    .theme-modern .tensoft-newest .rem-module-item-calendar {
        font-size: 12px;
        color: var(--m-muted);
    }

    .theme-modern .tensoft-newest td:last-child,
    .theme-modern .tensoft-newest .rem-module-item-calendar {
        text-align: left;
    }
}
/* --- Pole sortowania listy plików ---------------------------------------
   Pole nie ma żadnej klasy Bootstrapa (<select name="order_by">), więc style
   frameworka go nie dotyczą - komponent rysuje je sam: szara ramka, promień
   4 px i wymuszona szerokość 100%. Nadajemy mu wygląd pozostałych pól motywu
   i własną strzałkę, bo systemowa nie da się ostylować.

   Szerokość i odstępy komponent ustawia z !important, więc tu też musi być. */
.theme-modern .rem-list-heading-block .rem-order-by {
    align-items: center;
    margin-left: auto;
}

.theme-modern .rem-order-by .rem-font-sm {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--m-muted);
}

.theme-modern .rem-list-heading-block .rem-order-by select,
.theme-modern #rem-jump-menu {
    appearance: none;
    -webkit-appearance: none;
    height: 40px;
    width: auto !important;
    min-width: 190px;
    margin-left: 10px;
    padding: 0 38px 0 12px !important;
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b909a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    color: var(--m-text);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.theme-modern .rem-list-heading-block .rem-order-by select:hover {
    border-color: #d5d9e0;
}

.theme-modern .rem-list-heading-block .rem-order-by select:focus {
    outline: 0;
    border-color: var(--m-primary);
    box-shadow: var(--m-focus);
}

@media (max-width: 575.98px) {
    .theme-modern .rem-list-heading-block .rem-order-by {
        width: 100%;
        margin-left: 0;
    }

    .theme-modern .rem-list-heading-block .rem-order-by select,
    .theme-modern #rem-jump-menu {
        width: 100% !important;
        min-width: 0;
    }
}

/* Komórki wiersza modułu: komponent daje im padding 1em, a w wariancie
   blokowym 0 0 0.5rem 0. Ujednolicamy na 0.5rem - selektor tej samej
   szczegółowości co jego plus .theme-modern, więc wygrywamy. */
.theme-modern .rem-module .rem-table-row .rem-table-cell {
    padding: 0.5rem;
}

/* Tytuł pliku na liście modułu: remository.module.min.css daje mu font-weight
   700, a 600 wystarcza i jest spójne z pozostałymi nagłówkami.

   UWAGA na kolejność wczytywania: remository.module.min.css ląduje w <head>
   PO wszystkich arkuszach szablonu (komponent rejestruje go dopiero przy
   renderowaniu modułu). Reguła o tej samej szczegółowości co jego by
   przegrała, dlatego powtarzamy cały jego selektor i dokładamy .theme-modern
   oraz .rem-table-cell - 0,5,1 kontra jego 0,3,1. */
.theme-modern .rem-module .rem-table-row .rem-table-cell.rem-module-item-title a {
    font-weight: 600;
}
