/* ========================================
   TABELA MIESZKAŃ - GŁÓWNE STYLE CSS
   ======================================== */

/* --- Reset i podstawy --- */
.mrep-table-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--mrep-text, #1a202c);
    background-color: var(--mrep-background, #ffffff);
    padding: 20px;
    border-radius: 8px;
    position: relative;
}

.mrep-table-wrapper * {
    box-sizing: border-box;
}

/* --- Zakładki etapów --- */
.mrep-tabs-frontend {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.mrep-tabs-frontend .tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    background-color: var(--mrep-tab-bg-color, transparent);
    border: 2px solid var(--mrep-tab-border-color, var(--mrep-primary, #333));
    text-decoration: none;
    color: var(--mrep-tab-text-color, var(--mrep-primary, #333));
    border-radius: var(--mrep-tab-radius, 6px);
    font-size: var(--mrep-tab-font-size, 14px);
    min-height: var(--mrep-tab-height, 44px);
    font-weight: 500;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.mrep-tabs-frontend .tab-link:hover {
    background-color: var(--mrep-tab-active-bg-color, var(--mrep-accent, #0073aa));
    border-color: var(--mrep-tab-active-border-color, var(--mrep-accent, #0073aa));
    color: var(--mrep-tab-active-text-color, #fff);
}

.mrep-tabs-frontend .tab-link.active {
    background-color: var(--mrep-tab-active-bg-color, var(--mrep-accent, #0073aa));
    border-color: var(--mrep-tab-active-border-color, var(--mrep-accent, #0073aa));
    color: var(--mrep-tab-active-text-color, #fff);
}

/* --- Przycisk filtrów --- */
.mrep-filters-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: var(--mrep-accent, #0073aa);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background-color 0.2s ease;
}

.mrep-filters-toggle:hover {
    background-color: var(--mrep-secondary, #555);
}

.mrep-filters-toggle svg {
    stroke: currentColor;
}

/* --- Kontener filtrów --- */
.mrep-filters-container {
    background: #fff;
    border-style: solid;
    border-color: #e2e8f0;
    border-width: var(--mrep-border-filters, 1px);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: none;
}

.mrep-filters-container.visible {
    display: block;
}

.mrep-filters-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.mrep-filters-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--mrep-text, #1a202c);
}

.mrep-filters-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
}

.mrep-filters-close:hover {
    color: #333;
}

/* --- Tryb: Zawsze widoczne --- */
.mrep-table-wrapper.filters-always_visible .mrep-filters-toggle {
    display: none !important;
}

.mrep-table-wrapper.filters-always_visible .mrep-filters-container {
    display: block !important;
    position: static !important;
    left: auto !important;
}

/* --- Tryb: Pod przyciskiem --- */
.mrep-table-wrapper.filters-button .mrep-filters-toggle {
    display: flex;
}

.mrep-table-wrapper.filters-button .mrep-filters-container {
    display: none;
    position: static;
}

.mrep-table-wrapper.filters-button .mrep-filters-container.visible {
    display: block;
}

/* --- Tryb: Panel boczny --- */
.mrep-filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.mrep-filters-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mrep-table-wrapper.filters-sidebar .mrep-filters-toggle {
    display: flex;
}

.mrep-table-wrapper.filters-sidebar .mrep-filters-container {
    position: fixed;
    top: 0;
    left: -350px;
    width: 320px;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: block !important;
}

.mrep-table-wrapper.filters-sidebar .mrep-filters-container.sidebar-open {
    left: 0;
}

.mrep-table-wrapper.filters-sidebar .mrep-filters-header {
    display: flex;
}

body.mrep-filters-open {
    overflow: hidden;
}

/* --- Formularz filtrów --- */
#mrep-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.mrep-filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 180px;
    max-width: 250px;
}

.mrep-filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--mrep-text, #333);
    margin-bottom: 6px;
}

.mrep-filter-group select,
.mrep-filter-group input {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    color: var(--mrep-text, #333);
    transition: border-color 0.2s ease;
}

.mrep-filter-group select:focus,
.mrep-filter-group input:focus {
    outline: none;
    border-color: var(--mrep-accent, #4299e1);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

/* Suwaki */
.mrep-filter-group.slider-filter {
    min-width: 200px;
}

.mrep-filter-group.slider-filter .slider {
    margin-top: 10px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
}

.mrep-filter-group.slider-filter .ui-slider-range {
    background: var(--mrep-accent, #4299e1);
    border-radius: 3px;
}

.mrep-filter-group.slider-filter .ui-slider-handle {
    width: 18px;
    height: 18px;
    background: var(--mrep-accent, #4299e1);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    top: -6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mrep-filter-group.slider-filter .slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

/* Przyciski akcji filtrów */
.mrep-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 10px;
}

/* --- Przyciski --- */
.mrep-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.mrep-btn-primary {
    background-color: var(--mrep-accent, #0073aa);
    color: #fff;
}

.mrep-btn-primary:hover {
    background-color: var(--mrep-primary, #333);
}

.mrep-btn-secondary {
    background-color: #e2e8f0;
    color: var(--mrep-text, #333);
}

.mrep-btn-secondary:hover {
    background-color: #cbd5e0;
}

/* --- Tabela --- */
.table-responsive {
    margin-top: 20px;
    width: 100%;
    overflow-x: hidden;
}

.mrep-apartment-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    background: #fff;
}

.mrep-apartment-table th {
    background-color: var(--mrep-table-header, #333);
    color: var(--mrep-table-header-text, #fff);
    padding: 10px 12px;
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    position: relative;
    /* Zawijaj tylko na granicach słów, nigdy w środku słowa */
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    user-select: none;
    transition: background-color 0.2s ease;
    vertical-align: middle;
}

/* Kolumny z wieloczłonowymi nagłówkami mogą się zawijać na spacjach */
.mrep-apartment-table th.col-key-card_url,
.mrep-apartment-table th.col-key-floor_card_url,
.mrep-apartment-table th[data-sort-key="card_url"],
.mrep-apartment-table th[data-sort-key="floor_card_url"] {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    max-width: 80px;
}

/* Kolumna ID - minimalna szerokość dopasowana do treści */
.mrep-apartment-table th.col-key-id,
.mrep-apartment-table td.col-key-id {
    width: 1px;
    white-space: nowrap;
}

.mrep-apartment-table th:hover {
    background-color: var(--mrep-secondary, #444);
}

.mrep-apartment-table th .sort-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    opacity: 0.4;
    transition: all 0.2s ease;
}

.mrep-apartment-table th.sorted-asc .sort-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.mrep-apartment-table th.sorted-desc .sort-icon {
    opacity: 1;
    transform: rotate(180deg);
}

.mrep-apartment-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: var(--mrep-text, #333);
}

.mrep-apartment-table tbody tr:nth-child(even) {
    background-color: var(--mrep-table-row-even, #f9f9f9);
}

.mrep-apartment-table tbody tr:nth-child(odd) {
    background-color: var(--mrep-table-row-odd, #fff);
}

.mrep-apartment-table tbody tr:hover {
    background-color: #f0f7ff;
}

/* Status */
.mrep-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
}

.mrep-status-unavailable {
    background-color: var(--mrep-status-unavailable, #6b7280);
    color: #fff;
}
.mrep-status-available {
    background-color: var(--mrep-status-available, #48bb78);
}

.mrep-status-reserved {
    background-color: var(--mrep-status-reserved, #ed8936);
}

.mrep-status-sold {
    background-color: var(--mrep-status-sold, #e53e3e);
}

/* Kolorowanie wierszy wg statusu */
.mrep-apartment-table tr.status-Wolne {
    border-left: 3px solid var(--mrep-status-available, #48bb78);
}

.mrep-apartment-table tr.status-Zarezerwowane {
    border-left: 3px solid var(--mrep-status-reserved, #ed8936);
}

.mrep-apartment-table tr.status-Sprzedane {
    border-left: 3px solid var(--mrep-status-sold, #e53e3e);
}

.mrep-apartment-table tr.mrep-skey-unavailable {
    border-left: 3px solid var(--mrep-status-unavailable, #6b7280);
}

/* Przyciski w tabeli */
/* Przycisk historii cen - twarda izolacja przed stylami motywu / Elementora.
   W nowych szablonach globalne reguły dla `button` nadawały tłu, obramowaniu,
   min-height i szerokości wartości, które rozdmuchiwały ikonę do wielkiego
   prostokąta z tłem. Poniższe reguły resetują wygląd do samej, estetycznej
   ikony w kolorze GŁÓWNYM wybranego motywu tabeli. */
.mrep-apartment-table .mrep-history-btn {
    -webkit-appearance: none;
    appearance: none;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none;
    cursor: pointer;
    padding: 4px !important;
    margin: 0 0 0 6px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    width: auto !important;
    height: auto !important;
    max-width: none;
    line-height: 1 !important;
    border-radius: 0 !important;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--mrep-history-icon, #000000);
    font-size: 0;
    text-indent: 0;
}

.mrep-apartment-table .mrep-history-btn:hover,
.mrep-apartment-table .mrep-history-btn:focus {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    opacity: 1;
    color: var(--mrep-history-icon, #000000);
}

.mrep-apartment-table .mrep-history-btn svg {
    display: block;
    width: 16px !important;
    height: 16px !important;
    stroke: currentColor;
    fill: none;
    flex: 0 0 auto;
    pointer-events: none;
}

.mrep-offer-btn {
    padding: 6px 10px;
    background-color: var(--mrep-accent, #4299e1);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    display: inline-block;
    max-width: 100%;
}

.mrep-offer-btn:hover {
    background-color: var(--mrep-primary, #1e3a5f);
}

.mrep-pdf-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--mrep-accent, #4299e1);
}

.mrep-pdf-link svg {
    stroke: currentColor;
}

.mrep-pdf-link:hover {
    color: var(--mrep-primary, #1e3a5f);
}

/* Obrazy w tabeli */
.image-cell .image-popup-link img {
    max-width: 80px;
    max-height: 60px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.image-cell .image-popup-link:hover img {
    transform: scale(1.05);
}

/* --- Modal / Popup --- */
.mrep-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    overflow-y: auto;
    padding: 40px 20px;
}

.mrep-modal.visible {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.mrep-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    animation: mrep-modal-appear 0.3s ease;
}

@keyframes mrep-modal-appear {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mrep-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    transition: color 0.2s ease;
}

.mrep-close-btn:hover {
    color: #333;
}

/* --- Popup kontaktowy --- */
.mrep-contact-popup h3 {
    margin: 0 0 20px;
    font-size: 22px;
    color: var(--mrep-text, #333);
}

.mrep-apartment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 25px;
}

.mrep-summary-item {
    font-size: 14px;
    color: #666;
}

.mrep-summary-item strong {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.mrep-summary-item.mrep-price {
    grid-column: 1 / -1;
    font-size: 18px;
    color: var(--mrep-primary, #333);
}

/* Formularz */
.mrep-form-group {
    margin-bottom: 18px;
}

.mrep-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--mrep-text, #333);
}

.mrep-form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mrep-form-group input:focus {
    outline: none;
    border-color: var(--mrep-accent, #4299e1);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.mrep-form-group.has-error input,
.mrep-consent-item.has-error input {
    border-color: #e53e3e;
}

.mrep-required {
    color: #e53e3e;
}

.mrep-error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.mrep-form-actions {
    margin-top: 25px;
}

/* Zgody */
.mrep-consents-section {
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.mrep-consent-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f7fafc;
    border-radius: 6px;
    cursor: pointer;
}

.mrep-consent-toggle input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.mrep-consent-toggle label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    flex: 1;
}

.mrep-expand-icon {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.mrep-expand-icon.expanded {
    transform: rotate(180deg);
}

.mrep-consents-details {
    margin-top: 15px;
    padding-left: 10px;
}

.mrep-consent-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #666;
}

.mrep-consent-item input {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.mrep-consent-item label {
    cursor: pointer;
}

/* Sukces */
.mrep-success-message {
    text-align: center;
    padding: 30px;
}

.mrep-success-message svg {
    margin-bottom: 20px;
}

.mrep-success-message h3 {
    margin: 0 0 10px;
    color: #48bb78;
    font-size: 24px;
}

.mrep-success-message p {
    color: #666;
    font-size: 16px;
}

/* --- Historia cen --- */
.mrep-history-popup h3 {
    margin: 0 0 25px;
    font-size: 22px;
    color: var(--mrep-text, #333);
}

.mrep-chart-container {
    height: 250px;
    margin-bottom: 30px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
}

.mrep-history-table {
    margin-top: 20px;
}

.mrep-history-table h4 {
    margin: 0 0 15px;
    font-size: 16px;
    color: var(--mrep-text, #333);
}

.mrep-history-table table {
    width: 100%;
    border-collapse: collapse;
}

.mrep-history-table th,
.mrep-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.mrep-history-table th {
    background: #f7fafc;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.mrep-change-up {
    color: #e53e3e;
}

.mrep-change-down {
    color: #48bb78;
}

.mrep-no-history {
    text-align: center;
    padding: 30px;
    color: #666;
}

.mrep-no-history .mrep-current-price {
    margin-top: 15px;
    font-size: 18px;
}

/* --- Brak wyników --- */
.mrep-no-apartments {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.mrep-error {
    text-align: center;
    padding: 40px 20px;
    color: #e53e3e;
    font-size: 16px;
}

/* Loading */
#mrep-table-container.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ========================================
   SZABLONY KOLORYSTYCZNE
   ======================================== */

/* Minimalistyczny - nadpisanie tabeli: tylko linie poziome, brak tła nagłówka */
.mrep-template-minimalist .mrep-apartment-table {
    background: transparent;
    border: none;
}

.mrep-template-minimalist .mrep-apartment-table th {
    background-color: transparent;
    color: var(--mrep-text, #1a202c);
    border-bottom: 2px solid var(--mrep-primary, #333333);
    border-top: none;
    border-left: none;
    border-right: none;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
}

.mrep-template-minimalist .mrep-apartment-table th:hover {
    background-color: transparent;
    color: var(--mrep-accent);
}

.mrep-template-minimalist .mrep-apartment-table td {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    border-top: none;
    border-left: none;
    border-right: none;
}

.mrep-template-minimalist .mrep-apartment-table tbody tr:nth-child(even),
.mrep-template-minimalist .mrep-apartment-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.mrep-template-minimalist .mrep-apartment-table tbody tr:hover {
    background-color: #f8f9fa;
}

.mrep-template-minimalist .mrep-apartment-table tbody tr:hover td {
    background-color: #f8f9fa;
}

/* ========================================
   SZABLON ZŁOTY - elegancki gradient z połyskiem
   ======================================== */
.mrep-template-gold .tab-link.active,
.mrep-template-gold .mrep-btn-primary,
.mrep-template-gold .mrep-offer-btn {
    background: linear-gradient(
        135deg,
        #8B6914 0%,
        #C9A227 25%,
        #D4AF37 50%,
        #C9A227 75%,
        #8B6914 100%
    ) !important;
    border-color: #8B6914 !important;
    color: #fff !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    box-shadow: 0 2px 4px rgba(139,105,20,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.mrep-template-gold .tab-link:not(.active) {
    border-color: #B8860B;
    color: #8B6914;
}

.mrep-template-gold .tab-link:not(.active):hover {
    background: linear-gradient(
        135deg,
        rgba(139,105,20,0.1) 0%,
        rgba(201,162,39,0.15) 50%,
        rgba(139,105,20,0.1) 100%
    );
}

.mrep-template-gold .mrep-btn-secondary {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-color: #B8860B;
    color: #8B6914;
}

.mrep-template-gold .noUi-connect {
    background: linear-gradient(90deg, #8B6914 0%, #C9A227 50%, #8B6914 100%);
}

.mrep-template-gold .noUi-handle {
    background: linear-gradient(135deg, #D4AF37 0%, #8B6914 100%);
    border-color: #8B6914;
    box-shadow: 0 2px 4px rgba(139,105,20,0.4);
}

/* Przezroczyste tło - klasa dodawana przez PHP gdy opcja włączona */
.mrep-background-transparent {
    background-color: transparent !important;
}

.mrep-background-transparent .mrep-table-wrapper {
    background-color: transparent !important;
}

/* ========================================
   RESPONSYWNOŚĆ
   ======================================== */

@media (max-width: 991px) {
    .mrep-table-wrapper {
        padding: 15px;
    }
    
    .mrep-tabs-frontend {
        gap: 8px;
    }
    
    .mrep-tabs-frontend .tab-link {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    #mrep-filter-form {
        flex-direction: column;
    }
    
    .mrep-filter-group {
        max-width: 100%;
        width: 100%;
    }
    
    .mrep-filter-actions {
        width: 100%;
    }
    
    .mrep-filter-actions .mrep-btn {
        flex: 1;
    }
    
    /* Tabela responsywna - tryb kart */
    .table-responsive {
        overflow-x: visible;
    }

    .mrep-apartment-table {
        table-layout: auto;
    }

    /* Zeruj fixed widths kolumn na mobile */
    .mrep-apartment-table th.col-key-surface,
    .mrep-apartment-table td.col-key-surface,
    .mrep-apartment-table th.col-key-rooms,
    .mrep-apartment-table td.col-key-rooms,
    .mrep-apartment-table th.col-key-floor,
    .mrep-apartment-table td.col-key-floor,
    .mrep-apartment-table th.col-key-status,
    .mrep-apartment-table td.col-key-status {
        width: auto;
    }

    .mrep-apartment-table thead {
        display: none;
    }
    
    .mrep-apartment-table,
    .mrep-apartment-table tbody,
    .mrep-apartment-table tr {
        display: block;
        width: 100%;
    }

    .mrep-apartment-table tbody tr {
        margin-bottom: 15px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        overflow: hidden;
        background: #fff;
    }
    
    .mrep-apartment-table tbody tr:nth-child(even),
    .mrep-apartment-table tbody tr:nth-child(odd) {
        background: #fff;
    }
    
    .mrep-apartment-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        word-break: normal;
    }
    
    .mrep-apartment-table td:last-child {
        border-bottom: none;
    }
    
    .mrep-apartment-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        font-size: 12px;
        text-transform: uppercase;
        white-space: nowrap;
        flex-shrink: 0;
        margin-right: 12px;
    }

    /* Pusta komórka (np. brak ceny) - na mobile nie pokazujemy jej wcale,
       żeby nie zostawała sama etykieta "Cena:" / "Oferta:" bez wartości. */
    .mrep-apartment-table td.mrep-cell-empty {
        display: none;
    }
    
    .mrep-apartment-table td .cell-content {
        text-align: right;
        flex: 1;
        min-width: 0;
    }

    /* Napraw obcięte ID na mobile */
    .mrep-apartment-table td.col-key-id {
        width: 100%;
        white-space: normal;
    }

    /* Zdjęcie na mobile - pół szerokości, wyśrodkowane */
    .mrep-apartment-table td.col-key-image,
    .mrep-apartment-table td.image-cell {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .mrep-apartment-table td.col-key-image .cell-content,
    .mrep-apartment-table td.image-cell .cell-content {
        text-align: center;
        width: 100%;
    }

    .mrep-apartment-table td.col-key-image .image-popup-link,
    .mrep-apartment-table td.image-cell .image-popup-link {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .mrep-apartment-table td.col-key-image .image-popup-link img,
    .mrep-apartment-table td.image-cell .image-popup-link img {
        max-width: 50vw;
        max-height: none;
        width: 50vw;
        height: auto;
        border-radius: 6px;
        display: block;
        margin: 0 auto;
    }
    
    /* Modal */
    .mrep-modal {
        padding: 20px 10px;
    }
    
    .mrep-modal-content {
        padding: 20px;
        border-radius: 10px;
    }
    
    .mrep-apartment-summary {
        grid-template-columns: 1fr 1fr;
    }
    
    .mrep-chart-container {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .mrep-tabs-frontend .tab-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .mrep-apartment-summary {
        grid-template-columns: 1fr;
    }
    
    .mrep-history-table th,
    .mrep-history-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
}

/* ========================================
   STYL PANELU ADMINISTRACYJNEGO
   ======================================== */

.wrap .mrep-tabs-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #ccc;
}

.wrap .mrep-tabs-list li {
    padding: 10px 15px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    background-color: #f1f1f1;
    position: relative;
    margin-right: 5px;
}

.wrap .mrep-tabs-list li.active {
    background-color: #fff;
    border-bottom-color: #fff;
    z-index: 1;
}

.wrap .mrep-tabs-list li .remove-tab {
    position: absolute;
    right: 5px;
    top: 5px;
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #a00;
    line-height: 1;
}

.wrap .mrep-tabs-list #add-new-tab-btn {
    background-color: #e9e9e9;
    font-weight: bold;
    font-size: 20px;
    padding: 5px 15px;
}

.wrap .mrep-tabs-content .tab-pane {
    display: none;
    padding-top: 20px;
}

.wrap .mrep-tabs-content .tab-pane.active {
    display: block;
}

.wrap .mrep-columns-repeater,
.wrap .mrep-apartments-repeater {
    margin-top: 20px;
}

.wrap .mrep-columns-repeater input,
.wrap .mrep-apartments-repeater input,
.wrap .mrep-apartments-repeater select {
    width: 100%;
    box-sizing: border-box;
}

.wrap .input-with-button {
    display: flex;
    gap: 5px;
}

.wrap .input-with-button input {
    flex: 1;
}

.wrap .mrep-columns-list tr td:first-child {
    cursor: grab;
}

#mrep-colors-section label {
    display: block;
    margin-bottom: 10px;
}

/* ============================================================================
   WARSTWA WYMUSZAJĄCA KOLORY I FORMATOWANIE WTYCZKI (v3.1)
   ----------------------------------------------------------------------------
   Niektóre motywy WordPress (zwłaszcza motywy blokowe / FSE z theme.json oraz
   buildery jak Elementor) generują reguły o równej lub wyższej specyficzności
   niż pojedyncze klasy wtyczki, lub ładują swoje globalne style PO stylach
   wtyczek. Efekt: motyw nadpisywał kolory tabeli, tekst dziedziczył krój i
   barwę z motywu, tła nagłówka/wierszy były wymazywane.

   Ta warstwa zakotwicza WSZYSTKIE reguły kolorystyczne pod ID #mrep-table-wrapper
   (specyficzność 1,0,0 - przebija selektory klasowe/elementowe motywu) i wymusza
   je z !important WYŁĄCZNIE na właściwościach barwy/typografii. Layout (padding,
   szerokości, marginesy, responsywność) NIE jest tu dotykany - pozostaje w
   regułach powyżej, żeby nie zaburzyć istniejącego układu.

   Wszystkie wartości pochodzą ze zmiennych --mrep-* wstrzykiwanych inline przez
   PHP na podstawie AKTYWNEGO szablonu kolorystycznego. Dla szablonu
   "minimalist" część zmiennych (--mrep-primary/--mrep-accent) celowo wskazuje
   kolory motywu - to zamierzone dziedziczenie i pozostaje zachowane.
   ============================================================================ */

/* --- Fundament: krój pisma i kolor tekstu w całym widgecie --- */
#mrep-table-wrapper,
#mrep-table-wrapper * {
    box-sizing: border-box;
}

#mrep-table-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    color: var(--mrep-text, #1a202c) !important;
    background-color: var(--mrep-background, #ffffff) !important;
}

/* Przezroczyste tło ma pierwszeństwo, jeśli włączone w ustawieniach szablonu */
#mrep-table-wrapper.mrep-background-transparent {
    background-color: transparent !important;
}

/* --- Zakładki etapów --- */
#mrep-table-wrapper .mrep-tabs-frontend .tab-link {
    background-color: var(--mrep-tab-bg-color, transparent) !important;
    border-color: var(--mrep-tab-border-color, var(--mrep-primary, #333)) !important;
    color: var(--mrep-tab-text-color, var(--mrep-primary, #333)) !important;
    text-decoration: none !important;
}

#mrep-table-wrapper .mrep-tabs-frontend .tab-link:hover,
#mrep-table-wrapper .mrep-tabs-frontend .tab-link.active {
    background-color: var(--mrep-tab-active-bg-color, var(--mrep-accent, #0073aa)) !important;
    border-color: var(--mrep-tab-active-border-color, var(--mrep-accent, #0073aa)) !important;
    color: var(--mrep-tab-active-text-color, #fff) !important;
}

/* --- Przycisk rozwijania filtrów --- */
#mrep-table-wrapper .mrep-filters-toggle {
    background-color: var(--mrep-accent, #0073aa) !important;
    color: #fff !important;
    border: none !important;
}
#mrep-table-wrapper .mrep-filters-toggle:hover {
    background-color: var(--mrep-secondary, #555) !important;
}
#mrep-table-wrapper .mrep-filters-toggle svg { stroke: currentColor !important; }

/* --- Etykiety, pola i selecty filtrów --- */
#mrep-table-wrapper .mrep-filters-header h3,
#mrep-table-wrapper .mrep-filter-group label {
    color: var(--mrep-text, #1a202c) !important;
}
#mrep-table-wrapper .mrep-filter-group select,
#mrep-table-wrapper .mrep-filter-group input {
    background-color: #fff !important;
    color: var(--mrep-text, #333) !important;
    border-color: #e2e8f0 !important;
}
#mrep-table-wrapper .mrep-filter-group select:focus,
#mrep-table-wrapper .mrep-filter-group input:focus {
    border-color: var(--mrep-accent, #4299e1) !important;
}

/* --- Suwaki (jQuery UI slider) --- */
#mrep-table-wrapper .mrep-filter-group.slider-filter .ui-slider-range {
    background: var(--mrep-accent, #4299e1) !important;
}
#mrep-table-wrapper .mrep-filter-group.slider-filter .ui-slider-handle {
    background: var(--mrep-accent, #4299e1) !important;
    border-color: #fff !important;
}

/* --- Przyciski akcji --- */
#mrep-table-wrapper .mrep-btn-primary {
    background-color: var(--mrep-accent, #0073aa) !important;
    color: #fff !important;
}
#mrep-table-wrapper .mrep-btn-primary:hover {
    background-color: var(--mrep-primary, #333) !important;
}
#mrep-table-wrapper .mrep-btn-secondary {
    background-color: #e2e8f0 !important;
    color: var(--mrep-text, #333) !important;
}
#mrep-table-wrapper .mrep-btn-secondary:hover {
    background-color: #cbd5e0 !important;
}

/* --- Tabela: nagłówek --- */
#mrep-table-wrapper .mrep-apartment-table th {
    background-color: var(--mrep-table-header, #333) !important;
    color: var(--mrep-table-header-text, #fff) !important;
}
#mrep-table-wrapper .mrep-apartment-table th:hover {
    background-color: var(--mrep-secondary, #444) !important;
}
#mrep-table-wrapper .mrep-apartment-table th .sort-icon {
    color: inherit !important;
}

/* --- Tabela: komórki i wiersze --- */
#mrep-table-wrapper .mrep-apartment-table td {
    color: var(--mrep-text, #333) !important;
    border-bottom-color: #e2e8f0 !important;
}
#mrep-table-wrapper .mrep-apartment-table tbody tr:nth-child(even) {
    background-color: var(--mrep-table-row-even, #f9f9f9) !important;
}
#mrep-table-wrapper .mrep-apartment-table tbody tr:nth-child(odd) {
    background-color: var(--mrep-table-row-odd, #fff) !important;
}
#mrep-table-wrapper .mrep-apartment-table tbody tr:hover,
#mrep-table-wrapper .mrep-apartment-table tbody tr:hover td {
    background-color: #f0f7ff !important;
}

/* --- Statusy --- */
#mrep-table-wrapper .mrep-status { color: #fff !important; }
#mrep-table-wrapper .mrep-status-unavailable {
    background-color: var(--mrep-status-unavailable, #6b7280) !important;
    color: #fff !important;
}
#mrep-table-wrapper .mrep-status-available {
    background-color: var(--mrep-status-available, #48bb78) !important;
}
#mrep-table-wrapper .mrep-status-reserved {
    background-color: var(--mrep-status-reserved, #ed8936) !important;
}
#mrep-table-wrapper .mrep-status-sold {
    background-color: var(--mrep-status-sold, #e53e3e) !important;
}
#mrep-table-wrapper .mrep-apartment-table tr.status-Wolne {
    border-left-color: var(--mrep-status-available, #48bb78) !important;
}
#mrep-table-wrapper .mrep-apartment-table tr.status-Zarezerwowane {
    border-left-color: var(--mrep-status-reserved, #ed8936) !important;
}
#mrep-table-wrapper .mrep-apartment-table tr.status-Sprzedane {
    border-left-color: var(--mrep-status-sold, #e53e3e) !important;
}

/* --- Oferta / PDF / historia --- */
#mrep-table-wrapper .mrep-offer-btn {
    background-color: var(--mrep-accent, #4299e1) !important;
    color: #fff !important;
    border: none !important;
}
#mrep-table-wrapper .mrep-offer-btn:hover {
    background-color: var(--mrep-primary, #1e3a5f) !important;
}
#mrep-table-wrapper .mrep-pdf-link { color: var(--mrep-accent, #4299e1) !important; }
#mrep-table-wrapper .mrep-pdf-link:hover { color: var(--mrep-primary, #1e3a5f) !important; }
#mrep-table-wrapper .mrep-pdf-link svg { stroke: currentColor !important; }
#mrep-table-wrapper .mrep-history-btn,
#mrep-table-wrapper .mrep-history-btn:hover,
#mrep-table-wrapper .mrep-history-btn:focus { color: var(--mrep-history-icon, #000000) !important; }
#mrep-table-wrapper .mrep-history-btn svg { stroke: currentColor !important; }
#mrep-table-wrapper .mrep-history-btn svg circle,
#mrep-table-wrapper .mrep-history-btn svg polyline { stroke: currentColor !important; }

/* ----------------------------------------------------------------------------
   SZABLON MINIMALISTYCZNY - wymuszenie jego własnej charakterystyki
   (nagłówek bez tła, białe wiersze) nad motywem. Kolor tekstu/akcentu nadal
   dziedziczy z motywu przez --mrep-primary/--mrep-accent (zamierzone).
   ---------------------------------------------------------------------------- */
#mrep-table-wrapper.mrep-template-minimalist .mrep-apartment-table {
    background: transparent !important;
}
#mrep-table-wrapper.mrep-template-minimalist .mrep-apartment-table th {
    background-color: transparent !important;
    color: var(--mrep-text, #1a202c) !important;
    border-bottom-color: var(--mrep-primary, #333333) !important;
}
#mrep-table-wrapper.mrep-template-minimalist .mrep-apartment-table th:hover {
    background-color: transparent !important;
    color: var(--mrep-accent) !important;
}
#mrep-table-wrapper.mrep-template-minimalist .mrep-apartment-table td,
#mrep-table-wrapper.mrep-template-minimalist .mrep-apartment-table tbody tr:nth-child(even),
#mrep-table-wrapper.mrep-template-minimalist .mrep-apartment-table tbody tr:nth-child(odd) {
    background-color: #ffffff !important;
}
#mrep-table-wrapper.mrep-template-minimalist .mrep-apartment-table tbody tr:hover,
#mrep-table-wrapper.mrep-template-minimalist .mrep-apartment-table tbody tr:hover td {
    background-color: #f8f9fa !important;
}

/* ----------------------------------------------------------------------------
   SZABLON ZŁOTY - gradienty przycisków/suwaka muszą przebić motyw.
   ---------------------------------------------------------------------------- */
#mrep-table-wrapper.mrep-template-gold .tab-link.active,
#mrep-table-wrapper.mrep-template-gold .mrep-btn-primary,
#mrep-table-wrapper.mrep-template-gold .mrep-offer-btn {
    background: linear-gradient(135deg, #8B6914 0%, #C9A227 25%, #D4AF37 50%, #C9A227 75%, #8B6914 100%) !important;
    border-color: #8B6914 !important;
    color: #fff !important;
}
#mrep-table-wrapper.mrep-template-gold .ui-slider-range {
    background: linear-gradient(90deg, #8B6914 0%, #C9A227 50%, #8B6914 100%) !important;
}
#mrep-table-wrapper.mrep-template-gold .ui-slider-handle {
    background: linear-gradient(135deg, #D4AF37 0%, #8B6914 100%) !important;
    border-color: #8B6914 !important;
}


/* ============================================================================
   UKŁADY PREZENTACJI (v3.4) - NIEZALEŻNE OD SCHEMATU KOLORÓW
   ----------------------------------------------------------------------------
   Dwa układy wizualne sterowane klasą wrappera .mrep-layout-minimal /
   .mrep-layout-rich, DODAWANE OBOK klasy schematu kolorów (.mrep-template-*).
   Dzięki temu każdy pierwotny schemat kolorów (minimalist, navy, green, gold,
   beige, custom) można wyświetlić w wariancie subtelnym LUB rozbudowanym.

   Kolory pochodzą ze zmiennych --mrep-* i --mrep-ui-* (ustawianych inline wg
   aktywnego schematu i wspólnych ustawień UI), więc te same reguły układu
   działają na dowolnej palecie. Właściwości czysto układowe (odstępy,
   obramowania, typografia, zaokrąglenia) są zdefiniowane tutaj.

   Bazę stylów opracowała Kasia (jako "Szablon 1"/aura i "Szablon 2"); zostały
   zrefaktoryzowane tak, by rozdzielić układ od koloru i działać na wszystkich
   schematach zamiast zastępować je dwoma monolitami.
   ============================================================================ */
/* --- Fundament --- */
#mrep-table-wrapper.mrep-layout-minimal {
    /* Czcionka dziedziczona globalnie z motywu strony - patrz .mrep-table-wrapper. */
    font-family: inherit !important;
    color: var(--mrep-text, #211f1d) !important;
    background-color: var(--mrep-background, #ffffff) !important;
    border-radius: 0;
}
#mrep-table-wrapper.mrep-layout-minimal.mrep-background-transparent {
    background-color: transparent !important;
}

/* --- Zakładki etapów --- */
#mrep-table-wrapper.mrep-layout-minimal .mrep-tabs-frontend .tab-link {
    background-color: var(--mrep-tab-bg-color, transparent) !important;
    border-width: 1px !important;
    border-color: var(--mrep-tab-border-color, #e1dedb) !important;
    color: var(--mrep-tab-text-color, #54514d) !important;
    font-weight: 600 !important;
    letter-spacing: .14em !important;
    text-transform: uppercase !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-tabs-frontend .tab-link:hover {
    background-color: var(--mrep-tab-bg-color, transparent) !important;
    border-color: var(--mrep-tab-active-border-color, var(--mrep-primary, #211f1d)) !important;
    color: var(--mrep-tab-text-color, var(--mrep-primary, #211f1d)) !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-tabs-frontend .tab-link.active {
    background-color: var(--mrep-tab-active-bg-color, var(--mrep-primary, #211f1d)) !important;
    border-color: var(--mrep-tab-active-border-color, var(--mrep-primary, #211f1d)) !important;
    color: var(--mrep-tab-active-text-color, #fcf9f6) !important;
}

/* --- Przycisk "Rozwiń filtry" --- */
#mrep-table-wrapper.mrep-layout-minimal .mrep-filters-toggle {
    background-color: var(--mrep-ui-action-color, #211f1d) !important;
    border: 1px solid var(--mrep-ui-action-color, #211f1d) !important;
    border-radius: var(--mrep-ui-button-radius, 2px);
    color: white !important;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: 12px;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-filters-toggle:hover {
    background-color: transparent !important;
	border: 1px solid var(--mrep-ui-action-color, #211f1d) !important;
    color: var(--mrep-ui-action-color, #211f1d) !important;
}

/* --- Panel filtrów --- */
#mrep-table-wrapper.mrep-layout-minimal .mrep-filters-container {
    background: #ffffff !important;
    border-style: solid !important;
    border-color: #e1dedb !important;
    border-width: var(--mrep-border-filters, 1px) !important;
    border-radius: 0;
    box-shadow: none;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-filters-header h3 {
    font-family: inherit !important;
    font-weight: 400 !important;
    font-size: 24px;
    color: var(--mrep-text, #211f1d) !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-filter-group label {
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: .16em !important;
    text-transform: var(--mrep-header-case, uppercase) !important;
    color: #8d8a86 !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-filter-group select,
#mrep-table-wrapper.mrep-layout-minimal .mrep-filter-group input {
    background-color: var(--mrep-background, #fcf9f6) !important;
    color: var(--mrep-text, #211f1d) !important;
    border-color: #e1dedb !important;
    border-radius: 0;
    box-shadow: none;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-filter-group select:focus,
#mrep-table-wrapper.mrep-layout-minimal .mrep-filter-group input:focus {
    border-color: var(--mrep-accent, #936b5b) !important;
    box-shadow: none;
}

/* --- Suwaki --- */
#mrep-table-wrapper.mrep-layout-minimal .mrep-filter-group.slider-filter .slider {
    height: 2px;
    background: #e1dedb;
    border: 0;
    border-radius: 0;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-filter-group.slider-filter .ui-slider-range {
    background: var(--mrep-ui-action-color, #b64a18) !important;
    border-radius: 0;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-filter-group.slider-filter .ui-slider-handle {
    width: 16px;
    height: 16px;
    top: -7px;
    background: var(--mrep-ui-action-color, #b64a18) !important;
    border: 1px solid var(--mrep-ui-action-color, #b64a18) !important;
    box-shadow: none;
    transition: box-shadow 0.25s ease;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-filter-group.slider-filter .ui-slider-handle:hover,
#mrep-table-wrapper.mrep-layout-minimal .mrep-filter-group.slider-filter .ui-slider-handle.ui-state-active {
    box-shadow: 0 0 0 5px rgba(182, 74, 24, 0.18);
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-filter-group.slider-filter .slider-labels {
    color: #54514d;
    font-variant-numeric: tabular-nums;
}

/* --- Przyciski akcji --- */
#mrep-table-wrapper.mrep-layout-minimal .mrep-btn {
    border-radius: var(--mrep-ui-button-radius, 2px);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-btn-primary {
    background-color: var(--mrep-ui-action-color, #b64a18) !important;
    color: #ffffff !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-btn-primary:hover {
    background-color: var(--mrep-ui-hover-color, #211f1d) !important;
    color: #fcf9f6 !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-btn-secondary {
    background-color: transparent !important;
    border: 1px solid var(--mrep-ui-action-color, #211f1d) !important;
    color: var(--mrep-ui-action-color, #211f1d) !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-btn-secondary:hover {
    background-color: var(--mrep-ui-hover-color, #211f1d) !important;
    border-color: var(--mrep-ui-hover-color, #211f1d) !important;
    color: #fcf9f6 !important;
}

/* --- Tabela: tylko poziome linie, bez pionowych kresek kolumn --- */
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table {
    background: transparent !important;
    border-bottom: 1px solid #e1dedb;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table th {
    background-color: var(--mrep-ui-header-row-color, #F4EFE9) !important;
    color: var(--mrep-ui-header-text-color, #3a3733) !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: var(--mrep-header-case, uppercase);
    border: none !important;
    padding: 14px 20px 14px 16px;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table th:hover {
    background-color: var(--mrep-ui-header-row-color, #F4EFE9) !important;
    color: var(--mrep-ui-header-text-color, #8d8a86) !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table th .sort-icon {
    color: #b64a18 !important;
    font-size: 13px;
}

/* --- Tabela: zebra (1. wiersz biały, 2. szary...), bez hovera --- */
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table td {
    color: var(--mrep-text, #211f1d) !important;
    border-bottom-color: #e1dedb !important;
    border-left: none !important;
    border-right: none !important;
    vertical-align: middle !important;
    padding: 12px 10px;
    font-size: 13px;
}
/* Zebra ustawiona też na td — odporna na reguły malujące całe wiersze */
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tbody tr:nth-child(odd),
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tbody tr:nth-child(odd) td {
    background-color: var(--mrep-ui-row-odd-color, #ffffff) !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tbody tr:nth-child(even),
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tbody tr:nth-child(even) td {
    background-color: var(--mrep-ui-row-even-color, #ffffff) !important;
}
/* Sprzedane — szary niezależnie od parzystości wiersza i bez zmiany na hover */
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tbody tr.status-Sprzedane,
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tbody tr.status-Sprzedane td,
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tbody tr.status-Sprzedane:hover,
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tbody tr.status-Sprzedane:hover td {
    background-color: #F2F2F2 !important;
}
/* Hover wyłączony na życzenie - wiersz zostaje biały tak jak bez najechania */
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tbody tr:not(.status-Sprzedane):hover,
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tbody tr:not(.status-Sprzedane):hover td {
    background-color: #ffffff !important;
}

/* Zamiast kolorowej lewej krawędzi — status komunikują pastylki */
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tr.status-Wolne,
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tr.status-Zarezerwowane,
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tr.status-Sprzedane {
    border-left: none !important;
}

/* Numer i cena wyróżnione tylko wagą - czcionka dziedziczona globalnie */
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table td.col-key-number .cell-content {
    font-size: 13px;
    font-weight: 400;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table td.col-key-price .cell-content {
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table td.col-key-price_per_m2 .cell-content {
    font-size: 13px;
    color: #8d8a86;
    font-variant-numeric: tabular-nums;
}

/* Wiersze sprzedane — wyciszone (razem z linkiem "Zapytaj") */
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tr.status-Sprzedane td {
    color: #a9a5a0 !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tr.status-Sprzedane .mrep-offer-btn,
#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tr.status-Sprzedane .mrep-offer-btn:hover {
    color: #a9a5a0 !important;
}

/* --- Statusy: bez pastylek — kolor niesie sama czcionka ---
   Kolory statusów nadal płyną z panelu przez zmienne --mrep-status-*. */
#mrep-table-wrapper.mrep-layout-minimal .mrep-status {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    white-space: nowrap;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-status-available {
    color: var(--mrep-status-available, #3d6b3a) !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-status-reserved {
    color: var(--mrep-status-reserved, #8a6a2a) !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-status-sold {
    color: var(--mrep-status-sold, #8d8a86) !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-status-unavailable {
    color: var(--mrep-status-unavailable, #6b7280) !important;
}

/* --- "Zapytaj": tekstowy link z terakotową strzałką --- */
#mrep-table-wrapper.mrep-layout-minimal .mrep-offer-btn {
    background-color: transparent !important;
    border: none !important;
    padding: 0;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--mrep-ui-offer-color, #b64a18) !important;
    transition: color 0.3s ease;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-offer-btn::after {
    content: " \2192"; /* strzałka w prawo */
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-offer-btn:hover {
    background-color: transparent !important;
    color: var(--mrep-primary, #211f1d) !important;
}

/* --- Ikony: historia cen i PDF --- */
#mrep-table-wrapper.mrep-layout-minimal .mrep-history-btn {
    color: var(--mrep-ui-history-icon-color, #bdbab8) !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-history-btn:hover,
#mrep-table-wrapper.mrep-layout-minimal .mrep-history-btn:focus {
    color: #000000 !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-pdf-link {
    color: var(--mrep-ui-action-color, #b64a18) !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-pdf-link:hover {
    color: #000000 !important;
}

/* --- Modale: kontakt i historia cen --- */
#mrep-table-wrapper.mrep-layout-minimal .mrep-modal {
    background: rgba(23, 21, 19, 0.66) !important;
}
/* Jednolite, nieprzezroczyste białe tło całego okna — !important, bo tło
   potrafi wymazać globalny CSS motywu/buildera nadający przezroczystość */
#mrep-table-wrapper.mrep-layout-minimal .mrep-modal-content {
    background: #ffffff !important;
    opacity: 1 !important;
    border: 1px solid #e1dedb;
    border-radius: 2px;
    box-shadow: 0 30px 80px rgba(23, 21, 19, 0.35);
}
#mrep-table-wrapper.mrep-layout-minimal #mrep-popup-content,
#mrep-table-wrapper.mrep-layout-minimal .mrep-contact-popup,
#mrep-table-wrapper.mrep-layout-minimal .mrep-history-popup,
#mrep-table-wrapper.mrep-layout-minimal .mrep-price-history-content {
    background: #ffffff !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-contact-popup h3,
#mrep-table-wrapper.mrep-layout-minimal .mrep-history-popup h3,
#mrep-table-wrapper.mrep-layout-minimal .mrep-success-message h3 {
    font-weight: 600;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-close-btn { color: #8d8a86; }
#mrep-table-wrapper.mrep-layout-minimal .mrep-close-btn:hover { color: var(--mrep-accent, #936b5b); }

#mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-summary,
#mrep-table-wrapper.mrep-layout-minimal .mrep-consent-toggle {
    background: #f0f0f0;
    border-radius: 0;
}
/* Wykres historii cen na białym tle */
#mrep-table-wrapper.mrep-layout-minimal .mrep-chart-container,
#mrep-table-wrapper.mrep-layout-minimal .mrep-price-chart-wrapper {
    background: #ffffff !important;
    border-radius: 0;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-summary-item strong {
    letter-spacing: .14em;
    color: #8d8a86;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-summary-item.mrep-price {
    font-weight: 600;
    font-size: 20px;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-form-group label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #8d8a86;
}
/* Pola formularza wyróżnione na białym tle okna */
#mrep-table-wrapper.mrep-layout-minimal .mrep-form-group input {
    border: 1px solid #d1cdc9 !important;
    border-radius: 0;
    background: #f0f0f0 !important;
    color: var(--mrep-text, #211f1d) !important;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-form-group input:focus {
    border-color: #b64a18 !important;
    background: #ffffff !important;
    box-shadow: none;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-history-table th {
    background: transparent;
    color: #8d8a86;
    letter-spacing: .16em;
    border-bottom: 1px solid #e1dedb;
}
#mrep-table-wrapper.mrep-layout-minimal .mrep-history-table td {
    border-bottom-color: #e1dedb;
    font-variant-numeric: tabular-nums;
}

/* --- Mobile: karty na cienkich liniach --- */
@media (max-width: 991px) {
    #mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table tbody tr {
        border: 1px solid #e1dedb !important;
        border-radius: 0;
        background: #ffffff !important;
    }
    #mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table td::before {
        color: #8d8a86;
        letter-spacing: .14em;
        font-size: 10px;
    }
    #mrep-table-wrapper.mrep-layout-minimal .mrep-apartment-table td.col-key-number .cell-content {
        font-size: 16px;
    }
}

/* ============================================================================
#mrep-table-wrapper.mrep-layout-rich {
    color: var(--mrep-text, #1a202c) !important;
    background-color: var(--mrep-background, #ffffff) !important;
}
#mrep-table-wrapper.mrep-layout-rich.mrep-background-transparent {
    background-color: transparent !important;
}
#mrep-table-wrapper.mrep-layout-rich .table-responsive {
    border: none;
    border-radius: 0;
    box-shadow: none;
    scrollbar-width: thin; /* Firefox - cienki pasek zamiast grubego natywnego */
}
#mrep-table-wrapper.mrep-layout-rich .table-responsive::-webkit-scrollbar {
    height: 6px;
}
#mrep-table-wrapper.mrep-layout-rich .table-responsive::-webkit-scrollbar-track {
    background: transparent;
    border: none;
    box-shadow: none;
}
#mrep-table-wrapper.mrep-layout-rich .table-responsive::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
    border: none;
}

/* --- Zakładki etapów --- */
#mrep-table-wrapper.mrep-layout-rich .mrep-tabs-frontend .tab-link {
    background-color: var(--mrep-tab-bg-color, transparent) !important;
    border-width: 1px !important;
    border-color: var(--mrep-tab-border-color, var(--mrep-primary, #1e3a5f)) !important;
    color: var(--mrep-tab-text-color, var(--mrep-primary, #1e3a5f)) !important;
    font-weight: 600 !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-tabs-frontend .tab-link:hover {
    background-color: var(--mrep-tab-bg-color, transparent) !important;
    border-color: var(--mrep-tab-active-border-color, var(--mrep-accent, #2b6cb0)) !important;
    color: var(--mrep-tab-text-color, var(--mrep-accent, #2b6cb0)) !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-tabs-frontend .tab-link.active {
    background-color: var(--mrep-tab-active-bg-color, var(--mrep-primary, #1e3a5f)) !important;
    border-color: var(--mrep-tab-active-border-color, var(--mrep-primary, #1e3a5f)) !important;
    color: var(--mrep-tab-active-text-color, #ffffff) !important;
}

/* --- Przycisk "Rozwiń filtry" --- */
#mrep-table-wrapper.mrep-layout-rich .mrep-filters-toggle {
    background-color: var(--mrep-ui-action-color, #1e3a5f) !important;
    color: #ffffff !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-filters-toggle:hover {
    background-color: var(--mrep-ui-hover-color, #2b6cb0) !important;
    color: #ffffff !important;
}

/* --- Panel filtrów --- */
#mrep-table-wrapper.mrep-layout-rich .mrep-filters-container {
    background: var(--mrep-background, #ffffff) !important;
    border-style: solid !important;
    border-color: #e2e8f0 !important;
    border-width: var(--mrep-border-filters, 1px) !important;
    border-radius: 10px;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-filters-header h3 {
    color: var(--mrep-text, #1a202c) !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-filter-group label {
    color: #a0aec0 !important;
    font-weight: 600 !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-filter-group select,
#mrep-table-wrapper.mrep-layout-rich .mrep-filter-group input {
    background-color: var(--mrep-background, #ffffff) !important;
    color: var(--mrep-text, #1a202c) !important;
    border-color: #e2e8f0 !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-filter-group select:focus,
#mrep-table-wrapper.mrep-layout-rich .mrep-filter-group input:focus {
    border-color: var(--mrep-accent, #2b6cb0) !important;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15) !important;
}

/* --- Suwaki --- */
#mrep-table-wrapper.mrep-layout-rich .mrep-filter-group.slider-filter .ui-slider-range {
    background: var(--mrep-ui-action-color, #2b6cb0) !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-filter-group.slider-filter .ui-slider-handle {
    background: var(--mrep-ui-action-color, #2b6cb0) !important;
    border-color: var(--mrep-ui-action-color, #2b6cb0) !important;
}

/* --- Przyciski akcji (Filtruj / Resetuj) --- */
#mrep-table-wrapper.mrep-layout-rich .mrep-btn-primary {
    background-color: var(--mrep-ui-action-color, #2b6cb0) !important;
    color: #ffffff !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-btn-primary:hover {
    background-color: var(--mrep-ui-hover-color, #1e3a5f) !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-btn-secondary {
    background-color: color-mix(in srgb, var(--mrep-primary, #1e3a5f) 12%, white) !important;
    border: none !important;
    color: var(--mrep-primary, #1e3a5f) !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-btn-secondary:hover {
    background-color: var(--mrep-ui-hover-color, #1e3a5f) !important;
    color: #ffffff !important;
}

/* --- Tabela: nagłówek (bez wersalików, zwykła waga tekstu) --- */
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table {
    background: var(--mrep-background, #ffffff) !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table th {
    background-color: var(--mrep-ui-header-row-color, #1e3a5f) !important;
    color: var(--mrep-ui-header-text-color, #ffffff) !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: var(--mrep-header-case, uppercase);
    border: none !important;
    padding: 14px 20px 14px 16px;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table th:hover {
    background-color: var(--mrep-ui-header-row-color, #1e3a5f) !important;
    color: var(--mrep-ui-header-text-color, #ffffff) !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table th .sort-icon {
    color: var(--mrep-ui-header-text-color, #ffffff) !important;
    opacity: 0.6;
}

/* --- Tabela: zebra + wyróżnione kolumny --- */
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table td {
    color: var(--mrep-text, #1a202c) !important;
    border: none !important;
    border-bottom: 1px solid #edf2f7 !important;
    border-right: 1px solid #edf2f7 !important;
    vertical-align: middle !important;
    padding: 14px 16px;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table td:last-child {
    border-right: none !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table tbody tr:last-child td {
    border-bottom: none !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table tbody tr:nth-child(odd) td {
    background-color: var(--mrep-ui-row-odd-color, #ffffff) !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table tbody tr:nth-child(even) td {
    background-color: var(--mrep-ui-row-even-color, #eef2f8) !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table tr.status-Wolne,
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table tr.status-Zarezerwowane,
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table tr.status-Sprzedane {
    border-left: none !important;
}
/* Wiersz sprzedany - wyciszony niezależnie od parzystości */
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table tbody tr.status-Sprzedane td {
    background-color: var(--mrep-background, #ffffff) !important;
    color: #a0aec0 !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table tbody tr.status-Sprzedane .cell-content {
    color: #a0aec0 !important;
}

/* Identyfikator (numer/nazwa domu) i cena - pogrubione i wyróżnione */
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table td.col-key-number .cell-content,
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table td.col-key-house .cell-content {
    font-weight: 400;
    color: var(--mrep-primary, #1e3a5f);
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table tbody tr.status-Sprzedane td.col-key-number .cell-content,
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table tbody tr.status-Sprzedane td.col-key-house .cell-content {
    color: #a0aec0;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table td.col-key-price .cell-content {
    font-weight: 400;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table td.col-key-price_per_m2 .cell-content {
    color: #a0aec0;
}

/* Puste komórki (np. cena/oferta ukryta dla sprzedanych) - kreska zamiast pustki */
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table td.mrep-cell-empty .cell-content:empty::before {
    content: "\2014";
    color: #cbd5e0;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table td.col-key-offer.mrep-cell-empty .cell-content:empty::before {
    content: "\2014";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 6px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #cbd5e0;
}

/* --- Statusy: domyślnie wypełnione, tryb obrysowany włączany klasą .mrep-status-outline --- */
#mrep-table-wrapper.mrep-layout-rich .mrep-status {
    background: none !important;
    border: 1px solid transparent !important;
    border-radius: var(--mrep-ui-status-radius, 20px) !important;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    white-space: nowrap;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-status-available {
    background-color: var(--mrep-status-available, #2f855a) !important;
    color: #ffffff !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-status-reserved {
    background-color: var(--mrep-status-reserved, #c05621) !important;
    color: #ffffff !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-status-sold {
    background-color: var(--mrep-status-sold, #c53030) !important;
    color: #ffffff !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-status-unavailable {
    background-color: var(--mrep-status-unavailable, #6b7280) !important;
    color: #ffffff !important;
}
/* Tryb obrysowany (checkbox "Pastylki statusu wypełnione kolorem" odznaczony) */
#mrep-table-wrapper.mrep-layout-rich.mrep-status-outline .mrep-status-available {
    background-color: transparent !important;
    border-color: var(--mrep-status-available, #2f855a) !important;
    color: var(--mrep-status-available, #2f855a) !important;
}
#mrep-table-wrapper.mrep-layout-rich.mrep-status-outline .mrep-status-reserved {
    background-color: transparent !important;
    border-color: var(--mrep-status-reserved, #c05621) !important;
    color: var(--mrep-status-reserved, #c05621) !important;
}
#mrep-table-wrapper.mrep-layout-rich.mrep-status-outline .mrep-status-sold {
    background-color: transparent !important;
    border-color: var(--mrep-status-sold, #c53030) !important;
    color: var(--mrep-status-sold, #c53030) !important;
}
#mrep-table-wrapper.mrep-layout-rich.mrep-status-outline .mrep-status-unavailable {
    background-color: transparent !important;
    border-color: var(--mrep-status-unavailable, #6b7280) !important;
    color: var(--mrep-status-unavailable, #6b7280) !important;
}

/* --- "Zapytaj": ten sam styl co przycisk "Filtruj", padding jak w statusach --- */
#mrep-table-wrapper.mrep-layout-rich .mrep-offer-btn {
    background-color: var(--mrep-ui-action-color, #2b6cb0) !important;
    border: none !important;
    color: #ffffff !important;
    padding: 10px 14px;
    border-radius: var(--mrep-ui-status-radius, 20px);
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-offer-btn:hover {
    background-color: var(--mrep-ui-hover-color, #1e3a5f) !important;
    color: #ffffff !important;
}

/* --- Ikony: historia cen i PDF --- */
#mrep-table-wrapper.mrep-layout-rich .mrep-history-btn {
    color: var(--mrep-ui-history-icon-color, #2c5282) !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-history-btn:hover,
#mrep-table-wrapper.mrep-layout-rich .mrep-history-btn:focus {
    color: #000000 !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-pdf-link {
    color: var(--mrep-ui-action-color, #2b6cb0) !important;
}
#mrep-table-wrapper.mrep-layout-rich .mrep-pdf-link:hover {
    color: #000000 !important;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    border-width: 0 0 0 0;
    margin: 0 0 1.5em;
    width: 100%;
}

/* --- Mobile: karty --- */
@media (max-width: 991px) {
    #mrep-table-wrapper.mrep-layout-rich .table-responsive {
        border: none;
        box-shadow: none;
    }
    #mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table tbody tr {
        border: none;
        border-radius: 0;
        background: var(--mrep-background, #ffffff) !important;
    }
    #mrep-table-wrapper.mrep-layout-rich .mrep-apartment-table td::before {
        color: #000000;
        font-weight: 600;
    }
}


/* ============================================================================
   PARTIA C - WARIANTY TEKSTOWE PRZYCISKÓW KOLUMN (przycisk albo sam tekst)
   ============================================================================ */
/* Wariant "sam tekst" dla kolumny Oferta - klikalny tekst bez wyglądu przycisku */
#mrep-table-wrapper .mrep-offer-btn.mrep-offer-text {
    background: none !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: var(--mrep-ui-offer-color, var(--mrep-accent, #2b6cb0)) !important;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    min-height: 0 !important;
}
#mrep-table-wrapper .mrep-offer-btn.mrep-offer-text:hover {
    color: var(--mrep-ui-hover-color, var(--mrep-primary, #1e3a5f)) !important;
    text-decoration: underline;
}
/* Wariant "sam tekst" dla kolumny Karta PDF */
#mrep-table-wrapper .mrep-pdf-link.mrep-pdf-text {
    display: inline;
    color: var(--mrep-ui-action-color, var(--mrep-accent, #2b6cb0)) !important;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}
#mrep-table-wrapper .mrep-pdf-link.mrep-pdf-text:hover {
    color: var(--mrep-ui-hover-color, var(--mrep-primary, #1e3a5f)) !important;
}
/* Wariant "sam tekst" dla historii cen (zamiast ikony zegara) */
#mrep-table-wrapper .mrep-history-btn.mrep-history-text {
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin-left: 8px !important;
    font-size: 13px !important;
    font-weight: 600;
    color: var(--mrep-history-icon, #000000) !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: 1;
}
#mrep-table-wrapper .mrep-history-btn.mrep-history-text:hover {
    color: var(--mrep-ui-hover-color, var(--mrep-primary)) !important;
}

/* ============================================================================
   PARTIA A - STATUS "SPRZEDANE": wyszarzenie wiersza i blokada interakcji
   ============================================================================ */
#mrep-table-wrapper.mrep-statusmode-gray_row .mrep-apartment-table tbody tr.mrep-row-sold {
    opacity: 0.65;
}
#mrep-table-wrapper .mrep-apartment-table tbody tr.mrep-row-sold .mrep-offer-btn[disabled],
#mrep-table-wrapper .mrep-apartment-table tbody tr.mrep-row-sold .mrep-history-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
#mrep-table-wrapper .mrep-pdf-link.mrep-disabled,
#mrep-table-wrapper .image-popup-link.mrep-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(1);
}
/* Zaokrąglenie pastylek statusu sterowane ustawieniem UI (wspólne dla układów) */
#mrep-table-wrapper .mrep-status {
    border-radius: var(--mrep-ui-status-radius, 20px);
}
/* Zaokrąglenie przycisków akcji sterowane ustawieniem UI */
#mrep-table-wrapper .mrep-btn,
#mrep-table-wrapper .mrep-filters-toggle {
    border-radius: var(--mrep-ui-button-radius, 2px);
}
/* Wielkość liter nagłówków tabeli sterowana ustawieniem UI */
#mrep-table-wrapper .mrep-apartment-table th {
    text-transform: var(--mrep-header-case, uppercase);
}


/* ============================================================================
   PREZENTACJA STATUSU + OBRAMOWANIE (v3.5)
   ============================================================================ */

/* --- Kolumna statusu ZAWSZE widoczna, niezależnie od układu i trybu --- */
/* Nie wymuszamy display:table-cell (to zepsułoby układ kart na mobile, gdzie
   komórki są display:block). Zamiast tego gwarantujemy, że nic nie ustawia jej
   na display:none ani nie chowa etykiety statusu. */
#mrep-table-wrapper .mrep-apartment-table th.col-key-status:not([hidden]),
#mrep-table-wrapper .mrep-apartment-table td.col-key-status:not([hidden]) {
    visibility: visible !important;
}
#mrep-table-wrapper .mrep-apartment-table th.col-key-status,
#mrep-table-wrapper .mrep-apartment-table td.col-key-status {
    display: revert;
}
#mrep-table-wrapper .mrep-apartment-table .mrep-status {
    visibility: visible !important;
}

/* --- TRYB: kolorowe etykiety statusu (domyślny) --- */
/* Etykieta statusu zawsze czytelna; kolory z kanonicznych klas available/reserved/sold. */

/* --- TRYB: wyszarzenie całego wiersza dla rezerwacji i sprzedanych --- */
/* Etykieta statusu pozostaje widoczna i neutralna (nie kolorowana pastylka). */
#mrep-table-wrapper.mrep-statusmode-gray_row .mrep-apartment-table tbody tr.mrep-skey-sold,
#mrep-table-wrapper.mrep-statusmode-gray_row .mrep-apartment-table tbody tr.mrep-skey-unavailable {
    opacity: 0.55;
    filter: grayscale(0.6);
}
/* W trybie wyszarzania etykieta statusu jest neutralna (nie kolorowa pastylka),
   ale nadal wyraźnie widoczna. */
#mrep-table-wrapper.mrep-statusmode-gray_row tr.mrep-skey-sold .mrep-status,
#mrep-table-wrapper.mrep-statusmode-gray_row tr.mrep-skey-unavailable .mrep-status {
    background: none !important;
    background-color: transparent !important;
    color: var(--mrep-text, #333) !important;
    padding: 0 !important;
    font-weight: 600;
}
/* W trybie kolorowym nie wyszarzamy wierszy poza istniejącą obsługą "sprzedane",
   którą reguluje osobny przełącznik statusu. */
#mrep-table-wrapper.mrep-statusmode-colored_status .mrep-apartment-table tbody tr {
    opacity: 1;
    filter: none;
}

/* ============================================================================
   OBRAMOWANIE TABELI - sterowane zmiennymi (per szablon)
   Grubości: --mrep-border-table-outer / -vertical / -horizontal (0 = brak).
   Reguły z wysoką specyficznością (#id + !important), aby działać na obu
   układach i nad warstwą wymuszającą.
   ============================================================================ */
#mrep-table-wrapper .mrep-apartment-table {
    border-width: var(--mrep-border-table-outer, 1px) !important;
    border-style: solid !important;
    border-color: var(--mrep-border-color, #e2e8f0) !important;
}
/* Poziome linie między wierszami */
#mrep-table-wrapper .mrep-apartment-table td,
#mrep-table-wrapper .mrep-apartment-table th {
    border-bottom-width: var(--mrep-border-table-horizontal, 1px) !important;
    border-bottom-style: solid !important;
    border-bottom-color: var(--mrep-border-color, #e2e8f0) !important;
    border-top: 0 !important;
}
/* Pionowe kreski między kolumnami */
#mrep-table-wrapper .mrep-apartment-table td,
#mrep-table-wrapper .mrep-apartment-table th {
    border-right-width: var(--mrep-border-table-vertical, 0px) !important;
    border-right-style: solid !important;
    border-right-color: var(--mrep-border-color, #e2e8f0) !important;
    border-left: 0 !important;
}
/* Ostatnia kolumna bez prawej krawędzi (żeby nie dublować krawędzi zewnętrznej) */
#mrep-table-wrapper .mrep-apartment-table td:last-child,
#mrep-table-wrapper .mrep-apartment-table th:last-child {
    border-right: 0 !important;
}

/* ============================================================================
   OBRAMOWANIE FILTRÓW - sterowane zmienną --mrep-border-filters (0 = brak)
   ============================================================================ */
#mrep-table-wrapper .mrep-filters-container {
    border-width: var(--mrep-border-filters, 1px) !important;
    border-style: solid !important;
    border-color: var(--mrep-border-color, #e2e8f0) !important;
}


/* ============================================================================
   WYŚRODKOWANIE NAGŁÓWKÓW I WARTOŚCI KOLUMN (v3.5.5)
   Nazwy kolumn oraz wartości w komórkach wyśrodkowane w poziomie.
   ============================================================================ */
#mrep-table-wrapper .mrep-apartment-table th,
#mrep-table-wrapper .mrep-apartment-table td {
    text-align: center !important;
}
/* Nagłówek: ikona sortowania obok tekstu, całość wyśrodkowana */
#mrep-table-wrapper .mrep-apartment-table th {
    vertical-align: middle;
}
/* Komórki: zawartość (tekst, przyciski, ikony) wyśrodkowana */
#mrep-table-wrapper .mrep-apartment-table td {
    vertical-align: middle;
}
/* Ikona PDF z pliku pdf.png - wyśrodkowana, spójny rozmiar */
#mrep-table-wrapper .mrep-pdf-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
}
#mrep-table-wrapper .mrep-pdf-link.mrep-disabled .mrep-pdf-icon {
    opacity: 0.4;
    filter: grayscale(1);
}

/* ============================================================================
   OCHRONA PIERWSZEJ KOLUMNY TABELI (desktop)
   Starszy fork wtyczki renderował kolumnę ID jako pierwszą na froncie i
   bywała ona ukrywana własnym CSS motywu regułą na :first-child. W obecnej
   wersji ID nie jest renderowane, więc taka reguła ukrywa PIERWSZĄ WIDOCZNĄ
   kolumnę (np. Wizualizację). Wymuszamy poprawne wyświetlanie - o widoczności
   kolumn decyduje wyłącznie panel wtyczki. Zakres: tylko desktop; na mobile
   tabela używa układu blokowego (display:block) i ta reguła nie może go psuć.
   ========================================================================= */
@media screen and (min-width: 992px) {
    .mrep-table-wrapper .mrep-apartment-table thead th:first-child,
    .mrep-table-wrapper .mrep-apartment-table tbody td:first-child,
    #mrep-table-wrapper .mrep-apartment-table thead th:first-child,
    #mrep-table-wrapper .mrep-apartment-table tbody td:first-child {
        display: table-cell !important;
        visibility: visible !important;
        width: auto;
    }
}
/* Ta sama ochrona na MOBILE: tam komórki używają układu flex (karta z
   etykietą data-label), więc wymuszamy display:flex. Wyjątek: komórki
   celowo puste (.mrep-cell-empty) pozostają ukryte - to zamierzone
   zachowanie mobilnego układu, a nie skutek obcej reguły. */
@media screen and (max-width: 991px) {
    .mrep-table-wrapper .mrep-apartment-table tbody td:first-child:not(.mrep-cell-empty),
    #mrep-table-wrapper .mrep-apartment-table tbody td:first-child:not(.mrep-cell-empty) {
        display: flex !important;
        visibility: visible !important;
    }
}

/* ============================================================================
   SHORTCODE [ceny_dodatkowe] — cennik i ewidencja pozycji dodatkowych
   Style przeniesione z inline do arkusza (jedno źródło, możliwość nadpisania
   w motywie). Wariant "--list" to pełna ewidencja z oznaczeniem i statusem.
   ========================================================================= */
.mrep-extra-prices { margin: 24px 0; }
.mrep-extra-prices__note { font-weight: 600; text-align: center; margin-bottom: 18px; }
.mrep-extra-prices__title { text-align: center; margin-bottom: 14px; }
.mrep-extra-prices__table {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    border-collapse: collapse;
}
.mrep-extra-prices__table td { padding: 8px 12px; }
.mrep-extra-prices__label { text-align: left; }
.mrep-extra-prices__value { text-align: right; white-space: nowrap; font-weight: 600; }

/* Wariant z ewidencją: szersza tabela, nagłówki, oznaczenie i status */
.mrep-extra-prices--list .mrep-extra-prices__table { max-width: 900px; }
.mrep-extra-prices--list .mrep-extra-prices__table thead th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
}
.mrep-extra-prices--list .mrep-extra-prices__table thead th.mrep-extra-prices__value { text-align: right; }
.mrep-extra-prices--list .mrep-extra-prices__table tbody tr { border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
.mrep-extra-prices--list .mrep-extra-prices__desig { text-align: left; opacity: 0.85; }
.mrep-extra-prices .mrep-history-btn {
    background: none;
    border: 0;
    padding: 0 0 0 6px;
    cursor: pointer;
    color: var(--mrep-history-icon, #666);
    vertical-align: middle;
}
.mrep-extra-prices .mrep-history-btn:hover { opacity: 0.7; }
/* Pastylki statusu w shortcode (poza kontenerem tabeli mieszkań) */
.mrep-extra-prices .mrep-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
}
.mrep-extra-prices .mrep-status-available   { background-color: var(--mrep-status-available, #48bb78); }
.mrep-extra-prices .mrep-status-reserved    { background-color: var(--mrep-status-reserved, #ed8936); }
.mrep-extra-prices .mrep-status-sold        { background-color: var(--mrep-status-sold, #e53e3e); }
.mrep-extra-prices .mrep-status-unavailable { background-color: var(--mrep-status-unavailable, #6b7280); }

@media screen and (max-width: 640px) {
    .mrep-extra-prices--list .mrep-extra-prices__table thead { display: none; }
    .mrep-extra-prices--list .mrep-extra-prices__table tbody tr {
        display: block;
        padding: 10px 0;
    }
    .mrep-extra-prices--list .mrep-extra-prices__table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 12px;
        text-align: right;
    }
    .mrep-extra-prices--list .mrep-extra-prices__label { font-weight: 600; }
}

/* ============================================================================
   SHORTCODE'Y POJEDYNCZEGO LOKALU ([cena_mieszkania], [metraz_mieszkania],
   [pokoje_mieszkania], [status_mieszkania]) oraz odnośniki w komórkach tabeli.
   ========================================================================= */
.mrep-unit-field { display: block; width: 100%; margin: 0 0 14px; }
.mrep-unit-field--inline { display: inline-flex; width: auto; align-items: center; margin-bottom: 0; }

/* Wyrównanie względem kontenera, w którym osadzono shortcode.
   Motywy i buildery narzucają własne text-align na akapitach i nagłówkach,
   dlatego wymuszamy je również na elementach potomnych. */
.mrep-unit-field.mrep-align-left,
.mrep-unit-field.mrep-align-left *   { text-align: left !important; }
.mrep-unit-field.mrep-align-center,
.mrep-unit-field.mrep-align-center * { text-align: center !important; }
.mrep-unit-field.mrep-align-right,
.mrep-unit-field.mrep-align-right *  { text-align: right !important; }

/* Wartość i podpis - zerujemy marginesy nagłówków/akapitów motywu, żeby para
   "wartość + podpis" była zwarta i JEDNAKOWA dla każdego pola (wcześniej
   akapit z ceną dostawał od motywu duży margines dolny, a status - żaden). */
.mrep-unit-field > .mrep-unit-field__value {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.15 !important;
}
.mrep-unit-field > .mrep-unit-field__label {
    margin: 6px 0 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    opacity: 0.75;
}
/* Odstęp podpisu od wartości - sterowany atrybutem podpis_odstep.
   Klasy zamiast stylu inline, bo wtyczki zabezpieczające potrafią
   usuwać atrybut style z treści generowanej przez shortcode. */
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-0  { margin-top: 0 !important; }
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-2  { margin-top: 2px !important; }
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-4  { margin-top: 4px !important; }
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-6  { margin-top: 6px !important; }
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-8  { margin-top: 8px !important; }
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-10 { margin-top: 10px !important; }
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-12 { margin-top: 12px !important; }
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-15 { margin-top: 15px !important; }
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-16 { margin-top: 16px !important; }
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-20 { margin-top: 20px !important; }
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-24 { margin-top: 24px !important; }
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-30 { margin-top: 30px !important; }
.mrep-unit-field > .mrep-unit-field__label.mrep-gap-40 { margin-top: 40px !important; }
.mrep-unit-field .mrep-bold { font-weight: 700; }
.mrep-unit-field__prefix { opacity: 0.8; font-weight: 400; }

/* Ikona historii cen — TWARDY reset. Motywy stylują każdy <button>
   (tło, ramka, padding, min-height), przez co ikona rozrastała się do
   rozmiarów kafla. Rozmiar sterowany zmienną --mrep-icon-size. */
.mrep-unit-field .mrep-history-btn:hover { opacity: 1 !important; }
.mrep-unit-field .mrep-history-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.mrep-unit-field .mrep-history-btn,
.mrep-extra-prices .mrep-history-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none;
    padding: 0 !important;
    margin: 0 0 0 6px !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.mrep-unit-field .mrep-history-btn:hover,
.mrep-extra-prices .mrep-history-btn:hover { opacity: 1; }
/* Rozmiar ikony - klasy odpowiadające atrybutowi ikona_rozmiar.
   Wymiary są dodatkowo zapisane jako atrybuty width/height na <svg>,
   więc ikona pozostaje mała nawet bez tego arkusza stylów. */
.mrep-unit-field .mrep-history-btn svg,
.mrep-extra-prices .mrep-history-btn svg { display: block; width: 100%; height: 100%; }
.mrep-history-btn--auto { width: 1em !important;  height: 1em !important; }
.mrep-history-btn--sm   { width: 14px !important; height: 14px !important; }
.mrep-history-btn--md   { width: 18px !important; height: 18px !important; }
.mrep-history-btn--lg   { width: 24px !important; height: 24px !important; }
/* Zabezpieczenie globalne: ikona historii nigdy nie może urosnąć
   ponad rozmiar tekstu, nawet gdy motyw skaluje wszystkie <svg>. */
.mrep-history-btn { max-width: 2em; max-height: 2em; overflow: hidden; }
.mrep-extra-prices .mrep-history-btn svg { width: 14px; height: 14px; display: block; }

/* Status na karcie lokalu */
.mrep-unit-field .mrep-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 500;
    color: #fff;
    vertical-align: middle;
}
.mrep-unit-field .mrep-status-available   { background-color: var(--mrep-status-available, #48bb78); }
.mrep-unit-field .mrep-status-reserved    { background-color: var(--mrep-status-reserved, #ed8936); }
.mrep-unit-field .mrep-status-sold        { background-color: var(--mrep-status-sold, #e53e3e); }
.mrep-unit-field .mrep-status-unavailable { background-color: var(--mrep-status-unavailable, #6b7280); }
/* pastylka="0" — sam tekst w kolorze statusu, dziedziczy rozmiar nagłówka */
.mrep-unit-field .mrep-status--text {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}
.mrep-unit-field .mrep-status-available.mrep-status--text   { color: var(--mrep-status-available, #48bb78) !important; }
.mrep-unit-field .mrep-status-reserved.mrep-status--text    { color: var(--mrep-status-reserved, #ed8936) !important; }
.mrep-unit-field .mrep-status-sold.mrep-status--text        { color: var(--mrep-status-sold, #e53e3e) !important; }
.mrep-unit-field .mrep-status-unavailable.mrep-status--text { color: var(--mrep-status-unavailable, #6b7280) !important; }

/* Komunikat widoczny wyłącznie dla administratora */
.mrep-single-price--error { color: #b32d2e; font-size: 13px; }

/* Odnośnik w komórce tabeli (nazwa lokalu -> karta informacyjna).
   Motywy stylują <a> własną wielkością i krojem czcionki, przez co nazwa
   lokalu odstawała od reszty tabeli. Wymuszamy pełne dziedziczenie
   typografii z komórki - odnośnik ma wyglądać jak zwykły tekst, tylko
   z subtelnym podkreśleniem. */
.mrep-apartment-table .mrep-cell-link,
.mrep-apartment-table .mrep-cell-link:visited {
    font: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    font-style: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
    text-transform: inherit !important;
    color: inherit !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: currentColor;
    opacity: 1;
    transition: opacity 0.15s ease;
}
.mrep-apartment-table .mrep-cell-link:hover { opacity: 0.65; }
/* Zabezpieczenie: w wierszu wyszarzonym odnośnik nie reaguje na kliknięcie,
   nawet gdyby trafił tam ze starszego cache HTML. */
.mrep-apartment-table tr.mrep-row-sold .mrep-cell-link {
    pointer-events: none;
    text-decoration: none;
}
