/* ==========================================================================
   tables.css - Estilos para Tablas de Datos (v7 - Fondo Blanco Botones Acción)
   ========================================================================== */

   .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 1.5rem; border: 1px solid var(--border-color); border-radius: var(--button-border-radius); box-shadow: 0 2px 4px var(--shadow-color); position: relative; }
   .licenses-table-container { border-radius: var(--card-border-radius); overflow: hidden; }
   .table-responsive::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 30px; background: var(--table-scroll-indicator); pointer-events: none; opacity: 0; transition: opacity 0.3s ease; }
   .table-responsive:hover::after { /* opacity: 1; */ }
   
   /* Estilo base tabla de datos */
   .data-table { width: 100%; border-collapse: collapse; background-color: var(--secondary-color); font-size: 0.9rem; }
   
   /* Cabecera Tabla Genérica */
   .data-table thead th { background-color: var(--primary-color); color: var(--text-light); padding: 0.8rem 1rem; text-align: left; font-weight: 600; border-bottom: 2px solid var(--primary-dark); white-space: nowrap; position: sticky; top: 0; z-index: 10; }
   .data-table thead th a { text-decoration: none; color: inherit; display: block; } .data-table thead th a:hover { color: rgba(255,255,255,0.8); }
   .sort-indicator { margin-left: 0.5em; font-size: 0.8em; opacity: 0.7; display: inline-block; } .sort-indicator-inactive { margin-left: 0.5em; font-size: 0.8em; opacity: 0.3; color: inherit; display: inline-block; }
   .data-table thead th:has(input[type="checkbox"]), .data-table tbody td:has(input[type="checkbox"]) { width: 40px; text-align: center; padding-left: 0.5rem; padding-right: 0.5rem; }
   .data-table thead th:has(.avatar-initials), .data-table tbody td:has(.avatar-initials) { width: 50px; text-align: center; padding-left: 0.5rem; padding-right: 0.5rem; }
   
   /* Cuerpo Tabla Genérico */
   .data-table tbody td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--border-color); color: var(--table-text-color); vertical-align: middle; transition: background-color 0.15s ease-in-out; }
   .data-table tbody tr:last-child td { border-bottom: none; }
   .data-table td input[type="checkbox"], .data-table th input[type="checkbox"] { cursor: pointer; width: 16px; height: 16px; vertical-align: middle; margin: 0; }
   
   /* Coloreado Filas por Sexo */
   .data-table tbody tr:nth-child(even):not(.row-female):not(.row-male) { background-color: #fdfdfd; }
   .data-table tbody tr.row-female { background-color: var(--row-female-bg); }
   .data-table tbody tr.row-male { background-color: var(--row-male-bg); }
   
   /* Coloreado Filas por Estado de Pago */
   .data-table tbody tr.row-payment-review { 
       background-color: #d4edda !important; /* Verde claro */
       border-left: 4px solid #28a745 !important; /* Verde oscuro */
   }
   .data-table tbody tr.row-payment-pending { 
       background-color: #f8d7da !important; /* Rojo claro */
       border-left: 4px solid #dc3545 !important; /* Rojo oscuro */
   }
   
   /* Estilos más específicos para tramitadas-espera-licenses-table */
   .tramitadas-espera-licenses-table tbody tr.row-payment-review { 
       background-color: #d4edda !important; /* Verde claro */
       border-left: 4px solid #28a745 !important; /* Verde oscuro */
   }
   .tramitadas-espera-licenses-table tbody tr.row-payment-pending { 
       background-color: #f8d7da !important; /* Rojo claro */
       border-left: 4px solid #dc3545 !important; /* Rojo oscuro */
   }
   /* Hover Effects */
   .data-table tbody tr:hover { background-color: #e9ecef !important; color: var(--table-text-color); }
   
   /* Avatar */
   .avatar-initials { display: inline-block; width: var(--avatar-size); height: var(--avatar-size); line-height: var(--avatar-size); border-radius: 50%; background-color: var(--avatar-other-bg); color: var(--text-light); text-align: center; font-size: 0.85em; font-weight: 600; vertical-align: middle; text-transform: uppercase; user-select: none; -webkit-user-select: none; -moz-user-select: none; }
   .avatar-male { background-color: var(--avatar-male-bg); } .avatar-female { background-color: var(--avatar-female-bg); }
   .data-table tbody td:nth-child(9) { white-space: nowrap; } /* Fecha Nac en tabla completa */
   
   /* Pie de Tabla (Resumen) */
   .data-table tfoot td.table-summary { padding: 0.9rem 1rem; font-weight: 600; font-size: 0.9em; text-align: right; border-top: 2px solid var(--primary-dark); background-color: #f1f3f5; color: var(--text-color); }
   #selected-count-display { display: inline-block; margin-left: 0.3rem; font-weight: bold; }
   
   /* Contenedor Tabla Seleccionados (Generada por JS) */
   #selected-athletes-container { margin-top: 2rem; padding-top: 1.5rem; border-top: 2px solid var(--primary-color); }
   #selected-athletes-container h4 { margin-bottom: 1rem; color: var(--primary-dark); font-weight: 600; }
   #selected-athletes-container .data-table { min-width: 0; }
   #selected-athletes-container .table-responsive { box-shadow: none; border-color: #ccc; }
   
   /* --- Estilos Específicos Tabla Licencias (.licenses-table) --- */
   .licenses-table { border-collapse: separate; border-spacing: 0; }
   .licenses-table thead th { background-color: var(--primary-dark); border-color: #0000001a; color: var(--text-light); font-size: 0.8rem; text-align: center; padding: 0.6rem 0.5rem; }
   .licenses-table thead th:first-child { text-align: center; padding-left: 1rem;} /* ID Centrado */
   .licenses-table thead th:nth-child(2) { text-align: left; } /* Deportista */
   .licenses-table thead th:last-child { text-align: center; padding-right: 1rem;} /* Acciones */
   .licenses-table tbody td { font-size: 0.85rem; padding: 0.7rem 0.5rem; }
   .licenses-table td.actions-cell { text-align: center; white-space: nowrap; padding: 0.4rem 0.5rem; }
   
   /* Botones de acción circulares (ACTUALIZADO FONDO) */
   .actions-cell .action-btn {
       display: inline-flex; align-items: center; justify-content: center;
       width: 30px; height: 30px; padding: 0; margin: 0 2px;
       border: 1px solid var(--border-color); /* Borde gris claro por defecto */
       border-radius: 50%;
       background-color: var(--secondary-color); /* <<< FONDO BLANCO */
       color: var(--text-muted);
       font-size: 0.9em;
       cursor: pointer; transition: all 0.2s ease;
   }
   .actions-cell .action-btn:hover {
       border-color: #adb5bd;
       background-color: #e9ecef; /* Fondo gris claro en hover */
       transform: scale(1.1);
       box-shadow: 0 1px 3px rgba(0,0,0,0.1);
       /* Icon color on hover */
   }
   .actions-cell .action-btn.view:hover { color: #0d6efd; }
   .actions-cell .action-btn.edit:hover { color: #ffc107; }
   .actions-cell .action-btn.download:hover { color: var(--primary-color); }
   .actions-cell .action-btn.upload-doc:hover { color: #fd7e14; }
   .actions-cell .action-btn.delete:hover { color: #dc3545; }
   
   /* Insignias de Estado (status-badge) */
   .status-badge { display: inline-block; padding: 0.3em 0.65em; font-size: 0.78em; font-weight: 600; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: var(--button-border-radius); color: #fff; background-color: var(--status-default-bg); }
   .status-badge.status-activa { background-color: var(--status-active-bg); } .status-badge.status-pendiente { background-color: var(--status-pending-bg); } .status-badge.status-caducada { background-color: var(--status-expired-bg); } .status-badge.status-desconocido { background-color: var(--status-default-bg); }
   
   /* --- Tabla Simple (Ya no se usa en clubes.php) --- */
   /* .recent-registrations .table-responsive-simple { ... } */
   /* .simple-table { ... } */
   
   
   /* --- Responsive Tablas --- */
   @media (max-width: 992px) { /* .data-table { min-width: 800px; } */ }
   @media (max-width: 768px) {
        .data-table { font-size: 0.8rem; min-width: 0; }
        .data-table thead th, .data-table tbody td { padding: 0.6rem 0.4rem; }
        .data-table tfoot td.table-summary { padding: 0.8rem; font-size: 0.8em; text-align: left; }
        .avatar-initials { width: 28px; height: 28px; line-height: 28px; font-size: 0.7em; }
        .data-table thead th:has(input[type="checkbox"]) { width: 28px; } .data-table thead th:has(.avatar-initials) { width: 35px; }
        .data-table td input[type="checkbox"], .data-table th input[type="checkbox"] { width: 14px; height: 14px; }
        .table-responsive::after { opacity: 0.6; }
        .licenses-table thead th { font-size: 0.7rem; padding: 0.5rem 0.3rem;}
        .licenses-table tbody td { font-size: 0.75rem; padding: 0.5rem 0.3rem;}
        .licenses-table td.actions-cell { white-space: normal; }
        .licenses-table td.actions-cell .action-btn { width: 28px; height: 28px; font-size: 0.8rem; margin: 2px 1px;} /* Botones acción más pequeños */
        .status-badge { font-size: 0.7em; padding: 0.2em 0.45em;}
   }