/* Estilos Generales */
html, body {
    height: 100%; /* Asegura que html y body tomen la altura completa */
}
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    /* --- RESET O VALOR MÁS PEQUEÑO para padding-bottom del body --- */
    /* La estrategia principal se mueve al .container-fluid */
    padding-bottom: 0; /* Lo reiniciamos, ya que el margin-bottom del contenido lo gestionará */
}

/* Clases para controlar el scroll del body cuando un sidebar está abierto */
body.sidebar-open {
    overflow: hidden; /* Evita el scroll del contenido principal */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* Header */
header {
    background-color: #0056b3;
    color: white;
    padding: 15px 0;
    text-align: center;
    border-bottom: 5px solid #004085;
}

header h1 {
    margin: 0;
    font-size: 2.5em;
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

header nav ul li {
    margin: 0 15px;
}

header nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

header nav ul li a:hover {
    background-color: #004085;
}

/* Mensajes de feedback */
.message {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 44px;
    font-weight: bold;
    text-align: center;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Formularios */
form {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group select {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.form-group input[type="checkbox"] {
    margin-right: 5px;
}

button[type="submit"], .btn {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button[type="submit"]:hover, .btn:hover {
    background-color: #0056b3;
}

.btn-danger {
    background-color: #dc3545;
}
.btn-danger:hover {
    background-color: #c82333;
}
.btn-success {
    background-color: #28a745;
}
.btn-success:hover {
    background-color: #218838;
}

/* Tablas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: white;
    border-top: 5px solid #555;
    position: fixed; 
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 1000;
    font-size: 0.9rem;
    min-height: 80px; 
}
.footer-seal-image {
    height: 40px;
    width: auto;
    opacity: 0.9;
    border-radius: 4px;
}
footer p { margin: 0; }


/* Página de Login */
.login-container {
    width: 100%;
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: center;
}

.login-container h2 {
    margin-bottom: 25px;
    color: #0056b3;
}

.login-container .form-group {
    text-align: left;
}

/* Venta de animalitos */
.animalitos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
    justify-items: center;
}

.animalito-card {
    background-color: #eee;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.animalito-card.selected {
    background-color: #d4edda;
    border-color: #155724;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.animalito-card img {
    max-width: 80px;
    height: auto;
    margin-bottom: 5px;
}

.animalito-card p {
    margin: 0;
    font-weight: bold;
}

.animalito-card small {
    display: block;
    color: #666;
}

.selected-animals {
    margin-top: 20px;
    padding: 15px;
    border: 1px dashed #007bff;
    border-radius: 8px;
    min-height: 50px;
}
.selected-animals h3 {
    margin-top: 0;
    color: #0056b3;
}
.selected-animals ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.selected-animals li {
    background-color: #e9ecef;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
}
.selected-animals li span {
    margin-right: 5px;
}
.selected-animals li .remove-animal {
    cursor: pointer;
    color: #dc3545;
    font-weight: bold;
    margin-left: 5px;
}

/* Estilos para la nueva interfaz de pestañas de venta */
.tabs-container {
    width: 100%;
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #ccc;
}

.tab-button {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: #f1f1f1;
    border-bottom: 2px solid transparent;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.tab-button.active {
    background-color: #fff;
    border-top: 2px solid #007bff;
    border-left: 2px solid #007bff;
    border-right: 2px solid #007bff;
    border-bottom: 2px solid #fff;
    color: #007bff;
}

.tab-content {
    display: none;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    background-color: #fff;
}

.tab-content.active {
    display: block;
}

/* --- NUEVOS ESTILOS PARA LA DISTRIBUCIÓN DE COLUMNAS DE RESULTADOS --- */
.results-container {
    display: flex;       /* Habilita flexbox para la distribución en fila */
    flex-wrap: wrap;     /* Permite que las columnas se envuelvan a la siguiente fila en pantallas pequeñas */
    gap: 20px;           /* Espacio entre las columnas */
    justify-content: center; /* Centra las columnas si no llenan todo el ancho */
    margin: 20px auto;   /* Margen superior/inferior y centrado */
    width: 90%;          /* Ancho general del contenedor de columnas */
    max-width: 1200px;   /* Ancho máximo como el .container principal */
}

.lottery-column {
    flex: 1;             /* Permite que las columnas crezcan y se encojan */
    min-width: 300px;    /* Ancho mínimo antes de envolverse */
    max-width: 48%;      /* Ajustado para permitir dos columnas con un pequeño espacio entre ellas */
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05); /* Sombra similar al .container */
}

.lottery-column h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #0056b3; /* Usando tu color de header para los títulos de columna */
    font-size: 1.8em;
}

.result-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    background-color: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.result-card-header h3 {
    margin: 0;
    color: #333; /* Color de texto general */
    font-size: 1.2em;
}

.result-card-header p {
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
}

.result-card-body img {
    max-width: 100px;
    height: auto;
    margin: 10px auto;
    display: block;
}

.result-card-body .placeholder-icon {
    font-size: 60px;
    color: #ccc;
    margin: 10px auto;
    display: block;
    width: 100px;
    height: 100px;
    line-height: 100px;
    border: 2px dashed #ccc;
    border-radius: 50%;
    text-align: center;
}

.result-card-info .animal-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #007bff; /* Usando tu color de botón principal para el nombre del animal */
}

.result-card-info .animal-number {
    font-size: 1.1em;
    color: #666;
    margin-left: 5px;
}

/* Media query para hacer que las columnas se apilen en pantallas pequeñas */
@media (max-width: 768px) {
    .results-container {
        flex-direction: column; /* Apila las columnas verticalmente */
        align-items: center; /* Centra las columnas apiladas */
        width: 95%; /* Un poco más de ancho en móviles */
    }
    .lottery-column {
        max-width: 100%; /* Ocupar todo el ancho disponible */
    }
}
/* Estilos para Mis Ventas (mis_ventas.php) */

.balance-info {
    background-color: #e9f7ef;
    border: 1px solid #d4edda;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.balance-info h3 {
    color: #28a745;
    margin-top: 0;
    font-size: 1.5em;
}

.balance-info p {
    font-size: 1.1em;
    margin: 8px 0;
    color: #333;
}

.balance-info strong {
    color: #007bff;
}

.summary-sections {
    margin-bottom: 30px;
}

/* Tabs (ya deberías tener algo similar de index.php) */
.tabs-container {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    justify-content: center;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tabs .tab-button {
    background-color: #f2f2f2;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    color: #555;
    border-radius: 5px 5px 0 0;
    transition: background-color 0.3s, color 0.3s;
}

.tabs .tab-button.active {
    background-color: #007bff;
    color: white;
    border-bottom: 2px solid #007bff;
}

.tab-content {
    display: none;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    margin-top: 0;
    color: #0056b3;
}

/* Tablas de datos */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

table th {
    background-color: #f0f0f0;
    font-weight: bold;
    color: #333;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f1f1f1;
}

.info-message {
    text-align: center;
    color: #666;
    padding: 20px;
    background-color: #f0f8ff;
    border: 1px solid #b3e0ff;
    border-radius: 5px;
}

/* Estilos para el filtro de tickets */
.filter-controls {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-controls input[type="text"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
    max-width: 300px;
}

/* Estilos para las tarjetas de ticket (ya deberías tener algo similar) */
.tickets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center; /* Centrar las tarjetas si no llenan la línea */
}

.ticket-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 20px;
    width: calc(33% - 20px); /* Para 3 columnas, ajusta si quieres más o menos */
    min-width: 280px; /* Ancho mínimo para que no se vea apretado */
    box-sizing: border-box; /* Incluir padding y borde en el ancho */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Para empujar las acciones al final */
}

.ticket-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.ticket-card .card-header h4 {
    margin: 0;
    color: #0056b3;
    font-size: 1.1em;
}

.ticket-card .ticket-status {
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.85em;
    color: white; /* Color de texto predeterminado para estados */
}

.ticket-card .status-pendiente { background-color: #ffc107; color: #333; } /* Amarillo */
.ticket-card .status-ganador { background-color: #28a745; } /* Verde */
.ticket-card .status-perdedor { background-color: #dc3545; } /* Rojo */
.ticket-card .status-anulado { background-color: #6c757d; } /* Gris */

.ticket-card .card-body p {
    margin: 8px 0;
    font-size: 0.95em;
    color: #555;
}

.ticket-card .card-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.ticket-card .btn {
    flex-grow: 1; /* Para que los botones ocupen el espacio disponible */
    padding: 8px 15px;
    font-size: 0.9em;
}

/* Media queries para las tarjetas de ticket */
@media (max-width: 992px) {
    .ticket-card {
        width: calc(50% - 20px); /* 2 columnas en tablets */
    }
}

@media (max-width: 768px) {
    .ticket-card {
        width: 100%; /* 1 columna en móviles */
    }
    .tickets-list {
        justify-content: flex-start; /* Alinear a la izquierda en móviles */
    }
}

/* Modal Styles (ya deberías tener de pagar_ticket.php) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 30px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: center;
    position: relative;
}

.modal-content h2 {
    color: #0056b3;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 1.1em;
    margin-bottom: 25px;
}

.modal-content strong {
    color: #28a745;
}

.modal .close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
}

.modal .close-button:hover,
.modal .close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal form .btn {
    margin: 0 10px;
}

/* ========================================================================= */
/* --- INICIO DE ESTILOS AÑADIDOS/MODIFICADOS PARA TICKET MAESTRO Y PAGOS --- */
/* ========================================================================= */

/* Estilos para la sección de tickets individuales en venta_exitosa */
.ticket-summary .individual-ticket-section { /* Más específico para evitar colisiones */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fcfcfc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ticket-summary .individual-ticket-section h4 {
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 5px;
}

.ticket-summary .individual-ticket-section ul.animalitos-lista {
    list-style: none;
    padding: 0;
    margin-bottom: 10px;
}

.ticket-summary .individual-ticket-section ul.animalitos-lista li {
    background-color: #f0f8ff; /* Un color suave para los ítems */
    padding: 6px 10px;
    margin-bottom: 3px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
    border: 1px solid #e0eaf5;
}

.ticket-summary .individual-ticket-section ul.animalitos-lista li strong {
    color: #333;
}

.separator { /* General separator, already defined above, but ensuring consistency */
    border-bottom: 1px dashed #ddd;
    margin: 20px 0;
}

/* Ajustes para el botón de imprimir ticket combinado (en venta_exitosa y mis_ventas) */
.actions .btn-primary { /* Primary button, could be specific for 'Imprimir Ticket Combinado' */
    background-color: #007bff;
    color: white;
}

.actions .btn-primary:hover {
    background-color: #0056b3;
}

/* General styles for input fields on index.php (replacing any numeric keypad specific styles) */
.form-group input[type="number"] { /* Target specific input type */
    width: calc(100% - 20px); /* Adjust based on your overall form-group styling */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    text-align: right; /* Align numbers to the right */
}

/* Specific styles for individual animal amount inputs in the list (on index.php) */
.monto-individual-input {
    width: 80px; /* Adjust width to fit well in the list item */
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    margin-left: 10px;
    text-align: right;
}

/* Adjustments to the selected animals list (on index.php) */
.selected-animals li { /* Already mostly defined, ensure these are compatible */
    background-color: #e9ecef;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Allows content to wrap if too long */
    margin-bottom: 5px; /* Adds a small space between elements */
    border: 1px solid #d4d4d4;
}

/* Image container in animal cards (on index.php) */
.animalito-image-wrapper {
    width: 60px; /* Fixed width */
    height: 60px; /* Fixed height */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Hides overflowing parts of the image */
    margin-bottom: 5px;
}

.animalito-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    display: block; /* Removes extra space below the image */
    object-fit: contain; /* Ensures the image fits without cropping */
}

.placeholder-icon-initial {
    font-size: 40px;
    color: #999;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dashed #ccc;
    border-radius: 5px;
}

/* Media query for smaller screens for the monto base section (on index.php) */
@media (max-width: 768px) {
    /* No .monto-input-section specific styles needed if keypad is removed, rely on general form-group */
    .form-group input[type="number"] {
        width: calc(100% - 20px); /* Re-adjust for small screens if needed */
    }
}


/* Estilos para Pagar Ticket (pagar_ticket.php) */
.master-transaction-details {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.master-transaction-details h3 {
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 10px;
}

.master-transaction-details h4 {
    color: #333;
    margin-top: 15px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px dotted #eee;
}

.master-transaction-details p {
    margin: 5px 0;
    font-size: 0.95em;
}

.lottery-column-pay { /* Individual ticket detail within the master transaction in pagar_ticket.php */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.lottery-column-pay h5 {
    color: #007bff;
    margin-top: 0;
    margin-bottom: 10px;
}

.lottery-column-pay .animalitos-lista-small {
    list-style: none;
    padding: 0;
    margin-top: 5px;
}

.lottery-column-pay .animalitos-lista-small li {
    font-size: 0.9em;
    padding: 3px 0;
    color: #555;
}

.lottery-column-pay .apuesta-ganadora {
    font-weight: bold;
    color: #28a745;
}

.master-transaction-details .total-prize {
    font-size: 1.4em;
    color: #28a745;
    display: block;
    text-align: center;
    margin: 20px 0;
}

/* Status Badges - used in pagar_ticket.php and mis_ventas.php */
.status-ganador {
    background-color: #d4edda;
    color: #155724;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}
.status-perdedor {
    background-color: #f8d7da;
    color: #721c24;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}
.status-pendiente {
    background-color: #fff3cd;
    color: #856404;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}
.status-paid { /* For already paid winners */
    background-color: #cce5ff;
    color: #004085;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}
.status-anulado { /* From original, ensuring it exists */
    background-color: #6c757d; 
    color: white; 
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}


/* Estilos para Mis Ventas (mis_ventas.php) - Modificaciones y adiciones */
.transactions-list { /* This replaces the original .tickets-list usage for master transactions */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.transaction-card { /* This is the new card for each master transaction */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.transaction-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.transaction-card .card-header h4 {
    margin: 0;
    color: #0056b3;
    font-size: 1.1em;
}

.transaction-card .transaction-date-time {
    font-size: 0.85em;
    color: #666;
}

.transaction-card .card-body p {
    margin: 8px 0;
    font-size: 0.95em;
    color: #555;
}

.transaction-card .card-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

/* Button styles for .btn, .btn-secondary, etc. are already defined at the top. */

/* Accordion for individual ticket details in Mis Ventas */
.individual-tickets-accordion {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.accordion-toggle {
    background-color: #f2f2f2;
    color: #444;
    cursor: pointer;
    padding: 10px 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
    border-radius: 5px;
    margin-bottom: 5px;
}

.accordion-toggle:hover {
    background-color: #e0e0e0;
}

.accordion-toggle.active {
    background-color: #007bff;
    color: white;
}

.accordion-content {
    padding: 0 10px;
    max-height: 0; /* Important for accordion animation */
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    background-color: #fafafa;
    border-left: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0 0 5px 5px;
}

.ticket-detail-item {
    padding: 10px 0;
    border-bottom: 1px dotted #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 15px; /* row-gap column-gap */
    align-items: center;
    font-size: 0.85em;
}

.ticket-detail-item:last-child {
    border-bottom: none;
}

.ticket-detail-item span {
    flex-shrink: 0; /* Prevents text from shrinking too much */
}

.ticket-detail-item .prize-amount {
    font-weight: bold;
    color: #28a745;
}

.animalitos-detail-list {
    flex-basis: 100%; /* Take full width */
    margin-top: 5px;
}

.animalitos-detail-list h6 {
    margin: 0 0 5px 0;
    font-size: 0.9em;
    color: #666;
}

.animalitos-detail-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
}

.animalitos-detail-list ul li {
    background-color: #eef5fc;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    border: 1px solid #d0e0f0;
}
.animalitos-detail-list ul li.apuesta-ganadora-inline {
    background-color: #d4edda;
    border-color: #28a745;
    font-weight: bold;
    color: #155724;
}

/* Alert Warning in Mis Ventas */
.alert-warning { /* Ensuring this style exists and works */
    background-color: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    font-size: 0.9em;
    text-align: center;
}

/* Responsive adjustments for Mis Ventas */
@media (max-width: 768px) {
    .transactions-list { /* Adjust grid for small screens */
        grid-template-columns: 1fr; /* One column on mobile */
    }
    .filter-controls { /* Stack filter controls */
        flex-direction: column;
        align-items: stretch;
    }
    .filter-controls input,
    .filter-controls button,
    .filter-controls a.btn {
        width: 100%;
        margin-bottom: 10px;
    }
    .transaction-card .card-actions { /* Stack buttons in card footer */
        flex-direction: column;
    }
}
/* ... (mantener todo el CSS existente arriba) ... */

/* Estilos de la barra de resultados (copiados de taquillero/index.php y mejorados) */
.lottery-results-bar {
    background-color: #343a40; /* Fondo oscuro */
    color: #fff;
    padding: 10px 0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); /* Sombra más pronunciada */
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    border-bottom: 3px solid #007bff; /* Borde inferior de acento */
}

.lottery-results-bar .container {
    display: flex;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 15px; /* Pequeño padding lateral */
}

.lottery-results-bar img {
    height: 30px; /* Tamaño de la imagen un poco más grande */
    width: 30px;
    margin-right: 8px; /* Más espacio */
    vertical-align: middle;
    border-radius: 50%; /* Imágenes circulares */
    box-shadow: 0 0 5px rgba(255,255,255,0.2); /* Sombra en la imagen */
}

.lottery-result-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px; /* Más padding */
    margin-right: 12px; /* Más margen */
    background-color: #495057; /* Un poco más claro que el fondo de la barra */
    border-radius: 25px; /* Bordes más redondeados */
    font-size: 0.9em; /* Un poco más grande */
    flex-shrink: 0;
    transition: all 0.3s ease; /* Transición suave para efectos */
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.lottery-result-item:last-child {
    margin-right: 0;
}

.lottery-result-item:hover {
    background-color: #5a6268; /* Color de fondo al pasar el ratón */
    transform: translateY(-2px); /* Pequeño efecto de elevación */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.lottery-result-item strong {
    color: #ffc107; /* Color de acento para el nombre de la lotería (amarillo) */
    margin-right: 8px;
    font-weight: 700; /* Más negrita */
}

.lottery-result-item span {
    color: #e9ecef; /* Color para el animalito y la hora */
    font-weight: 500;
}

/* Estilo para los elementos sin resultado aún */
.lottery-result-item.no-result-yet {
    background-color: #6c757d; /* Un gris más oscuro para "Cargando..." o "Pendiente" */
    opacity: 0.8;
}
.lottery-result-item.no-result-yet span {
    color: #cfd8dc; /* Texto más claro para sin resultados */
}
/* En /css/style.css */

/* Estilos para las tarjetas del Dashboard */
.card .border-left-primary { border-left: .25rem solid #4e73df !important; }
.card .border-left-success { border-left: .25rem solid #1cc88a !important; }
.card .border-left-info { border-left: .25rem solid #36b9cc !important; }
.card .border-left-warning { border-left: .25rem solid #f6c23e !important; }

.text-xs { font-size: .7rem; }
.text-gray-300 { color: #dddfeb !important; }
.text-gray-800 { color: #5a5c69 !important; }
/* Estilo para contenedores de ancho completo en reportes */
.container-full-width {
    width: 100%;
    padding-right: 25px;
    padding-left: 25px;
    margin-right: auto;
    margin-left: auto;
}

/*
 * CORRECCIÓN VISUAL PARA EL DASHBOARD DE ADMIN
 * Asegura que los títulos de las tarjetas sean visibles.
 */
.card-header .m-0.font-weight-bold {
    color: #5a5c69 !important; /* Un gris oscuro estándar para mejor legibilidad */
}

/* --- NUEVO ESTILO CRÍTICO: Para la columna de la derecha del formulario de apuestas --- */
/* Identifica el div que contiene 'Registrar Apuesta', 'Ticket Actual' y 'Generar Ticket' */
/* Aplica un margen inferior solo cuando la pantalla es lo suficientemente pequeña como para que el footer pueda solapar */
@media (max-width: 767.98px) { /* breakpoint estándar de Bootstrap para móviles */
    .container-fluid.mt-4 > .row > .col-md-6:last-of-type { 
        margin-bottom: 150px; /* Un valor generoso para empujar el contenido EN MÓVILES */
    }
}
@media (min-width: 768px) { /* Para tablets y desktops */
    .container-fluid.mt-4 > .row > .col-md-6:last-of-type {
        margin-bottom: 100px; /* Un poco menos en pantallas más grandes si es necesario */
    }
}
/* --- FIN NUEVO ESTILO CRÍTICO --- */


/* ===================================================================== */
/* === INICIO: ESTILOS PARA EL POP-UP DE SELECCIÓN DE LOTERÍAS Y HORARIOS (FINAL) === */
/* ===================================================================== */
.lottery-time-selector-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Ocupar la altura completa del viewport */
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center; /* Centrar verticalmente el popup-content */
    z-index: 1050;
    padding: 10px; /* Margen alrededor del popup-content dentro del overlay */
    box-sizing: border-box;
    /* CRÍTICO: El OVERLAY COMPLETO DEBE SER SCROLLABLE si el .popup-content excede la altura */
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; /* Para un scroll más nativo en iOS */
}

.lottery-time-selector-popup .popup-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 95%; /* Ancho respecto al overlay */
    max-width: 500px;
    display: flex;
    flex-direction: column;
    
    /* CRÍTICO: Asegurarse de que el contenido del popup se ajuste a la altura disponible */
    /* El 100% aquí es del espacio restante del overlay después de su padding */
    max-height: 100%; 
    height: auto; /* Permite que se ajuste a su contenido, pero sin exceder max-height */
    
    box-sizing: border-box; 
    padding: 0; /* El padding se gestiona en header/body/footer */
}

.lottery-time-selector-popup .popup-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #007bff;
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    flex-shrink: 0; /* Evita que el header se encoja */
}

.lottery-time-selector-popup .popup-header h5 {
    margin: 0;
    font-size: 1.25em;
}

.lottery-time-selector-popup .close-popup-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.75em;
    cursor: pointer;
    opacity: 0.8;
}

.lottery-time-selector-popup .close-popup-btn:hover {
    opacity: 1;
}

.lottery-time-selector-popup .popup-body {
    flex-grow: 1; /* Permite que el cuerpo ocupe el espacio disponible */
    overflow-y: auto; /* Habilita el desplazamiento para el contenido interno */
    padding: 15px;
    -webkit-overflow-scrolling: touch; /* Para un scroll más nativo en iOS y otros dispositivos táctiles */
    scroll-behavior: smooth; /* Para transiciones de scroll más suaves */
    min-height: 0; /* CRÍTICO para flexbox: Permite que el elemento se encoja si es necesario */
    box-sizing: border-box;
}

.lottery-time-selector-popup .popup-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: #f8f9fa;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    flex-shrink: 0; /* Evita que el footer se encoja */
}

/* Estilos de acordeón para las loterías */
.lottery-group {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.lottery-group-header {
    background-color: #f0f0f0;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #333;
    transition: background-color 0.2s ease;
}

.lottery-group-header:hover {
    background-color: #e0e0e0;
}

.lottery-group-header.active {
    background-color: #007bff;
    color: white;
}

.lottery-group-header .toggle-icon {
    transition: transform 0.2s ease;
}

.lottery-group-header.active .toggle-icon {
    transform: rotate(90deg);
}

.lottery-group-content {
    display: none; /* Oculto por defecto */
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background-color: #fff;
}

.sorteo-time-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.sorteo-time-item:last-child {
    margin-bottom: 0;
}

.sorteo-time-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2); /* Hace el checkbox más grande para táctil */
}

.sorteo-time-item label {
    margin: 0;
    font-size: 1.05em;
    color: #555;
    cursor: pointer;
    flex-grow: 1;
}

.sorteo-time-item .status-badge {
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
}
.sorteo-time-item .status-badge.closing-soon {
    background-color: #ffc107; /* Amarillo de advertencia */
    color: #333;
}
.sorteo-time-item .status-badge.closed {
    background-color: #dc3545; /* Rojo de peligro */
}
.sorteo-time-item .status-badge.available {
    background-color: #28a745; /* Verde de éxito */
}
/* ===================================================================== */
/* === FIN: ESTILOS PARA EL POP-UP DE SELECCIÓN DE LOTERÍAS Y HORARIOS === */
/* ===================================================================== */

/* ===================================================================== */
/* === INICIO: ESTILOS PARA LA NUEVA BARRA LATERAL (TICKET SLIDER BAR) === */
/* ===================================================================== */
.ticket-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1040; /* Por debajo de la barra lateral, por encima del contenido principal */
    display: none; /* Oculto por defecto */
}

.ticket-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px; /* Ancho predeterminado para escritorio */
    max-width: 90%; /* Máximo el 90% del ancho de la pantalla */
    height: 100vh; /* Altura completa del viewport en escritorio */
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 1050; /* Por encima del overlay */
    display: flex;
    flex-direction: column;
    transform: translateX(100%); /* Inicialmente fuera de la pantalla a la derecha */
    transition: transform 0.3s ease-out; /* Animación de deslizamiento */
}

.ticket-sidebar.active {
    transform: translateX(0); /* Deslizar hacia adentro */
}

.ticket-sidebar .sidebar-header {
    background-color: #007bff;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Evita que el header se encoja */
}

.ticket-sidebar .sidebar-header h5 {
    margin: 0;
    font-size: 1.25em;
}

.ticket-sidebar .close-sidebar-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.75em;
    cursor: pointer;
    opacity: 0.8;
}

.ticket-sidebar .close-sidebar-btn:hover {
    opacity: 1;
}

.ticket-sidebar .sidebar-body {
    flex-grow: 1; /* Ocupa el espacio restante */
    overflow-y: auto; /* Habilita el scroll si el contenido es demasiado largo */
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.ticket-sidebar .sidebar-body h6, .ticket-sidebar .sidebar-body p {
    margin-bottom: 0.5rem;
}

.ticket-sidebar .sidebar-body strong {
    color: #28a745; /* Color de éxito para los montos y datos importantes */
}

.ticket-sidebar .sidebar-body hr {
    margin: 1.5rem 0;
    border-top: 1px dashed #e9ecef;
}

.ticket-sidebar .sidebar-body .list-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted #e9ecef;
    font-size: 0.9em;
}
.ticket-sidebar .sidebar-body .list-group-item:last-child {
    border-bottom: none;
}
.ticket-sidebar .sidebar-body .list-group-item img {
    width: 25px;
    height: 25px;
    margin-right: 8px;
    border-radius: 50%;
    object-fit: contain;
}
.ticket-sidebar .sidebar-body .list-group-item .bet-details {
    flex-grow: 1;
    display: flex;
    align-items: center;
}
.ticket-sidebar .sidebar-body .list-group-item .bet-details span {
    margin-left: 5px;
}

.ticket-sidebar .sidebar-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
    flex-shrink: 0; /* Evita que el footer se encoja */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Media query para móviles: la barra lateral ocupa todo el ancho y altura ajustada */
@media (max-width: 767.98px) {
    .ticket-sidebar {
        width: 100%; /* Ocupa todo el ancho en móviles */
        max-width: 100%;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.3); /* Sombra más simétrica */
        /* --- CORRECCIÓN CRÍTICA para mobile height --- */
        height: -webkit-fill-available; /* Para Safari en iOS */
        height: fill-available; /* Para Firefox */
        min-height: 100%; /* Para otros navegadores o como fallback */
        max-height: 100vh; /* Seguridad, no exceder la altura del viewport */
        /* Si aún hay problemas con el desplazamiento en iOS, se podría necesitar un wrapper o JavaScript */
        /* --- FIN CORRECCIÓN CRÍTICA --- */
    }
}
/* ===================================================================== */
/* === FIN: ESTILOS PARA LA NUEVA BARRA LATERAL (TICKET SLIDER BAR) === */
/* ===================================================================== */

/* En tu css/style.css */
.animalito-card.selected-tripleta {
    border: 3px solid #007bff; /* Color de tu preferencia para indicar selección */
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.6);
}

/* --- INICIO DE MODIFICACIÓN: REMOVER LA REGLA !IMPORTANT PARA PATRONUS --- */
/* La visibilidad del contenedor de Patronus será ahora controlada exclusivamente por JavaScript. */
/* Se remueve la regla 'display: block !important;' que causaba el conflicto. */
#patronus-bet-option-container {
    /* Si necesitas un display por defecto cuando esté visible (antes de que JS actúe o si JS no lo controla),
       puedes poner 'display: block;' sin '!important;'. Pero idealmente, JS debería manejarlo. */
}

/* --- INICIO: CORRECCIÓN PARA TEXTO LARGO --- */
/* Esta clase se usará para elementos que puedan contener texto largo
   sin espacios (como URLs), forzando a que se dividan y se ajusten
   dentro de su contenedor. */
.link-breakable {
  overflow-wrap: break-word; /* Propiedad estándar moderna */
  word-wrap: break-word;     /* Compatibilidad con navegadores antiguos */
  word-break: break-word;    /* Asegura el corte en casos difíciles */
  -ms-word-break: break-all; /* Para Internet Explorer */
}
/* --- FIN: CORRECCIÓN PARA TEXTO LARGO --- */

/* ====================================================== */
/* === ESTILOS PARA MODAL DE TRIPLETA (MÁS PEQUEÑO Y ADAPTABLE) === */
/* ====================================================== */

/* 1. Definimos un ancho máximo más pequeño para el popup en pantallas de escritorio. */
.modal-tripleta {
  max-width: 420px; /* Ancho máximo en computadoras (puedes ajustarlo si quieres) */
}

/* 2. Reglas especiales para dispositivos móviles (pantallas con menos de 576px de ancho) */
@media (max-width: 575.98px) {
  .modal-tripleta {
    /* Hacemos que el popup ocupe casi todo el ancho de la pantalla del teléfono */
    max-width: 95%; 
    /* Reducimos el margen superior para que no se vea tan alejado */
    margin: 1rem auto;
  }

  /* Opcional pero recomendado: Hacemos el texto y los campos un poco más compactos en móvil */
  .modal-tripleta .modal-body {
    padding: 1rem; /* Menos espacio en los lados */
  }

  .modal-tripleta .form-control,
  .modal-tripleta .btn {
    font-size: 0.9rem; /* Letra un poco más pequeña en botones y campos */
  }

  /* Hacemos la lista de sorteos continuos más pequeña en móvil */
  .modal-tripleta #continuous-sorteos-selection {
      max-height: 120px; /* Reduce la altura máxima de la lista */
      font-size: 0.85rem;
  }
}