/* ==========================================
   ESTILOS GENERALES
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f1f5f9;
    color: #1e293b;
    padding: 24px 16px;
}

.contenedor {
    max-width: 920px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.encabezado {
    text-align: center;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: #ffffff;
    padding: 24px 20px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
}

.encabezado h1 {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.encabezado p {
    color: #cbd5e1;
    font-size: 0.95rem;
}

/* ==========================================
   TARJETAS Y SECCIONES
   ========================================== */
.tarjeta {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    border: 1px solid #e2e8f0;
}

.tarjeta h2 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #0f172a;
}

.ayuda {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 12px;
}

input[type="file"] {
    display: block;
    width: 100%;
    padding: 12px;
    border: 2px dashed #94a3b8;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    margin-bottom: 12px;
}

input[type="file"]:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.estado-ocr {
    background: #f1f5f9;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.92rem;
    color: #334155;
    border-left: 4px solid #2563eb;
}

/* ==========================================
   CARGA MANUAL DESPLEGABLE
   ========================================== */
.manual-box {
    margin-top: 14px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}

.manual-box summary {
    cursor: pointer;
    font-weight: 600;
    color: #2563eb;
    font-size: 0.92rem;
}

.fila-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.fila-inputs input {
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* ==========================================
   BOTONES
   ========================================== */
button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 9px 14px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.1s ease, opacity 0.2s ease;
}

button:hover {
    opacity: 0.92;
}

button:active {
    transform: scale(0.98);
}

#btn-agregar-manual {
    background-color: #2563eb;
    color: #ffffff;
}

.btn-peligro {
    background-color: #dc2626;
    color: #ffffff;
}

.btn-whatsapp {
    background-color: #16a34a;
    color: #ffffff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 13px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
}

.btn-whatsapp:hover {
    background-color: #15803d;
}

.btn-whatsapp.deshabilitado {
    background-color: #94a3b8;
    pointer-events: none;
}

/* ==========================================
   TARJETA DEL GANADOR ACTUAL
   ========================================== */
.tarjeta-ganador {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid #f59e0b;
}

.ganador-caja {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.ganador-nombre {
    font-size: 1.45rem;
    font-weight: 800;
    color: #92400e;
}

.ganador-detalle {
    font-size: 0.95rem;
    color: #78350f;
    margin-top: 4px;
}

.sin-datos {
    color: #64748b;
    font-style: italic;
}

/* ==========================================
   TABLA DE RANKING Y TELÉFONOS
   ========================================== */
.cabecera-tabla {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.tabla-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

th, td {
    padding: 11px 10px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background-color: #f8fafc;
    color: #334155;
    font-weight: 700;
}

tr.fila-lider {
    background-color: #fef9c3;
    font-weight: 600;
}

.input-tel-tabla {
    width: 145px;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
}

.guias-lista {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 400;
    margin-top: 2px;
}