/* Clean Table System - Refined SaaS Style */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.table thead th {
    background-color: var(--background);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.table tbody td {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
    background-color: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.table-row-hover:hover td {
    background-color: rgba(79, 106, 246, 0.05);
}

.table tfoot td {
    background-color: var(--background);
    border-top: 2px solid var(--border);
}

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

/* Badge System - Standardized Colors */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-paid,
.badge-active,
.badge-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.badge-unpaid,
.badge-pending,
.badge-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.badge-overdue,
.badge-danger {
    background-color: #FEE2E2;
    color: #B91C1C;
}

.badge-draft,
.badge-inactive,
.badge-secondary {
    background-color: #E5E7EB;
    color: #374151;
}

.badge-info {
    background-color: #DBEAFE;
    color: #1E40AF;
}

[data-theme='dark'] .table thead th {
    background-color: #111827;
    border-bottom-color: #334155;
}

[data-theme='dark'] .table tbody td {
    border-bottom-color: #1f2937;
}

[data-theme='dark'] .table tfoot td {
    background-color: #111827;
    border-top-color: #334155;
}

[data-theme='dark'] .table-row-hover:hover td {
    background-color: rgba(51, 65, 85, 0.45);
}

[data-theme='dark'] .badge-paid,
[data-theme='dark'] .badge-active,
[data-theme='dark'] .badge-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: #86efac;
}

[data-theme='dark'] .badge-unpaid,
[data-theme='dark'] .badge-pending,
[data-theme='dark'] .badge-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

[data-theme='dark'] .badge-overdue,
[data-theme='dark'] .badge-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

[data-theme='dark'] .badge-draft,
[data-theme='dark'] .badge-inactive,
[data-theme='dark'] .badge-secondary {
    background-color: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

[data-theme='dark'] .badge-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* Action Buttons in Tables */
.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-table-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.btn-table-action:hover {
    background-color: var(--sidebar-hover);
    color: var(--primary);
}

.btn-table-action.text-danger:hover {
    background-color: #FEF2F2;
    color: var(--danger);
}

@media (max-width: 1024px) {
    .table thead th {
        padding: 14px 16px;
        font-size: 10px;
    }

    .table tbody td,
    .table tfoot td {
        padding: 14px 16px;
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    .table thead th {
        padding: 12px 12px;
    }

    .table tbody td,
    .table tfoot td {
        padding: 12px;
        font-size: 12px;
    }

    .table-actions {
        gap: 6px;
    }
}