* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0A0A0C;
    background-image: 
        radial-gradient(at 0% 0%, rgba(108, 92, 231, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(0, 206, 203, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(253, 121, 168, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
}

header {
    width: 100%;
    background: rgba(22, 22, 30, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: white;
}

.brand {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.brand-sub {
    font-size: 11px;
    color: #a78bfa;
    letter-spacing: 0.05em;
}

main {
    width: 100%;
    max-width: 1000px;
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.card-container {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.token-card {
    background: rgba(22, 22, 30, 0.65);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.token-card label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.token-card input,
.token-card select {
    max-width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
    background: rgba(10, 10, 12, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    color: #e2e8f0;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.token-card input:focus,
.token-card select:focus {
    border-color: #FD79A8;
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 3px rgba(253, 121, 168, 0.15);
}

.token-card select {
    max-width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
    font-weight: 500;
}

.token-card select:hover {
    border-color: #8b5cf6;
}

.token-card select option {
    background: #0f172a;
    color: #e2e8f0;
    font-weight: 500;
    padding: 10px;
}


/* ESTILOS NUEVOS ESTILO SIAN MULTI-CARGA */
.sianx-upload-card {
    background: rgba(22, 22, 30, 0.65);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}
.sianx-upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sianx-upload-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.badge-backend {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.drop-zone-dashed {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background: rgba(10, 10, 12, 0.45);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.drop-zone-dashed:hover {
    border-color: rgba(108, 92, 231, 0.6);
    background: rgba(108, 92, 231, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.drop-zone-dashed.dragover {
    border-color: #6c5ce7;
    background: rgba(108, 92, 231, 0.12);
    box-shadow: 0 0 25px rgba(108, 92, 231, 0.25);
    transform: scale(1.02);
}
.drop-icon-svg {
    margin-bottom: 16px;
    color: #818cf8;
    filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.3));
}
.drop-zone-dashed h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: white;
    font-weight: 600;
}
.drop-zone-dashed p {
    margin: 0 0 16px 0;
    font-size: 13px;
    line-height: 1.5;
}
.btn-select-manual {
    background: rgba(30, 30, 42, 0.85);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 10;
}
.btn-select-manual:hover {
    background: rgba(45, 45, 60, 0.95);
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
.sianx-alert {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.sianx-alert svg {
    flex-shrink: 0;
    color: #f59e0b;
}
.sianx-alert h4 {
    margin: 0 0 4px 0;
    color: #fbd38d;
    font-size: 13px;
    font-weight: 600;
}
.sianx-alert p {
    margin: 0;
    color: #d1d5db;
    font-size: 12px;
    line-height: 1.5;
}
.jobs-dashboard {
    margin-top: 10px;
    display: none;
    flex-direction: column;
    gap: 12px;
}
.job-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.job-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.job-name {
    font-weight: 600;
    color: white;
    font-size: 14px;
}
.job-status {
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.job-actions {
    display: flex;
    gap: 8px;
}
/* Spinner de actividad para jobs en proceso */
.sianx-pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f59e0b;
    animation: sianxPulse 1.2s ease-in-out infinite;
    vertical-align: middle;
    flex-shrink: 0;
}
@keyframes sianxPulse {
    0%   { transform: scale(1);   opacity: 1; box-shadow: 0 0 0 0 rgba(245,158,11,0.5); }
    50%  { transform: scale(1.4); opacity: 0.85; box-shadow: 0 0 0 6px rgba(245,158,11,0); }
    100% { transform: scale(1);   opacity: 1; box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}
.btn-job-review {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transition: 0.2s;
}
.btn-job-review:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.drop-zone {
    background: rgba(15, 23, 42, 0.8);
    border: 2px dashed rgba(99, 102, 241, 0.4);
    border-radius: 20px;
    padding: 60px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
}

.drop-icon {
    font-size: 56px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.4));
}

.drop-zone h2 {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.drop-zone p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
}

.drop-zone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6C5CE7 0%, #8A7CE0 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(108, 92, 231, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.progress-card {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    display: none;
}

.progress-card.visible {
    display: block;
}

.log-msg {
    margin-top: 10px;
    font-size: 12px;
    color: #94a3b8;
    font-family: 'Courier New', monospace;
    background: rgba(255,255,255,0.04);
    border-left: 3px solid #6366f1;
    padding: 8px 12px;
    border-radius: 6px;
    min-height: 24px;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.status-label {
    font-size: 14px;
    font-weight: 500;
    color: #a5b4fc;
}

.progress-bar-wrap {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 99px;
    transition: width 0.5s ease;
    width: 0%;
}

.log-msg {
    font-size: 11px;
    color: #475569;
    font-family: monospace;
    min-height: 16px;
}

.result-card {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 16px;
    padding: 24px;
    display: none;
}

.result-card.visible {
    display: block;
}

.result-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #34d399;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.btn-download {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.4);
}

.error-card {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 16px;
    padding: 20px;
    font-size: 13px;
    color: #fca5a5;
    display: none;
    width: 100%;
    max-width: 700px;
}

.error-card.visible {
    display: block;
}

/* PREMIUM HELP MODAL */
.sian-help-btn {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    background: #0f172a; border: 1px solid rgba(59,130,246,0.3);
    box-shadow: 0 0 15px rgba(59,130,246,0.3); border-radius: 99px;
    color: #60a5fa; cursor: pointer; padding: 12px 16px;
    display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px;
    font-family: 'Inter', sans-serif; transition: all 0.3s;
}
.sian-help-btn:hover {
    box-shadow: 0 0 25px rgba(59,130,246,0.5); transform: scale(1.05); color: #93c5fd;
}
.sian-help-kbd { opacity: 0.5; font-size: 11px; margin-left: 4px; }

.sian-help-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(4, 9, 20, 0.6); backdrop-filter: blur(8px);
    display: none; /* CRÍTICO: display:none evita que la capa fija intercepte scroll */
    align-items: center; justify-content: center; opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.sian-help-overlay.open { display: flex; opacity: 1; pointer-events: auto; }

.sian-help-modal {
    background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(16px);
    border: 1px solid rgba(51, 65, 85, 0.5); border-radius: 16px;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.15);
    width: 100%; max-width: 600px; transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Inter', sans-serif; overflow: hidden;
}
.sian-help-overlay.open .sian-help-modal { transform: scale(1) translateY(0); }

.sh-header { background: linear-gradient(90deg, #0f172a, rgba(30,41,59,0.8), #0f172a); padding: 24px; border-bottom: 1px solid rgba(51,65,85,0.5); display: flex; justify-content: space-between; align-items: center; }
.sh-header-title { color: white; font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 12px; }
.sh-icon-box { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.2); border-radius: 12px; padding: 8px; box-shadow: 0 0 15px rgba(59,130,246,0.4); display: flex; align-items:center; }
.sh-close { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 24px; line-height: 1; padding: 4px 8px; border-radius: 8px; transition: 0.2s; }
.sh-close:hover { background: #1e293b; color: white; }

.sh-html, .sh-body {
    overflow-x: hidden;
}

.sh-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.sh-item { background: rgba(30,41,59,0.4); border: 1px solid transparent; border-radius: 12px; padding: 16px; display: flex; gap: 16px; transition: all 0.3s; }
.sh-item:hover { background: rgba(30,41,59,0.6); border-color: rgba(59,130,246,0.3); box-shadow: 0 0 20px rgba(59,130,246,0.1); }
.sh-item svg { width: 20px; height: 20px; color: #60a5fa; flex-shrink: 0; margin-top: 2px; }
.sh-item-title { color: #e2e8f0; font-size: 14px; font-weight: 600; margin-bottom: 4px; transition: color 0.2s; }
.sh-item:hover .sh-item-title { color: #93c5fd; }
.sh-item-desc { color: #94a3b8; font-size: 13px; line-height: 1.5; margin: 0; }

.sh-footer { background: rgba(15,23,42,0.8); padding: 16px 24px; border-top: 1px solid rgba(51,65,85,0.5); display: flex; flex-direction: column; gap: 16px; }
.sh-hint { text-align: center; color: #64748b; font-size: 11px; }
.sh-hint kbd { background: #1e293b; border: 1px solid #334155; padding: 2px 6px; border-radius: 4px; color: #cbd5e1; font-family: monospace; }
.sh-btn { width: 100%; background: #2563eb; color: white; border: none; padding: 12px; border-radius: 12px; font-weight: 700; font-family: 'Inter', sans-serif; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 15px rgba(59,130,246,0.3); }
.sh-btn:hover { background: #3b82f6; box-shadow: 0 6px 20px rgba(59,130,246,0.4); }

