/* ===== DATA TABLES ===== */
.table-wc {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-bg-card);
    border-radius: 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.table-wc thead th {
    background-color: var(--color-primary);
    color: var(--color-white);
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid var(--color-primary-dark);
}

.table-wc thead th:first-child {
    border-top-left-radius: 0;
}

.table-wc thead th:last-child {
    border-top-right-radius: 0;
}

.table-wc tbody td {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

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

.table-wc tbody tr:hover {
    background-color: #F1F5F9;
}

.table-wc tbody tr.row-highlight {
    background-color: #EFF6FF;
}

/* Sortable header */
.table-wc thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.table-wc thead th.sortable::after {
    content: ' \25B4\25BE';
    font-size: 0.65em;
    opacity: 0.5;
    margin-left: var(--spacing-xs);
}

/* Links: visited state */
.table-wc a {
    color: var(--color-accent);
    text-decoration: none;
}

.table-wc a:hover {
    text-decoration: underline;
}

.table-wc a:visited {
    color: var(--color-text-heading);
}

/* Cell highlights */
.table-wc .cell-success {
    background-color: #DCFCE7;
    color: #166534;
    font-weight: 600;
}

.table-wc .cell-danger {
    background-color: #FEE2E2;
    color: #991B1B;
    font-weight: 600;
}

/* Table wrapper for responsive */
.table-wc-wrapper {
    overflow-x: auto;
    border-radius: 0;
    box-shadow: var(--shadow-sm);
}

.table-wc-wrapper .table-wc {
    box-shadow: none;
    border: none;
}

/* Compact table variant — fits many columns without horizontal scroll */
.table-wc-compact thead th {
    padding: var(--spacing-sm) var(--spacing-sm);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}

.table-wc-compact tbody td {
    padding: var(--spacing-sm) var(--spacing-sm);
    font-size: var(--font-size-xs);
}

.table-wc-compact .btn-sm,
.table-wc-compact .btn-wc-sm {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

/* Same owner/titular highlight (lowest priority) */
.table-wc tbody tr.row-same-owner td {
    background-color: #DBEAFE;
}

/* Row status highlights (override same-owner) */
.table-wc tbody tr.row-match td,
.table-wc tbody tr.row-same-owner.row-match td {
    background-color: #DCFCE7;
}

.table-wc tbody tr.row-nomatch td,
.table-wc tbody tr.row-same-owner.row-nomatch td {
    background-color: #FEE2E2;
}
