/**
 * Estilos del Inspector de Base de Datos
 * Sistema de Consultoría TurfSoft
 */

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Arial, sans-serif;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    background: #f7f7fb;
    color: #222;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.container.with-sidebar {
    margin-left: 260px;
    padding: 24px;
    max-width: calc(100vw - 280px);
}

h1 {
    font-size: 24px;
    margin: 0 0 16px;
}

/* Formulario de credenciales fijo */
.credentials-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
    position: sticky;
    top: 0;
    z-index: 100;
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

label {
    font-size: 12px;
    color: #444;
    display: block;
    margin-bottom: 6px;
}

input[type=text],
input[type=password],
input[type=number] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
}

button {
    margin-top: 12px;
    background: #2563eb;
    color: #fff;
    border: 0;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background: #1d4ed8;
}

/* Mensajes de error */
.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Secciones */
.section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
    margin-bottom: 16px;
}

/* Tablas */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.table th,
.table td {
    border: 1px solid #e5e7eb;
    padding: 8px;
    text-align: left;
    font-size: 13px;
    vertical-align: top;
}

.table th {
    background: #f3f4f6;
}

.kv th {
    width: 260px;
    background: #f9fafb;
}

/* Tags y pills */
.tag {
    display: inline-block;
    font-size: 12px;
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    padding: 2px 6px;
    border-radius: 999px;
}

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
    font-size: 12px;
}

.small {
    color: #6b7280;
    font-size: 12px;
}

.footer {
    margin-top: 24px;
    color: #6b7280;
    font-size: 12px;
}

fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}

/* Sistema de pestañas */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}

.tab {
    padding: 12px 24px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s;
    font-weight: 500;
    margin-top: 0;
}

.tab:hover {
    background: #f3f4f6;
    border-color: #2563eb;
    color: #2563eb;
}

.tab.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Formularios de consulta */
.reunion-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.reunion-form input {
    max-width: 200px;
}

/* Info box */
.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Details/Summary colapsables */
.details {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    margin: 10px 0;
}

.details>summary {
    cursor: pointer;
    padding: 10px 12px;
    font-weight: 600;
    color: #111827;
}

.details[open]>summary {
    border-bottom: 1px solid #e5e7eb;
}

.subsection {
    padding: 12px;
}

/* Resumen de Ticket */
.ticket-resumen {
    background: #f9fafb;
    border: 2px solid #2563eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.badge-multiple {
    display: inline-block;
    background: #059669;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.apuesta-especial-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.apuesta-header {
    margin-bottom: 8px;
}

.apuesta-nombre {
    font-size: 15px;
    color: #1e40af;
}

.apuesta-valores {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.pata-resumen {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.pata-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.pata-carrera {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.pata-caballos {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 8px;
}

.jugada-resumen {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.jugada-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.jugada-numero {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.jugada-apuesta {
    font-size: 13px;
    color: #6b7280;
}

.jugada-info {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.info-item {
    font-size: 13px;
    color: #374151;
}

.jugada-caballos {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 8px;
}

.caballos-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.caballos-numeros {
    font-size: 13px;
    color: #1e40af;
    font-weight: 600;
}

.ticket-totales {
    margin-top: 12px;
    border-top: 2px solid #e5e7eb;
    padding-top: 12px;
}

.ticket-subtotal,
.ticket-servicio,
.ticket-impuesto {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 14px;
    color: #374151;
}

.ticket-subtotal {
    background: #f9fafb;
    border-radius: 4px;
    margin-bottom: 4px;
}

.ticket-servicio,
.ticket-impuesto {
    padding-left: 24px;
    font-size: 13px;
    color: #6b7280;
}

.subtotal-label,
.servicio-label,
.impuesto-label {
    font-weight: 500;
}

.subtotal-monto,
.servicio-monto,
.impuesto-monto {
    font-weight: 600;
}

.ticket-total {
    background: #2563eb;
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    margin-top: 8px;
}

.total-label {
    font-size: 16px;
}

.total-monto {
    font-size: 20px;
}

/* =============================================
   Tarjeta de Resultado de Carrera (Ticket tab)
   ============================================= */

.carrera-resultado-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.carrera-resultado-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.carrera-resultado-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.carrera-resultado-meta {
    font-size: 12px;
    color: #6b7280;
}

/* Grid de posiciones */
.llegadas-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.llegada-puesto {
    display: flex;
    align-items: stretch;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    min-width: 72px;
}

.llegada-pos {
    background: #374151;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
}

.llegada-pos.pos-1 {
    background: #b45309;
}

/* dorado oscuro */
.llegada-pos.pos-2 {
    background: #475569;
}

/* plateado */
.llegada-pos.pos-3 {
    background: #92400e;
}

/* bronce */
.llegada-pos.pos-4 {
    background: #374151;
}

.llegada-caballos {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 8px;
    background: #f9fafb;
    justify-content: center;
}

.llegada-caballo {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.llegada-jockey {
    font-size: 10px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.empate-badge {
    font-size: 9px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 3px;
    padding: 0 4px;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 3px;
}

/* Fila de favorito + retirados */
.carrera-info-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 13px;
}

.carrera-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.carrera-info-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.favorito-numero {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-weight: 700;
    font-size: 13px;
    padding: 2px 7px;
    border-radius: 5px;
}

.favorito-jockey {
    color: #6b7280;
    font-size: 12px;
}

.retirado-chip {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-weight: 700;
    font-size: 12px;
    padding: 2px 7px;
    border-radius: 5px;
}

.retirado-chip.retirado-um {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.sin-dato {
    color: #9ca3af;
    font-size: 12px;
    font-style: italic;
}

/* Entrada individual dentro de un puesto (caballo + jockey + sports) */
.llegada-entry {
    padding: 3px 0;
}

/* Separador entre caballos empatados */
.empate-sep {
    border-top: 1px dashed #d1d5db;
    margin: 3px 0;
}

/* Chips de sports (dividendos) */
.llegada-sports {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 3px;
}

.sport-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    color: #166534;
    font-weight: 600;
}

.sport-label {
    color: #4ade80;
    font-weight: 700;
    font-size: 9px;
    margin-right: 1px;
}

/* Dropdown de apuestas */
.apuestas-dropdown {
    position: relative;
    width: 280px;
}

.apuestas-dropdown-toggle {
    width: 100%;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #374151;
    text-align: left;
    margin-top: 0;
}

.apuestas-dropdown-toggle:hover {
    background: #f9fafb;
    border-color: #2563eb;
}

.dropdown-arrow {
    font-size: 10px;
    color: #6b7280;
    transition: transform 0.2s;
}

.apuestas-dropdown-toggle.open .dropdown-arrow {
    transform: rotate(180deg);
}

.apuestas-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    max-height: 320px;
    overflow: hidden;
    flex-direction: column;
}

.apuestas-dropdown-menu.show {
    display: flex;
}

.apuestas-dropdown-header {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.apuestas-dropdown-header button {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    margin: 0;
}

.apuestas-dropdown-header button:hover {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

.apuestas-dropdown-list {
    overflow-y: auto;
    max-height: 260px;
    padding: 4px;
}

.apuesta-checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
    margin: 0;
    font-size: 14px;
    color: #374151;
}

.apuesta-checkbox-item:hover {
    background: #f3f4f6;
}

.apuesta-checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: auto;
}

.apuesta-name {
    font-weight: 500;
    color: #111827;
}

.apuesta-abbr {
    margin-left: 6px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
}

.apuestas-grupo {
    margin-bottom: 8px;
}

.apuestas-grupo-titulo {
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2px;
}

/* Estilos para gestión de conexiones */
.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-small {
    padding: 4px 12px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.btn-small:hover {
    background: #f3f4f6;
}

.btn-danger {
    color: #dc2626;
    border-color: #fca5a5;
}

.btn-danger:hover {
    background: #fee2e2;
}

.success-message {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #374151;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Lista de conexiones */
.connections-list {
    margin-bottom: 24px;
}

.connections-list h3 {
    font-size: 16px;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.connection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #f9fafb;
}

.connection-info strong {
    font-size: 14px;
    color: #111827;
}

.connection-info small {
    color: #6b7280;
    font-size: 12px;
}

.connection-actions {
    display: flex;
    gap: 8px;
}

/* Formulario en modal */
.connection-form-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.connection-form-section h3 {
    font-size: 16px;
    margin: 0 0 16px 0;
    font-weight: 600;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Sidebar fijo de conexiones a la izquierda */
.connections-sidebar-fixed {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 16px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow-y: auto;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}


.connections-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.connections-sidebar-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.btn-icon {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #111827;
}

.connections-list-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    max-height: 300px;
    overflow-y: auto;
}

/* Tarjetas de conexión */
.connection-card {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #fafafa;
}

.connection-card:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
}

.connection-card.active {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.connection-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.connection-card-details {
    font-size: 11px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

.connection-card-host {
    font-family: 'Courier New', monospace;
}

.connection-card-db {
    font-weight: 500;
}

.connection-card-separator {
    color: #d1d5db;
}

/* Botón de nueva conexión */
.btn-new-connection {
    width: 100%;
    padding: 10px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-new-connection:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.btn-new-connection svg {
    flex-shrink: 0;
}

/* Formulario modal de conexión */
.connection-form-modal {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.connection-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.connection-form-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.connection-form-modal fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.connection-form-modal legend {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 12px;
    padding: 0;
}

.connection-form-modal div {
    margin-bottom: 14px;
}

.connection-form-modal label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.connection-form-modal input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.connection-form-modal input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.connection-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.btn-connect {
    flex: 1;
    padding: 10px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-connect:hover {
    background: #2563eb;
}

/* Resumen de Reunión */
.reunion-summary {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.reunion-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.reunion-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #111827;
}

.reunion-meta {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.reunion-meta-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.reunion-meta-item .label {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}

.reunion-meta-item .value {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

/* Tabla de Resultados */
.carreras-results-grid {
    margin-top: 20px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.results-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.results-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.results-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

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

.results-table tbody tr:hover {
    background: #f9fafb;
}

.results-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: #374151;
}

.results-table td.carrera-number {
    font-weight: 600;
    color: #111827;
    width: 100px;
}

.results-table td.ganador {
    color: #059669;
    font-weight: 500;
}

.results-table td.favorito {
    color: #3b82f6;
    font-weight: 500;
}

.results-table td.retirados {
    color: #dc2626;
    font-size: 13px;
}

/* Sección de Sports (Exacta, Imperfecta, Trifecta, Cuatrifecta) */
.sports-section {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.sport-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
}

.sport-label {
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.sport-combination {
    font-weight: 500;
    color: #111827;
    font-family: 'Courier New', monospace;
}

.sport-value {
    font-weight: 700;
    color: #059669;
    margin-left: 4px;
}

/* Resumen de Premio */
.resumen-premio {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.resumen-premio h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.premio-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: #f9fafb;
}

.premio-item.premio-total {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.premio-item.premio-devolucion {
    background: #fef3c7;
    border: 1px solid #fcd34d;
}

.premio-label {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}

.premio-value {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.premio-value.premio-monto {
    color: #059669;
    font-size: 20px;
}

.premio-value.premio-devolver {
    color: #d97706;
    font-size: 16px;
}

.detalles-devolucion {
    margin-top: 12px;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
}

.detalles-devolucion summary {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.detalles-devolucion summary:hover {
    background: #f3f4f6;
}

.lista-devoluciones {
    margin-top: 8px;
    padding: 8px;
    background: #fefce8;
    border-radius: 4px;
}

.devolucion-item {
    padding: 8px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.devolucion-item:last-child {
    margin-bottom: 0;
}

.dev-jugada {
    color: #6b7280;
    font-weight: 500;
}

.dev-monto {
    color: #d97706;
    font-weight: 700;
}

/* Badge Place */
.badge-place {
    display: inline-block;
    background: #3b82f6;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    letter-spacing: 0.02em;
}

/* Badge Carreras */
.badge-carreras {
    display: inline-block;
    background: #10b981;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    letter-spacing: 0.02em;
}

/* Sports Especiales Detalle */
.sports-especiales-detalle {
    margin-top: 8px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.sport-especial-item {
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.sport-especial-item:last-child {
    margin-bottom: 0;
}

.sport-especial-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.sport-especial-row.small-text {
    font-size: 12px;
    color: #6b7280;
}

.sport-label-esp {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.sport-value-esp {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.sport-value-esp.place-highlight {
    color: #3b82f6;
    background: #eff6ff;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Sports Especiales */
.sports-especiales {
    margin-top: 8px;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
}

.sport-item.sport-especial {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.sport-item.sport-especial .sport-label {
    color: #1e40af;
}

.sport-item.sport-especial .sport-value {
    color: #1d4ed8;
}

.sport-item.sport-place {
    background: #dbeafe;
    border-color: #93c5fd;
}

.sport-item.sport-place .sport-label {
    color: #1e40af;
    font-style: italic;
}

.sport-item.sport-place .sport-value {
    color: #2563eb;
}

/* Responsive para pantallas pequeñas */
@media (max-width: 768px) {
    .connection-layout {
        grid-template-columns: 1fr;
    }
    
    .connections-sidebar {
        order: -1;
    }
    
    .reunion-meta {
        flex-direction: column;
        gap: 12px;
    }
    
    .results-table {
        font-size: 12px;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 12px;
    }
    
    .sports-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .sport-item {
        font-size: 13px;
    }
}