/* ============================================================
   Dubai Property Lab — Table Component
   Source: Brand Reference §5, Module Library M5
   ============================================================ */

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

.dpl-table thead th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    background: var(--slate);
    padding: var(--space-3) var(--space-4);
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 80;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-default);
}

.dpl-table thead th:hover {
    color: var(--signal);
}

.dpl-table thead th.sort-active {
    color: var(--signal);
}

/* Numeric columns right-aligned */
.dpl-table thead th.col-numeric {
    text-align: right;
}

.dpl-table tbody td {
    font-size: 14px;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--surface);
    vertical-align: middle;
    min-height: 48px;
    line-height: 48px;
}

.dpl-table tbody td.col-numeric {
    text-align: right;
    font-family: var(--font-mono);
}

.dpl-table tbody tr {
    transition: background var(--transition-fast);
}

.dpl-table tbody tr:hover {
    background: var(--elevated);
    cursor: pointer;
}

/* Sort indicator arrows */
.sort-arrow {
    display: inline-block;
    margin-left: var(--space-1);
    font-size: 10px;
    opacity: 0.4;
}

.sort-active .sort-arrow {
    opacity: 1;
    color: var(--signal);
}

/* Change cells */
.dpl-table .cell-positive {
    color: var(--viz-positive);
}

.dpl-table .cell-negative {
    color: var(--viz-negative);
}

/* Responsive: hide columns on smaller screens */
@media (max-width: 1199px) {
    .dpl-table .col-hide-tablet {
        display: none;
    }
}

@media (max-width: 767px) {
    .dpl-table .col-hide-mobile {
        display: none;
    }

    .dpl-table thead th,
    .dpl-table tbody td {
        padding: var(--space-2) var(--space-3);
        font-size: 13px;
    }
}
