/*
 * Table Styles
 *
 * This file contains all table component styles including:
 * - Data tables
 * - Leads tables
 * - Table wrappers and containers
 * - Status badges
 * - Responsive table adjustments
 */

.table-wrapper {
    max-height: 350px;
    overflow-y: auto;
}

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

.data-table th, .data-table td {
    padding: 16px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.data-table td {
    color: var(--text-primary);
}

/* Leads Table Container */
.leads-table-container {
    overflow-x: auto;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    max-width: 100%;
}

.leads-table {
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: fixed;
}

.leads-table thead {
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
}

.leads-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.leads-table th:nth-child(1) { width: 15%; } /* Nombre */
.leads-table th:nth-child(2) { width: 18%; } /* Seguro */
.leads-table th:nth-child(3) { width: 15%; } /* Status */
.leads-table th:nth-child(4) { width: 14%; } /* Fecha Creación */
.leads-table th:nth-child(5) { width: 14%; } /* Fecha Cita */
.leads-table th:nth-child(6) { width: 4%; }  /* Detalles */

.leads-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.leads-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.leads-table td {
    padding: 12px;
    color: var(--text-primary);
    vertical-align: middle;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 0;
}

.lead-name-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.lead-phone-cell, .lead-email-cell {
    color: var(--text-secondary);
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--success);
    color: white;
}

.status-badge-small {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* List Headers and Controls */
.list-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.list-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.list-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.list-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .leads-table-container {
        display: none;
    }

    .list-filters {
        width: 100%;
    }

    .list-filters select {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 767px) {
    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .list-title {
        font-size: 1.25rem;
    }

    .data-table th,
    .data-table td {
        padding: 12px 8px;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .last-update {
        font-size: 0.75rem;
        width: 100%;
        justify-content: flex-start;
    }
}
