/* ============================================
   INFINITY OS - TABLE PRIMITIVES
   Shared table wrappers and density rules
   ============================================ */

.infinity-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.infinity-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.875rem;
}

.infinity-table thead th {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    background: rgba(0, 240, 255, 0.05);
    border-bottom: 2px solid rgba(0, 240, 255, 0.28);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

.infinity-table tbody td {
    padding: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    vertical-align: top;
}

.infinity-table tbody tr:hover {
    background: rgba(0, 240, 255, 0.03);
}

.infinity-table .numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.infinity-table td.text-right,
.infinity-table th.text-right,
.infinity-table .text-right {
    text-align: right;
}

.table-meta-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
/* ============================================
   PHASE 4 — TABLE DENSITY & POLISH
   Alternating rows, status columns, empty rows
   ============================================ */

/* Subtle alternating rows for dense tables */
.infinity-table--striped tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

/* Row highlight (important row) */
.infinity-table tbody tr.row-highlight {
    background: rgba(0, 240, 255, 0.04);
    border-left: 2px solid var(--neon-cyan);
}

/* Row warning state */
.infinity-table tbody tr.row-warning {
    background: rgba(255, 193, 7, 0.04);
}

/* Row error state */
.infinity-table tbody tr.row-error {
    background: rgba(255, 107, 129, 0.05);
}

/* Empty table row */
.table-empty-row td {
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    border-bottom: none;
}

/* Right-align action column */
.table-action-col {
    text-align: right;
    white-space: nowrap;
}

/* Numeric column alignment */
.table-num-col {
    text-align: right;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* Compact table variant */
.infinity-table--compact thead th {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.6875rem;
}

.infinity-table--compact tbody td {
    padding: var(--space-sm);
    font-size: 0.8125rem;
}

/* Borderless table for inside cards */
.infinity-table--flush {
    margin: 0 calc(-1 * var(--space-lg));
    width: calc(100% + 2 * var(--space-lg));
}

/* ============================================
   PHASE 5 — DENSE WORK SURFACE REFINEMENTS
   Table row hover, inline badges, action clusters
   ============================================ */

/* Row hover with left-accent transit */
.infinity-table tbody tr {
    transition:
        background 140ms ease,
        border-color 140ms ease;
    border-left: 2px solid transparent;
}

.infinity-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
    border-left-color: rgba(0, 240, 255, 0.25);
}

/* Client portal table rows hover with magenta accent */
.app-client-portal .infinity-table tbody tr:hover {
    border-left-color: rgba(255, 0, 170, 0.25);
}

/* Employee portal: green accent hover */
.app-employee-portal .infinity-table tbody tr:hover {
    border-left-color: rgba(0, 255, 136, 0.25);
}

/* Inline badge in a table cell — tight sizing */
.infinity-table .inline-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Table action cell — icon cluster row */
.infinity-table .td-actions {
    white-space: nowrap;
    text-align: right;
    padding-right: var(--space-md);
}

.infinity-table .td-actions .action-cluster {
    opacity: 0.6;
    transition: opacity 140ms ease;
}

.infinity-table tbody tr:hover .td-actions .action-cluster {
    opacity: 1;
}

/* Scroll container with rounded clip */
.table-scroll-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}

.table-scroll-container .infinity-table {
    border: none;
    border-radius: 0;
    margin: 0;
}

/* Dense table variant — tighter row height */
.infinity-table--dense tbody td,
.infinity-table--dense tbody th {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* Status dot — compact presence indicator beside badge */
.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot--active { background: var(--neon-green); box-shadow: 0 0 6px rgba(0, 255, 136, 0.6); }
.status-dot--pending { background: var(--color-warning); box-shadow: 0 0 6px rgba(251, 146, 60, 0.5); }
.status-dot--inactive { background: var(--text-tertiary); }
.status-dot--error { background: var(--color-error); box-shadow: 0 0 6px rgba(255, 107, 129, 0.5); }
