/* Table styles - Mobile First */

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: inherit;
    margin: 1rem 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: calc(var(--radius) + 2px);
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
    min-width: 600px;
}

.data-table thead {
    background: rgba(245, 245, 245, 0.95);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    vertical-align: middle;
    font-size: 0.85rem;
}

.data-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--grey-color);
    font-weight: 700;
    padding: 0.65rem;
}

.data-table td {
    word-break: break-word;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(219, 39, 119, 0.05);
}

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

.data-table .input--compact {
    width: 100%;
    min-width: 50px;
    padding: 0.5rem;
    font-size: 0.8rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 0.375rem;
    background: #fff;
}

.data-table .input--compact:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(219, 39, 119, 0.1);
}

.data-table .button--danger {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.date-cell,
.meta-text {
    color: var(--text-light);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Tablet breakpoint (641px - 900px) */
@media (min-width: 641px) {
    .table-wrapper {
        margin: 1.5rem 0;
    }

    .data-table {
        min-width: auto;
    }

    .data-table th,
    .data-table td {
        padding: 0.9rem 1rem;
        font-size: 0.9rem;
    }

    .data-table th {
        font-size: 0.85rem;
        padding: 0.85rem 1rem;
    }

    .data-table .input--compact {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }

    .data-table .button--danger {
        padding: 0.5rem 0.9rem;
        font-size: 0.8rem;
    }

    .date-cell,
    .meta-text {
        font-size: 0.9rem;
    }
}

/* Desktop (901px+) */
@media (min-width: 901px) {
    .data-table th,
    .data-table td {
        padding: 1rem 1.2rem;
        font-size: 0.95rem;
    }

    .data-table th {
        font-size: 0.9rem;
        padding: 1rem 1.2rem;
    }

    .data-table .input--compact {
        padding: 0.65rem 0.9rem;
        font-size: 0.9rem;
    }

    .data-table .button--danger {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .date-cell,
    .meta-text {
        font-size: 0.95rem;
    }

    .data-table tbody tr:hover {
        background: rgba(219, 39, 119, 0.08);
    }
}

/* Mobilní zařízení (max 640px) - Card Layout */
/* Mobilní zařízení (max 640px) - Card Layout */
@media (max-width: 640px) {
    .table-wrapper {
        margin: 0.85rem 0;          /* Změněno z -1rem na 0 pro zamezení přetékání */
        border-radius: 0;
        padding: 0;
        width: 100%;                /* Garantuje plnou šířku */
        box-sizing: border-box;
    }

    .data-table {
        min-width: 0 !important;    /* Klíčové: Přebije původních 600px, aby tabulka mohla splasknout */
        width: 100%;
        box-sizing: border-box;
        border-radius: 0;
        border: none;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
        background: transparent;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
        width: 100%;
        box-sizing: border-box;
    }

    .data-table tr {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
        background: var(--bg-white);
        border: 1px solid rgba(15, 23, 42, 0.08);
        border-left: none;          /* Odstraní boční linky, aby karta lícovala s okrajem */
        border-right: none;
        border-radius: 0;           /* Zruší zaoblení na mobilu (bude od kraje ke kraji) */
        padding: 0.85rem;
        box-shadow: var(--shadow-subtle);
        width: 100%;
        box-sizing: border-box;     /* Padding se počítá dovnitř šířky */
    }

    .data-table tr:hover {
        box-shadow: var(--shadow-hover);
    }

    .data-table td {
        display: grid;
        grid-template-columns: minmax(80px, auto) 1fr; /* Mírně zvětšeno pro štítky */
        gap: 0.5rem;
        align-items: center;
        padding: 0;
        border: none;
        font-size: 0.85rem;
        word-break: break-all;      /* Agresivnější zalomení, kdyby byl text (např. URL) moc dlouhý */
        width: 100%;
        box-sizing: border-box;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-color);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        opacity: 0.65;
    }

    .data-table td strong {
        font-weight: 700;
        word-break: break-word;
        font-size: 0.85rem;
    }

    /* Input styling v kartách */
    .data-table .input--compact {
        width: 100%;
        box-sizing: border-box;     /* Zamezí přetečení inputu z buňky */
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
        border: 1px solid rgba(15, 23, 42, 0.12);
        border-radius: 0.4rem;
        background: rgba(245, 245, 245, 0.6);
    }

    .data-table .input--compact:focus {
        outline: none;
        border-color: var(--primary-color);
        background: #fff;
        box-shadow: 0 0 0 3px rgba(219, 39, 119, 0.1);
    }

    /* Button styling v kartách */
    .data-table .button--danger {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        width: 100%;
        box-sizing: border-box;
        margin-top: 0;
    }

    /* Date cells */
    .data-table td.date-cell {
        grid-template-columns: minmax(80px, auto) 1fr;
    }

    /* Poslední td v kartě (akce) */
    .data-table td:last-child {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        padding-top: 0.6rem;
        border-top: 1px solid rgba(15, 23, 42, 0.08);
        margin-top: 0.4rem;
        width: 100%;
        box-sizing: border-box;
    }

    .data-table td:last-child::before {
        padding-bottom: 0.3rem;
    }

    .data-table td:last-child .button--danger {
        width: 100%;
        margin-top: 0;
    }

    /* Empty state styling */
    .data-table tr .empty-state {
        display: none;
    }

    .data-table tbody:only-child tr .empty-state {
        display: flex;
        padding: 2rem 1rem;
    }
}


