/* Estructura estándar de tabla: nada de display:block en thead/tbody/tr */
.users-datagrid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* columnas estables */
}

.users-datagrid thead,
.users-datagrid tbody,
.users-datagrid tr,
.users-datagrid td,
.users-datagrid th {
    display: table;      /* fuerza layout de tabla */
    width: auto;         /* evita colapsos raros */
    visibility: visible; /* por si hereda hidden */
    color: inherit;      /* por si hereda transparent */
}

.users-datagrid thead th {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    background: #34495e;
    color: white;
}

.users-datagrid tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f1f1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.users-datagrid .actions .btn {
    margin-right: 6px;
}

.badge-success { 
    background: #e6f4ea; 
    color: #1e7e34; 
    padding: 2px 8px; 
    border-radius: 999px; 
}

.badge-muted { 
    background: #f3f4f6; 
    color: #6b7280; 
    padding: 2px 8px; 
    border-radius: 999px; 
}

/* IMPORTANTES para evitar grids/scrolls que rompen la tabla */
.users-datagrid thead { 
    position: static; 
    display: table-header-group !important;
}

.users-datagrid tbody { 
    display: table-row-group !important; 
}

.users-datagrid tr { 
    display: table-row !important; 
}

.users-datagrid td,
.users-datagrid th { 
    display: table-cell !important; 
}

.users-datagrid-container * {
    visibility: inherit !important;
    color: inherit !important;
}

/* Contenedor principal */
.users-datagrid-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    padding: 15px;
}

/* Estadísticas */
.users-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    background: #3498db;
    color: white;
    padding: 15px;
    border-radius: 8px;
    flex: 1;
    min-width: 150px;
}

.stat-card:nth-child(2) {
    background: #27ae60;
}

.stat-card:nth-child(3) {
    background: #e74c3c;
}

/* Controles */
.datagrid-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.datagrid-search {
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.datagrid-filters {
    display: flex;
    gap: 10px;
}

.datagrid-filters select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.datagrid-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

/* Wrapper de la tabla */
.datagrid-wrapper {
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Paginación */
.datagrid-pagination {
    margin-top: 15px;
    text-align: center;
}

.pagination-info {
    color: #7f8c8d;
    font-size: 14px;
}
