/* ==========================================================================
 * 03-inicio.css · parte 3/11 — Inicio: franja superior, bienvenida, mercados y análisis
 * Orden de carga obligatorio (reproduce la cascada del styles.css original).
 * No reordenar los <link> ni mover reglas entre partes sin revisar la cascada.
 * ========================================================================== */

/* ── Franja superior y hero ───────────────────────────────────── */
.close-button { border: 0; background: transparent; color: #949494; font-size: 23px; line-height: 1; }
.close-button:hover { color: var(--ink); }

/* ── Bienvenida ───────────────────────────────────────────────── */
.market-section, .analysis-section, .history-panel { padding: 27px 28px 28px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-title-row h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 17px; font-size: 25px; letter-spacing: -.02em; }
.section-title-row .close-button { align-self: flex-start; }
.cifra-symbol { display: inline-block; width: 25px; height: 25px; vertical-align: -4px; }

/* ── Mercados ─────────────────────────────────────────────────── */
.market-section { border-top: 1px solid var(--line); }
.section-title-row > div { min-width: 0; }
.section-subtitle { margin: -9px 0 17px; color: var(--muted); font-size: 13px; }
.updated-label { align-self: flex-start; color: var(--muted); font-size: 11px; white-space: nowrap; }
.updated-label i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--green); }
.market-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.market-card { overflow: hidden; min-height: 135px; padding: 14px 13px 4px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.market-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted-strong); font-size: 13px; }
.market-card-head b { color: #8a8a8a; font-weight: 400; }
.market-card-head small { font-size: 11px; }
.market-card > strong { display: block; margin-top: 7px; font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.sparkline { display: block; width: 100%; height: 57px; margin-top: 6px; }
.sparkline path { fill: none; stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.positive-line path { stroke: var(--green); }
.negative-line path { stroke: var(--red); }

/* ── Análisis ─────────────────────────────────────────────────── */
.analysis-section { border-top: 1px solid var(--line); background: var(--surface-2); }
.analysis-title { align-items: flex-start; }
.analysis-title h2 { margin: 5px 0 5px; font-size: 23px; }
.analysis-title .section-subtitle { margin-bottom: 20px; }
.scope-badge { padding: 5px 9px; border: 1px solid #d8d8d8; border-radius: 4px; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.analysis-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.analysis-layout > * { min-width: 0; }
.analysis-layout:has(.coverage-panel:not([hidden])) { grid-template-columns: minmax(0, 1.5fr) minmax(290px, .75fr); }
.panel { border: 1px solid var(--line); border-radius: 5px; background: var(--surface); box-shadow: var(--shadow); }
.upload-panel { padding: 20px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-heading.compact { margin-bottom: 13px; }
.section-index, .eyebrow { color: var(--accent-dark); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.panel h3 { margin: 6px 0 0; font-size: 18px; }
.file-rule { padding-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.file-rule span { color: var(--muted-2); }
.dropzone { display: flex; min-height: 190px; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #bfc2c5; border-radius: 5px; background: var(--surface-2); transition: .2s ease; }
.sec-analysis-entry { display: flex; min-height: 190px; flex-direction: column; align-items: center; justify-content: center; padding: 24px; border: 1px solid #e5e5e5; border-radius: 5px; background: var(--surface-2); text-align: center; }
.sec-analysis-entry h3 { margin: 0 0 8px; font-size: 15px; }
.sec-analysis-entry p { max-width: 380px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.dropzone:hover, .dropzone.dragging, .dropzone:focus-visible { border-color: var(--accent); outline: 0; background: var(--accent-faint); }
.upload-symbol { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 11px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); }
.upload-symbol svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.4; }
.dropzone h3 { margin: 0 0 4px; font-size: 15px; }
.dropzone p { margin: 0; color: var(--muted); font-size: 12px; }
.inline-link { border: 0; padding: 0; background: transparent; color: var(--accent-dark); font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.dropzone-hint { margin-top: 16px; color: #9b9b9b; font-size: 10px; }
.file-preview { display: flex; min-height: 65px; align-items: center; gap: 11px; padding: 13px; border: 1px solid #b6dfba; border-radius: 5px; background: #f0fbf1; }
.pdf-badge, .table-file { display: inline-grid; place-items: center; border-radius: 3px; background: #ffebe8; color: var(--red); font-size: 8px; font-weight: 700; }
.pdf-badge { width: 35px; height: 35px; }
.file-details { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.file-details strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.file-details span { color: var(--muted); font-size: 10px; }
.file-ready { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.remove-file { width: 24px; height: 24px; border: 0; background: transparent; color: var(--muted); font-size: 20px; }
.remove-file:hover { color: var(--red); }
.presentation-upload { margin-top: 10px; }
.presentation-select { width: 100%; min-height: 34px; border: 1px dashed #c9c9d4; border-radius: 5px; background: #fafafc; color: #5b5b6b; font-size: 11px; font-weight: 600; cursor: pointer; }
.presentation-select:hover { border-color: var(--accent); color: var(--accent-dark); }
.presentation-preview { display: flex; min-height: 52px; align-items: center; gap: 11px; padding: 10px 13px; border: 1px solid #e3d3b6; border-radius: 5px; background: #fdf9f1; }
.presentation-preview .pdf-badge { width: 30px; height: 30px; background: #fdf1dc; color: #9a5b13; }
.presentation-hint { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 15px; }
.form-footer p { display: flex; align-items: center; gap: 6px; max-width: 280px; margin-bottom: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.info-icon, .method-note > span { display: inline-grid; width: 14px; height: 14px; flex: 0 0 14px; place-items: center; border: 1px solid #aaa; border-radius: 50%; color: var(--muted); font-size: 9px; }
.primary-button, .secondary-button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 9px; border-radius: 5px; font-size: 12px; font-weight: 700; transition: .2s ease; }
.primary-button { min-width: 150px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-on); }
.primary-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.primary-button:not(:disabled):hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.primary-button:disabled { cursor: not-allowed; border-color: #ddd; background: #e8e8e8; color: var(--muted-2); }
.coverage-panel { padding: 20px; }
.method-icon { color: var(--accent); font-size: 20px; }
.method-intro { margin-bottom: 17px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mini-pipeline { padding: 1px 0; }
.mini-step { display: flex; min-height: 40px; align-items: center; gap: 9px; }
.mini-step-number { display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; border: 1px solid var(--accent-light); border-radius: 4px; color: var(--accent-dark); font-size: 10px; }
.mini-step > div { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
.mini-step strong { font-size: 12px; }
.mini-step div span { color: var(--muted); font-size: 10px; }
.mini-step > svg { width: 15px; height: 15px; fill: none; stroke: var(--green); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.mini-step.final .mini-step-number { background: var(--accent-soft); }
.pipeline-connector { width: 1px; height: 12px; margin: -2px 0 -2px 12px; border-left: 1px dashed #c5c5c5; }
.method-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 18px; padding: 10px; border: 1px solid #e4e4e4; border-radius: 4px; background: var(--surface-2); }
.method-note p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.processing-panel, .result-preview { margin-top: 15px; padding: 17px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.processing-head, .result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.processing-head h3, .result-heading h3, .result-heading h1 { margin: 6px 0 0; font-size: 15px; }
.processing-time { color: var(--muted); font-family: monospace; font-size: 10px; }
.agent-list { display: grid; gap: 5px; }
.agent-row { display: flex; min-height: 47px; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid var(--line-soft); border-radius: 4px; background: var(--surface); }
.agent-number { color: var(--muted-2); font-family: monospace; font-size: 10px; }
.agent-row > div { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
.agent-row strong { font-size: 11px; }
.agent-row div span, .agent-state { color: var(--muted-2); font-size: 9px; }
.agent-row.active { border-color: var(--accent-light); background: var(--accent-faint); }
.agent-row.active .agent-number, .agent-row.active .agent-state { color: var(--accent-dark); }
.agent-row.done { border-color: #bde0c1; }
.agent-row.done .agent-number, .agent-row.done .agent-state { color: var(--green); }
.agent-row.done .agent-state::before { content: "✓ "; }
.agent-row.error { border-color: var(--red); background: var(--red-bg); }
.agent-row.error .agent-number, .agent-row.error .agent-state { color: var(--red); }
.agent-row.error .agent-state::before { content: "✕ "; }
.analysis-error { margin: 12px 0 0; padding: 9px 11px; border: 1px solid var(--red); border-radius: 4px; background: var(--red-bg); color: var(--red); font-size: 11px; line-height: 1.45; }
.retry-button { margin-top: 10px; }
.progress-track { height: 3px; margin-top: 15px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .7s ease; }
.demo-disclaimer { margin: 12px 0 0; color: var(--muted-2); font-size: 9px; }
.demo-disclaimer code { padding: 2px 4px; border-radius: 2px; background: var(--surface-3); color: var(--muted); }
.result-status { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; white-space: nowrap; }
.result-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 7px; }
.result-score, .result-metric { min-height: 75px; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.score-label, .result-metric span, .result-metric small { display: block; color: var(--muted); font-size: 9px; }
.result-score strong { display: block; margin-top: 5px; font-size: 16px; }
.score-bar { display: block; height: 3px; margin-top: 10px; overflow: hidden; background: var(--surface-3); }
.score-bar i { display: block; width: 73%; height: 100%; background: var(--green); }
.result-metric strong { display: block; margin-top: 8px; font-family: monospace; font-size: 15px; font-weight: 600; }
.result-metric small { margin-top: 3px; }
.secondary-button { margin-top: 13px; padding: 0 14px; border: 1px solid var(--line-mid); background: var(--surface); color: var(--ink-3); }
.secondary-button:hover { border-color: var(--accent); color: var(--accent-dark); }
