* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    color: #1a1a2e;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.site-header {
    width: 100%;
    background: linear-gradient(135deg, #001a33 0%, #002b54 50%, #003d73 100%);
    border-bottom: 4px solid #f5a623;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    font-size: 32px;
    line-height: 1;
}

.header-title {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-sub {
    display: block;
    font-size: 11px;
    color: #f5a623;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-mqp img {
    display: block;
    border-radius: 4px;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px;
    flex: 1;
}

.site-footer {
    width: 100%;
    background: #001a33;
    padding: 0 20px;
    margin-top: auto;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 0;
    text-align: center;
}

.footer-inner p {
    font-size: 12px;
    color: #64748b;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

h1 {
    font-size: 24px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

h2 {
    font-size: 20px;
    color: #1a1a2e;
    margin-bottom: 16px;
}

.subtitle {
    color: #64748b;
    margin-bottom: 24px;
}

.client-info {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.client-info p {
    margin-bottom: 4px;
    font-size: 15px;
}

.partidos-grid {
    display: grid;
    gap: 16px;
}

.partido-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.partido-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.partido-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13px;
    color: #64748b;
}

.fase {
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 11px;
}

.partido-equipos {
    display: flex;
    align-items: center;
    gap: 16px;
}

.equipo {
    flex: 1;
}

.equipo label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.equipo input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 18px;
    text-align: center;
    transition: border-color 0.2s;
}

.equipo input:focus {
    outline: none;
    border-color: #059669;
}

.vs {
    font-weight: bold;
    color: #94a3b8;
    font-size: 18px;
    flex-shrink: 0;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 14px;
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 24px;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #047857;
}

.success-card {
    text-align: center;
    padding: 60px 30px;
}

.icon-check {
    width: 64px;
    height: 64px;
    background: #059669;
    color: #fff;
    border-radius: 50%;
    line-height: 64px;
    font-size: 28px;
    margin: 0 auto 20px;
}

.error-card {
    text-align: center;
    padding: 60px 30px;
}

.error-card h2 {
    color: #475569;
    margin-bottom: 12px;
}

.help-text {
    color: #64748b;
    margin-top: 12px;
    font-size: 14px;
}

.msg {
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
}

.msg.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.msg.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.msg.info {
    background: #f0f9ff;
    color: #075985;
    border: 1px solid #bae6fd;
}

.msg p {
    margin-bottom: 8px;
}

.msg a {
    word-break: break-all;
}

.msg code {
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 3px;
    word-break: break-all;
}

.admin-form {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #059669;
}

.btn-copy,
.btn-send {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}

.btn-copy {
    background: #3b82f6;
    color: #fff;
}

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

.btn-send {
    background: #059669;
    color: #fff;
}

.btn-send:hover {
    background: #047857;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table th {
    background: #f8fafc;
    font-weight: bold;
    color: #475569;
}

.table code {
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
}

.btn-generar-todos {
    background: #2563eb;
}

.btn-generar-todos:hover {
    background: #1d4ed8;
}

.resultados-table {
    margin-top: 20px;
}

.row-ok {
    background: #f0fdf4;
}

.row-skip {
    background: #f8fafc;
}

.row-skip td {
    color: #94a3b8;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.badge-success {
    background: #f0fdf4;
    color: #166534;
}

.badge-secondary {
    background: #e2e8f0;
    color: #64748b;
}

.url-link {
    color: #2563eb;
    font-size: 13px;
    text-decoration: none;
    word-break: break-all;
}

.url-link:hover {
    text-decoration: underline;
}

.btn-sm {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 4px;
}

.btn-logout {
    display: inline-block;
    padding: 6px 14px;
    background: #dc2626;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
}

.btn-logout:hover {
    background: #b91c1c;
}

.btn-individual {
    background: #7c3aed;
}

.btn-individual:hover {
    background: #6d28d9;
}

.btn-send.msg-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 4px;
}

.btn-send.msg-btn:hover {
    background: #047857;
}

.admin-nav {
    display: flex;
    gap: 4px;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    flex-wrap: wrap;
}

.admin-nav-link {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    color: #475569;
    transition: background 0.2s, color 0.2s;
}

.admin-nav-link:hover {
    background: #f1f5f9;
    color: #0b1a30;
}

.admin-nav-link.active {
    background: #0b1a30;
    color: #ffcc00;
}

.admin-nav-logout {
    margin-left: auto;
    color: #dc2626;
}

.admin-nav-logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.input-gol {
    width: 70px;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.input-gol::-webkit-outer-spin-button,
.input-gol::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-gol:focus {
    outline: none;
    border-color: #7c3aed;
}

.resultados-reales-table th:last-child,
.resultados-reales-table td:last-child {
    text-align: center;
}

.resultados-reales-table td {
    vertical-align: middle;
}

.ranking-table .puesto {
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    color: #64748b;
}

.ranking-table .aciertos-col {
    text-align: center;
}

.badge-aciertos {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 900;
    background: #eff6ff;
    color: #1d4ed8;
}

.row-oro {
    background: #fffbeb !important;
}

.row-oro .puesto {
    color: #d97706;
}

.row-oro td:first-child {
    border-left: 4px solid #f59e0b;
}

.row-plata {
    background: #f8fafc !important;
}

.row-plata .puesto {
    color: #64748b;
}

@media (max-width: 600px) {
    .partido-equipos {
        flex-direction: column;
        gap: 12px;
    }

    .vs {
        font-size: 14px;
    }

    .container {
        padding: 16px 12px;
    }

    .header-inner {
        height: 56px;
    }

    .header-title {
        font-size: 15px;
    }

    .header-sub {
        font-size: 10px;
    }

    .header-icon {
        font-size: 26px;
    }

    .header-mqp img {
        width: 70px;
        height: auto;
    }

    .card {
        padding: 20px;
    }
}

.td-partido {
    min-width: 180px;
}

.partido-fecha {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.input-dt {
    width: 100%;
    min-width: 160px;
    padding: 8px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-dt:focus {
    outline: none;
    border-color: #7c3aed;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 0;
}

.btn-resultados {
    background: #7c3aed;
}

.btn-resultados:hover {
    background: #6d28d9;
}

.lote-actions {
    margin-top: 20px;
    text-align: center;
}

.btn-enviar-todos {
    background: #dc2626;
    display: inline-block;
    width: auto;
    padding: 14px 32px;
}

.btn-enviar-todos:hover {
    background: #b91c1c;
}

.btn-enviar-todos:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== LOADING STATES ========== */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.loading::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== TOAST ========== */

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}

.toast {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    animation: toastIn 0.3s ease;
    color: #fff;
    word-break: break-word;
}

.toast-success {
    background: #059669;
}

.toast-error {
    background: #dc2626;
}

.toast-info {
    background: #2563eb;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== CONFIRM MODAL ========== */

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.15s ease;
}

.confirm-dialog {
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.confirm-mensaje {
    font-size: 16px;
    color: #1a1a2e;
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-confirm {
    padding: 10px 32px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-confirm-si {
    background: #059669;
    color: #fff;
}

.btn-confirm-si:hover {
    background: #047857;
}

.btn-confirm-no {
    background: #e2e8f0;
    color: #475569;
}

.btn-confirm-no:hover {
    background: #cbd5e1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
