/* Moduł Umów — style współdzielone między komponentami */

.ct-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.ct-list-head h1 {
    font-size: 1.4rem;
    margin: 0;
}

.ct-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6B7280;
}

.ct-empty .material-icons-round {
    font-size: 3rem;
    color: #D1D5DB;
    display: block;
    margin-bottom: 0.75rem;
}

.ct-empty p {
    margin: 0 0 1rem;
}

.ct-quota-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #6B7280;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    padding: 0.35rem 0.75rem;
}

.ct-quota-bar--warn {
    background: #FFF7ED;
    border-color: #FED7AA;
    color: #92400E;
}

.ct-quota-bar--warn .material-icons-round {
    font-size: 1rem;
    color: #F97316;
}

.ct-quota-reset { color: #9CA3AF; }

.ct-quota-upgrade {
    font-weight: 600;
    color: #2563EB;
    text-decoration: none;
    margin-left: 0.25rem;
    white-space: nowrap;
}

.ct-quota-upgrade:hover { text-decoration: underline; }

.ct-search-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.ct-search-wrap .material-icons-round {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 1.1rem;
    pointer-events: none;
}

.ct-search {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.875rem 0.6rem 2.4rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.6rem;
    font-size: 0.9rem;
    background: #fff;
    color: #111827;
    transition: border-color 0.15s;
}

.ct-search:focus {
    outline: none;
    border-color: #2563EB;
}

.ct-table-wrap {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 1rem;
    overflow: hidden;
}

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

.ct-table thead th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6B7280;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #E5E7EB;
    background: #F9FAFB;
}

.ct-table tbody td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #F3F4F6;
    font-size: 0.9rem;
    color: #111827;
}

.ct-row {
    cursor: pointer;
    transition: background 0.12s;
}

.ct-row:hover {
    background: #F9FAFB;
}

.ct-title {
    font-weight: 600;
}

.ct-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #F3F4F6;
    color: #374151;
}

.ct-badge-ok { background: #DCFCE7; color: #166534; }
.ct-badge-bad { background: #FEE2E2; color: #991B1B; }
.ct-badge-info { background: #DBEAFE; color: #1E40AF; }
.ct-badge-muted { background: #F3F4F6; color: #6B7280; }

.ct-yes {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #166534;
    font-weight: 600;
}

.ct-yes .material-icons-round { font-size: 1rem; }
.ct-no { color: #9CA3AF; }

/* Status wbudowany w tytuł — widoczny tylko na mobile */
.ct-inline-status { display: none; }

/* Podgląd PDF — natywny iframe */
.pdfv-frame {
    width: 100%;
    aspect-ratio: 1 / 1.414; /* proporcje A4 — ~jedna strona */
    max-height: 85vh;
    border: 1px solid #E5E7EB;
    border-radius: 0.6rem;
    background: #fff;
}

/* Podgląd PDF (PDF.js — pozostawione awaryjnie) */
.pdfv-container {
    background: #525659;
    border-radius: 0.75rem;
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
    text-align: center;
}

.pdfv-page {
    display: block;
    margin: 0 auto 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    background: #fff;
}

.pdfv-loading, .pdfv-error {
    color: #E5E7EB;
    padding: 2rem;
    font-size: 0.9rem;
}

.pdfv-error a { color: #93C5FD; }

/* Responsywna tabela na mobile — karty */
@media (max-width: 720px) {
    .ct-table thead { display: none; }
    .ct-table, .ct-table tbody, .ct-table tr, .ct-table td { display: block; width: 100%; }

    .ct-table tr {
        border-bottom: 2px solid #E5E7EB;
        padding: 0.65rem 0;
    }

    .ct-table tbody td {
        border: none;
        padding: 0.4rem 1rem;
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.75rem;
        border-bottom: 1px solid #F3F4F6;
    }

    .ct-table tbody td:last-child {
        border-bottom: none;
    }

    .ct-table tbody td::before {
        content: attr(data-label);
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #9CA3AF;
        font-weight: 600;
        flex-shrink: 0;
    }

    /* Ukryj osobną kolumnę Status — status jest teraz wbudowany przy tytule */
    .ct-status-col {
        display: none;
    }

    /* Tytuł jako header karty — z wbudowanym statusem obok */
    .ct-table tbody td[data-label="Tytuł"] {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 0.5rem;
        font-size: 0.95rem;
    }

    .ct-table tbody td[data-label="Tytuł"]::before {
        display: none;
    }

    .ct-inline-status {
        display: inline-block;
        flex-shrink: 0;
    }
}
