* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    color: #333;
    font-size: 2em;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-secondary {
    background: #666;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-edit {
    background: #2196F3;
    color: white;
}

.btn-duplicate {
    background: #9C27B0;
    color: white;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-large {
    padding: 15px 40px;
    font-size: 16px;
    width: 100%;
    margin-top: 20px;
}

/* Grid de rifas */
.rifas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.rifa-card {
    border: 3px solid #8B0000;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s;
}

.rifa-card:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.rifa-header {
    padding: 15px;
    text-align: center;
}

.rifa-header h3 {
    margin: 0;
    font-size: 1.5em;
}

.rifa-body {
    padding: 20px;
    background: #f9f9f9;
}

.rifa-body p {
    margin: 10px 0;
    color: #555;
}

.rifa-actions {
    padding: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    background: #f0f0f0;
}

/* Formularios */
.form-crear {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Editor de rifa */
.editor-controles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 12px;
    color: #555;
}

.control-group input,
.control-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.control-group.full-width {
    grid-column: 1 / -1;
}

/* Tabla de boletos */
.tabla-boletos {
    width: 100%;
    border-collapse: collapse;
}

.tabla-boletos thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.tabla-boletos th,
.tabla-boletos td {
    padding: 10px;
    text-align: center;
}

.tabla-boletos th {
    font-weight: bold;
    font-size: 14px;
}

.numero-boleto {
    font-weight: bold;
    font-size: 18px;
    background: #fff;
    min-width: 50px;
}

.oportunidades {
    font-size: 12px;
    color: #8B0000;
    font-weight: bold;
}

.oportunidad-input {
    width: 35px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
    font-size: 11px;
    margin: 0 2px;
}

.nombre-input-cell {
    text-align: left;
    padding: 8px;
}

.nombre-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 5px;
    font-size: 14px;
}

.estado-checks {
    display: flex;
    gap: 15px;
    font-size: 12px;
}

.estado-checks label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.estado-checks input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .rifas-grid {
        grid-template-columns: 1fr;
    }

    .editor-controles {
        grid-template-columns: 1fr;
    }

    .tabla-boletos {
        font-size: 12px;
    }

    .tabla-boletos th,
    .tabla-boletos td {
        padding: 5px;
    }

    .nombre-input {
        font-size: 12px;
    }

    .estado-checks {
        flex-direction: column;
        gap: 5px;
    }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ====================================
   TIPOGRAFÍA - ARCHIVO BLACK
   ==================================== */

/* Encabezado principal de la rifa */
.rifa-header-display,
.rifa-header-display h1,
.rifa-header-display h2,
.rifa-header-display h3,
.rifa-header-display p,
.rifa-header-display strong {
    font-family: 'Archivo Black', sans-serif !important;
    letter-spacing: 0.5px;
}

/* Encabezado de boletos */
.boletos-header,
.boletos-header strong {
    font-family: 'Archivo Black', sans-serif !important;
    letter-spacing: 0.5px;
}

/* Tabla de boletos */
.tabla-boletos,
.tabla-boletos th,
.tabla-boletos td {
    font-family: 'Archivo Black', sans-serif !important;
}

/* Números de boletos */
.numero-boleto {
    font-family: 'Archivo Black', sans-serif !important;
    font-weight: 400;
}

/* Números de oportunidades */
.oportunidades,
.oportunidad-input {
    font-family: 'Archivo Black', sans-serif !important;
    font-weight: 400;
}

/* Footer informativo */
.footer-info,
.footer-info p,
.footer-info strong {
    font-family: 'Archivo Black', sans-serif !important;
    letter-spacing: 0.5px;
}

/* ====================================
   COLUMNA DE ESTADO
   ==================================== */

.estado-cell {
    padding: 5px;
    vertical-align: middle;
    text-align: center;
}

.estado-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.estado-btn {
    background: transparent;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    padding: 8px 10px;
    transition: all 0.3s ease;
    opacity: 0.3;
    position: relative;
}

.estado-btn:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.estado-btn.active {
    opacity: 1;
    border-color: #333;
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.estado-btn[data-estado-valor="disponible"].active {
    border-color: #999;
    background: #f9f9f9;
}

.estado-btn[data-estado-valor="apartado"].active {
    border-color: #f44336;
    background: #ffebee;
}

.estado-btn[data-estado-valor="pagado"].active {
    border-color: #4CAF50;
    background: #e8f5e9;
}

.estado-icon {
    font-size: 18px;
    display: block;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .estado-toggle {
        flex-direction: row;
        gap: 3px;
    }
    
    .estado-btn {
        padding: 6px 8px;
    }
    
    .estado-icon {
        font-size: 16px;
    }
}

/* ====================================
   COLUMNA DE OPORTUNIDADES UNIFICADA
   ==================================== */

.oportunidades-cell {
    text-align: center;
    padding: 8px 5px;
    vertical-align: middle;
}

.oportunidades-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.oportunidad-input {
    width: 38px;
    padding: 5px 3px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    font-family: 'Archivo Black', sans-serif;
    background: #ffffff;
    transition: all 0.2s ease;
}

.oportunidad-input:focus {
    outline: none;
    border-color: #8B0000;
    background: #fffef0;
    box-shadow: 0 0 5px rgba(139, 0, 0, 0.2);
}

.oportunidad-separator {
    font-size: 16px;
    font-weight: bold;
    color: #8B0000;
    font-family: 'Archivo Black', sans-serif;
    margin: 0 2px;
}

/* Optimización para exportación */
.oportunidades-container-export {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Archivo Black', sans-serif;
}

.oportunidades-container-export .oportunidad-valor {
    display: inline-block;
    min-width: 25px;
    text-align: center;
}

.oportunidades-container-export .separador-export {
    font-size: 16px;
    color: #8B0000;
    margin: 0 3px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .oportunidades-cell {
        padding: 5px 3px;
    }
    
    .oportunidades-container {
        gap: 3px;
    }
    
    .oportunidad-input {
        width: 32px;
        font-size: 11px;
        padding: 3px 2px;
    }
    
    .oportunidad-separator {
        font-size: 14px;
        margin: 0 1px;
    }
}

/* Ajustes para impresión */
@media print {
    .oportunidades-cell {
        padding: 5px;
    }
    
    .oportunidad-input {
        border: none;
        background: transparent;
    }
}