:root {
  --topbar-height: 62px;
  --sidebar-width: 270px;
  --ink: #202020;
  --muted: #68717b;
  --soft-muted: #94999e;
  --line: #d9dadd;
  --line-soft: #e9eaec;
  --surface: #fff;
  --surface-soft: #f7f7f8;
  --topbar: #1e293b;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #e0e7ff;
  --yellow: #fffbc4;
  --green: #38ad4f;
  --red: #f04b43;
  --shadow: 0 1px 3px rgba(25, 25, 25, .12);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Visibilidad estricta para elementos de Administrador */
body:not(.is-admin) .admin-only,
body:not(.is-admin) .nav-link-admin,
body:not(.is-admin) #nav-item-reportes,
.admin-only[hidden],
.nav-link-admin[hidden],
#nav-item-reportes[hidden] {
  display: none !important;
}
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: #fff; color: var(--ink); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }

/* ── Estructura principal ─────────────────────────────────────── */
.app-shell { min-height: 100vh; }
.topbar { position: fixed; top: 0; right: 0; left: 0; z-index: 20; display: flex; height: var(--topbar-height); align-items: center; background: var(--topbar); color: #fff; }
.brand-area { display: flex; width: var(--sidebar-width); height: 100%; flex: 0 0 var(--sidebar-width); align-items: center; justify-content: space-between; padding: 0 12px 0 24px; border-right: 1px solid #334155; }
.brand-lockup { display: flex; align-items: center; gap: 8px; min-width: 0; color: #fff; }
.brand-lockup strong { overflow: hidden; font-size: 16px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark, .cifra-symbol { color: var(--accent); font-size: 20px; line-height: 1; }
.topbar .brand-mark { color: #818cf8; }
.brand-mark { display: inline-block; transform: scaleX(.8); }
.collapse-button, .settings-button { display: inline-grid; width: 25px; height: 25px; place-items: center; border: 0; border-radius: 3px; background: transparent; color: #aaa; }
.collapse-button:hover, .settings-button:hover { background: #334155; color: #fff; }
.collapse-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.search-wrap { position: relative; display: flex; width: min(685px, 48vw); height: 48px; align-items: center; margin-left: 16px; border-radius: 8px; background: #fff; color: #8c949c; }
.search-wrap > svg { width: 20px; height: 20px; margin-left: 15px; fill: none; stroke: #6a7784; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.search-wrap input { width: 100%; height: 100%; border: 0; outline: 0; padding: 0 12px 0 9px; border-radius: inherit; background: transparent; color: #252525; font-size: 16px; font-weight: 600; }
.search-wrap input::placeholder { color: #9ba1a7; opacity: 1; }
.search-shortcut { display: grid; width: 40px; height: 100%; place-items: center; color: #65717c; font-size: 21px; }
.search-results { position: absolute; top: 52px; right: 0; left: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.18); color: var(--ink); }
.search-result { display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13px; width: 100%; border-left: 0; border-right: 0; border-top: 0; background: transparent; text-align: left; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: #eef2ff; }
.search-result strong { margin-left: auto; color: var(--accent-dark); font-size: 12px; }
.search-result span { color: var(--muted); }
.search-result-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-pf-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 6px;
}
.search-result-logo { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 4px; object-fit: cover; }
.search-result-logo-fallback { display: grid; place-items: center; background: #f2f2f2; color: #8c949c; font-size: 11px; font-weight: 700; }
.search-empty { padding: 11px 14px; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 11px; margin-left: auto; padding: 0 14px 0 12px; }
.promo-button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
.promo-button:hover { background: #6366f1; }
.ghost-button { min-height: 36px; padding: 0 14px; border: 1px solid #475569; border-radius: 9px; background: transparent; color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
.ghost-button:hover { background: #334155; color: #fff; }
.user-chip { display: flex; min-height: 38px; align-items: center; gap: 9px; padding: 0 9px 0 5px; border-radius: 9px; background: #334155; }
.user-avatar { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.user-email { max-width: 150px; overflow: hidden; color: #ddd; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-logout { border: 0; background: transparent; color: #a8a8a8; font-size: 17px; line-height: 1; }
.user-logout:hover { color: #fff; }
.settings-button { width: 30px; height: 30px; color: #818cf8; }
.settings-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.sidebar { position: fixed; top: var(--topbar-height); bottom: 0; left: 0; z-index: 15; display: flex; width: var(--sidebar-width); flex-direction: column; overflow: hidden auto; border-right: 1px solid #d7d7d7; background: #f7f7f7; transition: width .2s ease, transform .2s ease; }
.main-nav { padding: 10px 11px 20px; }
.nav-link { display: flex; min-height: 31px; align-items: center; gap: 11px; overflow: hidden; padding: 0 12px; border-radius: 8px; color: #323a42; font-size: 13.5px; white-space: nowrap; }
.nav-link:hover { background: #ececec; color: #131313; }
.nav-link.active { background: #e0e7ff; color: var(--accent-dark); }
.nav-link svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: #68727a; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.nav-link.active svg { stroke: var(--accent); }
.nav-link > span { overflow: hidden; text-overflow: ellipsis; }
.nav-section { margin-top: 13px; }
.nav-section-title { display: flex; align-items: center; gap: 5px; padding: 0 13px 6px; color: #81868b; font-size: 12px; }
.nav-section-title span { font-size: 14px; }
.new-badge { margin-left: auto; padding: 3px 6px; border: 1px solid #818cf8; border-radius: 10px; color: #4f46e5; font-size: 9px; font-weight: 700; }
.nav-arrow { margin-left: auto; color: #70767c; font-size: 20px; font-style: normal; line-height: 1; }
.sidebar-footer { margin-top: auto; padding: 10px 12px; border-top: 1px solid #ddd; display: flex; flex-direction: column; gap: 8px; }

/* Cabecera de la empresa dentro del menú lateral */
.company-nav-head { display: flex; align-items: center; gap: 9px; margin: 16px 11px 2px; padding: 8px 9px; border-top: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2; border-radius: 8px; background: #f0f0f0; }
.company-nav-logo { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); font-size: 13px; font-weight: 700; }
.company-nav-copy { min-width: 0; flex: 1; }
.company-nav-copy strong { display: block; overflow: hidden; color: #323a42; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.company-nav-copy small { display: block; margin-top: 1px; color: #9a9a9a; font-size: 9.5px; }
.app-shell.sidebar-collapsed .company-nav-head { display: none; }
.account-card { display: flex; align-items: center; gap: 9px; }
.avatar { display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; }
.account-card div { min-width: 0; flex: 1; }
.account-card strong, .account-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-card strong { font-size: 11px; }
.account-card small { margin-top: 2px; color: var(--soft-muted); font-size: 10px; }
.account-card button { border: 0; background: transparent; color: #929292; font-size: 14px; }
.account-action { color: var(--accent-dark) !important; font-size: 12px !important; font-weight: 700; }
.account-action:hover { color: #3730a3 !important; }
.backdrop { display: none; }

.main-content { min-height: 100vh; margin-left: var(--sidebar-width); padding-top: var(--topbar-height); background: #fff; transition: margin-left .2s ease; }
.content-wrap { max-width: 1700px; margin: 0 auto; }

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

/* ── 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 { font-size: 25px; }

/* ── 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: #888; 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: #fff; }
.market-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #444; 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: #f7f7f7; }
.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: #777; font-size: 10px; font-weight: 700; white-space: nowrap; }
.analysis-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, .75fr); gap: 16px; }
.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: #bbb; }
.dropzone { display: flex; min-height: 190px; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #bfc2c5; border-radius: 5px; background: #fbfbfb; 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: #fbfbfb; 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: #eef2ff; }
.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: #888; 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: #888; 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: #fff; }
.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: #6366f1; }
.primary-button:disabled { cursor: not-allowed; border-color: #ddd; background: #e8e8e8; color: #999; }
.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 #a5b4fc; 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: #fafafa; }
.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: #fafafa; }
.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 { 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: #fff; }
.agent-number { color: #999; 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: #999; font-size: 9px; }
.agent-row.active { border-color: #a5b4fc; background: #eef2ff; }
.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: #fdf3f3; }
.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: #fdf3f3; 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: #e5e5e5; }
.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: #999; font-size: 9px; }
.demo-disclaimer code { padding: 2px 4px; border-radius: 2px; background: #eee; color: #666; }
.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: #fff; }
.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: #eee; }
.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 #bbb; background: #fff; color: #333; }
.secondary-button:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ── Cribador (screener) ───────────────────────────────────────── */
.screener-section { padding: 27px 28px 28px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--topbar-height) + 10px); }
.screener-search { display: flex; max-width: 560px; height: 42px; align-items: center; gap: 8px; margin-bottom: 14px; padding: 0 6px 0 12px; border: 1px solid #cfcfcf; border-radius: 6px; background: #fff; }
.screener-search svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: #6a7784; stroke-linecap: round; stroke-width: 2; }
.screener-search input { flex: 1; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.screener-search input::placeholder { color: #9ba1a7; }
.screener-search .primary-button { min-width: 110px; min-height: 32px; }
.screener-error { margin: 0 0 12px; padding: 9px 11px; border: 1px solid var(--red); border-radius: 4px; background: #fdf3f3; color: var(--red); font-size: 11px; line-height: 1.45; }
.screener-loading { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.screener-company-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 4px 0 14px; }
.screener-company-head h3 { margin: 5px 0 2px; font-size: 21px; color: #333; }
.screener-company-head h3 .ticker-chip { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-dark); font-size: 11px; font-weight: 700; vertical-align: middle; }
.screener-company-head .section-subtitle { margin: 0; }
.screener-controls { display: flex; align-items: center; gap: 10px; }
.screener-currency { display: inline-grid; height: 30px; place-items: center; padding: 0 12px; border: 1px solid #cfcfcf; border-radius: 6px; color: #555; font-size: 11px; font-weight: 700; }
.screener-period-toggle { display: flex; overflow: hidden; border: 1px solid #cfcfcf; border-radius: 6px; }
.screener-period-toggle button { min-height: 30px; padding: 0 14px; border: 0; background: #f2f2f2; color: var(--muted); font-size: 11px; font-weight: 700; }
.screener-period-toggle button.active { background: #fff; color: #333; box-shadow: inset 0 -2px 0 var(--accent); }

/* ── Perfil de empresa ─────────────────────────────────────────── */
.company-profile { margin: 3px 0 17px; }
.profile-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.profile-section-heading h4 { margin: 4px 0 0; color: #333; font-size: 17px; }
.profile-source { color: #999; font-size: 9px; text-align: right; }
.profile-quote-card { display: flex; min-height: 112px; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; padding: 15px 18px; border: 1px solid #c7d2fe; border-radius: 5px; background: #eef2ff; }
.profile-quote-copy { display: flex; min-width: 170px; flex-direction: column; gap: 3px; }
.profile-label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.profile-price { color: #202020; font-family: Georgia, serif; font-size: 27px; font-weight: 400; letter-spacing: -.02em; }
.profile-price-change { min-height: 16px; font-size: 12px; font-weight: 700; }
.profile-price-change.positive { color: var(--green); }
.profile-price-change.negative { color: var(--red); }
.profile-quote-copy small { color: #999; font-size: 9px; }
.profile-sparkline { width: min(430px, 55%); height: 78px; overflow: visible; }
.profile-sparkline-line { fill: none; stroke: var(--green); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.profile-sparkline-area { fill: rgba(56, 173, 79, .09); stroke: none; }
.profile-sparkline.negative .profile-sparkline-line { stroke: var(--red); }
.profile-sparkline.negative .profile-sparkline-area { fill: rgba(240, 75, 67, .08); }
.profile-card-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.profile-card, .profile-description-card { border: 1px solid var(--line); border-radius: 5px; background: #fff; box-shadow: var(--shadow); }
.profile-card { padding: 14px 16px 9px; }
.profile-card h5, .profile-description-card h5 { display: flex; align-items: center; gap: 5px; margin: 0 0 9px; color: #333; font-size: 14px; }
.profile-info-dot { display: inline-grid; width: 14px; height: 14px; place-items: center; border: 1px solid #9da3a8; border-radius: 50%; color: #7c858c; font-size: 9px; font-weight: 400; }
.profile-list { margin: 0; }
.profile-list > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, auto); align-items: center; gap: 12px; min-height: 28px; border-bottom: 1px solid var(--line-soft); }
.profile-list > div:last-child { border-bottom: 0; }
.profile-list dt, .profile-list dd { min-width: 0; margin: 0; font-size: 11px; line-height: 1.25; }
.profile-list dt { color: #202020; font-weight: 700; }
.profile-list dd { overflow-wrap: anywhere; color: #657c98; text-align: right; }
.profile-description-card { margin-top: 12px; padding: 14px 16px 13px; }
.profile-description-card p { margin: 0; color: #657c98; font-size: 11px; line-height: 1.5; }
.screener-tabs { display: flex; gap: 4px; border-bottom: 2px solid #ddd; }
.screener-tab { min-height: 36px; padding: 0 16px; border: 0; background: transparent; color: #777; font-size: 12px; font-weight: 700; }
.screener-tab:hover { color: #333; }
.screener-tab.active { color: #333; box-shadow: inset 0 -2px 0 var(--accent); }
.screener-tab-disabled { color: #999; font-weight: 400; }
.screener-advice { display: flex; align-items: center; gap: 4px; margin: 9px 0 7px; padding: 6px 9px; border: 1px solid #c7d2fe; border-radius: 4px; background: #f5f7ff; color: #555; font-size: 10px; }
.screener-advice strong { color: #333; }
.screener-advice-close { margin-left: auto; padding: 0 2px; border: 0; background: transparent; color: #333; font-size: 15px; line-height: 1; }
.screener-advice-close:hover { color: var(--accent-dark); }
.screener-block { padding-top: 12px; }
.screener-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 7px; }
.screener-units { color: #999; font-size: 10px; }
.screener-period-range { color: #777; font-size: 10px; }
.screener-tools { display: flex; margin-left: auto; border: 1px solid #d6d6d6; border-radius: 3px; overflow: hidden; }
.screener-tools button { min-width: 27px; height: 24px; padding: 0 5px; border: 0; border-right: 1px solid #ddd; background: #fff; color: #555; font-size: 10px; }
.screener-tools button:last-child { border-right: 0; }
.screener-tools button.active, .screener-tools button:hover { background: #e0e7ff; color: #4338ca; }
.screener-margins-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; padding: 6px 10px; border: 1px solid #e7e7e7; border-radius: 4px; background: #fafafa; }
.screener-margins-bar[hidden] { display: none; }
.screener-margins-label { color: #555; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.screener-margins-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.screener-margin-chip { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border: 1px solid #d5d5d5; border-radius: 12px; background: #fff; color: #444; font-size: 10px; font-weight: 500; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.screener-margin-chip:hover { background: #eef2ff; border-color: var(--accent); color: #222; }
.screener-margin-chip.active { background: #e0e7ff; border-color: var(--accent); color: #111; font-weight: 700; }
.margin-chip-dot { display: inline-block; width: 7px; height: 7px; border: 1.5px solid #999; border-radius: 50%; background: transparent; transition: all .12s; }
.screener-margin-chip.active .margin-chip-dot { border-color: var(--accent); background: var(--accent); }
/* Contenedor con barra horizontal con estilo y soporte para arrastrar */
.screener-table-wrap {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #c4c4c4 #f1f1f1;
  -webkit-overflow-scrolling: touch;
}
.screener-table-wrap::-webkit-scrollbar {
  height: 9px;
}
.screener-table-wrap::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
.screener-table-wrap::-webkit-scrollbar-thumb {
  background: #c5c5c5;
  border-radius: 4px;
}
.screener-table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
.screener-table-wrap.can-scroll td:not(.sticky-col),
.screener-table-wrap.can-scroll th:not(.sticky-col) {
  cursor: grab;
}
.screener-table-wrap.is-dragging,
.screener-table-wrap.is-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
body.screener-table-dragging {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.screener-block table {
  width: 100%;
  min-width: fit-content;
  max-width: fit-content;
  margin: 0 auto;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.screener-block th {
  padding: 6px 9px;
  border-bottom: 1px solid #bdbdbd;
  background: #1e293b;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  box-sizing: border-box;
}
.screener-block th.sticky-col {
  text-align: left;
}
.screener-block td {
  padding: 5px 9px;
  border-bottom: 1px solid #e4e4e4;
  color: #333;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  box-sizing: border-box;
}
.screener-block td.sticky-col {
  color: #333;
  font-weight: 400;
  text-align: left;
}
.screener-block th:not(.sticky-col),
.screener-block td:not(.sticky-col) {
  min-width: 90px;
}
.screener-block tbody tr:hover td {
  background: #fafafa;
}
.screener-block tbody tr:hover td.sticky-col {
  background: #fafafa;
}
.screener-block th.sticky-col,
.screener-block td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 330px;
  min-width: 330px;
  max-width: 330px;
  background: #fff;
  border-right: 1px solid #e2e2e2;
}
.screener-block th.sticky-col {
  z-index: 3;
  background: #1e293b;
  color: #fff;
  border-right: 1px solid #334155;
}
.screener-table-wrap.is-scrolled th.sticky-col,
.screener-table-wrap.is-scrolled td.sticky-col {
  box-shadow: 3px 0 6px -2px rgba(0, 0, 0, 0.12);
}
.screener-block tr.emphasis-row td {
  background: #eef2ff;
  color: #111;
  font-weight: 700;
}
.screener-block tr.emphasis-row td.sticky-col {
  background: #eef2ff;
  color: #111;
  font-weight: 700;
}
.screener-block tr.emphasis-row:hover td,
.screener-block tr.emphasis-row:hover td.sticky-col {
  background: #e0e7ff;
}
.screener-block tr.section-row td {
  padding-top: 10px;
  padding-bottom: 4px;
  border-bottom: 0;
  color: #555;
  font-weight: 700;
}
.screener-block tr.section-row td.sticky-col,
.screener-block tr.note-row td.sticky-col {
  max-width: none;
}
.screener-block tr.note-row td {
  border-bottom: 0;
  color: #777;
  font-size: 9px;
  font-style: italic;
}
.screener-block tr.derived-row td {
  color: #555;
  font-style: italic;
}
.screener-block tr.derived-row td.sticky-col {
  padding-left: 22px;
}
.screener-block td.negative,
.screener-block tr.emphasis-row td.negative,
.screener-block tr.derived-row td.negative {
  color: var(--red);
}
.pro-pill {
  display: inline-flex;
  min-width: 31px;
  height: 14px;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 3px;
  border: 1px solid #c8c8c8;
  border-radius: 2px;
  background: #fafafa;
  color: #777;
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}
.pro-pill i {
  display: inline-block;
  width: 5px;
  height: 5px;
  border: 1px solid #888;
  border-radius: 1px;
  background: #fff;
}
.screener-block tr[data-metric] td:first-child {
  cursor: pointer;
}
.screener-block table.table-compact td {
  padding-top: 3px;
  padding-bottom: 3px;
}

/* ── Gráfico de métricas (datos financieros) ────────────────── */
.screener-range { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 5px; background: #fcfcfc; }
.screener-range-label { color: #666; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.screener-range-inputs { position: relative; width: min(340px, 62%); height: 20px; }
.screener-range-track { position: absolute; top: 7px; left: 0; width: 100%; height: 6px; border-radius: 3px; background: #e2e2e2; }
.screener-range-inputs input[type="range"] { position: absolute; top: 0; left: 0; width: 100%; height: 20px; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; pointer-events: none; }
#screener-range-min { z-index: 3; }
#screener-range-max { z-index: 2; }
.screener-range-inputs input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border: 2px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); pointer-events: auto; cursor: grab; }
.screener-range-inputs input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); pointer-events: auto; cursor: grab; }
.screener-range-inputs input[type="range"]::-moz-range-track { height: 6px; background: transparent; }
.screener-range-values { color: #444; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.screener-block tbody tr.chart-selected td { background: #e0e7ff; }
.screener-block tbody tr.chart-selected td.sticky-col { background: #e0e7ff; box-shadow: inset 3px 0 0 var(--accent); }
.screener-block tbody tr.chart-selected:hover td,
.screener-block tbody tr.chart-selected:hover td.sticky-col { background: #c7d2fe; }
.metric-chart-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; vertical-align: 1px; }
.metrics-chart-block { position: relative; margin-bottom: 12px; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; box-shadow: var(--shadow); }
.metrics-chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.metrics-chart-head-left { display: flex; align-items: center; gap: 8px; }
.metrics-chart-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.metrics-compare-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.metrics-compare-label { font-size: 10px; font-weight: 700; color: #777; text-transform: uppercase; letter-spacing: 0.4px; }
.metrics-compare-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.metrics-company-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border: 1px solid #d4d8de; border-radius: 12px; background: #f4f6f8; font-size: 11px; font-weight: 700; color: #333; }
.metrics-company-chip.base-chip { border-color: #c7d2fe; background: #eef2ff; color: #4338ca; }
.metrics-company-chip .chip-badge { font-size: 8.5px; font-weight: 700; padding: 1px 4px; border-radius: 4px; background: rgba(185, 103, 0, 0.14); color: #4338ca; text-transform: uppercase; }
.metrics-company-chip.loading-chip { opacity: 0.7; border-style: dashed; }
.metrics-company-chip .chip-spinner { font-size: 12px; animation: chipPulse 1s infinite alternate; }
@keyframes chipPulse { from { opacity: 0.3; } to { opacity: 1; } }
.metrics-company-chip-remove { display: grid; width: 14px; height: 14px; place-items: center; border: 0; border-radius: 50%; background: #d6dae0; color: #555; font-size: 11px; line-height: 1; cursor: pointer; padding: 0; margin-left: 2px; transition: all 0.15s ease; }
.metrics-company-chip-remove:hover { background: #fdecec; color: var(--red); }
.metrics-compare-add-wrap { position: relative; }
.metrics-compare-add-btn { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border: 1px dashed #b0b8c4; border-radius: 12px; background: #fff; color: #555; font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.metrics-compare-add-btn:hover { border-color: var(--accent); color: var(--accent-dark); background: #f8faff; }
.metrics-compare-add-btn svg { color: var(--accent); }
.metrics-compare-popover { position: absolute; top: calc(100% + 4px); right: 0; z-index: 50; width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); padding: 8px; }
.metrics-compare-popover[hidden] { display: none; }
.metrics-compare-search-box { display: flex; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid #d2d6dc; border-radius: 5px; background: #fafafa; }
.metrics-compare-search-box svg { flex-shrink: 0; stroke: #888; }
.metrics-compare-search-box input { width: 100%; height: 30px; border: 0; background: transparent; outline: none; font-size: 11.5px; color: #222; }
.metrics-compare-results { margin-top: 6px; max-height: 190px; overflow-y: auto; }
.metrics-compare-results[hidden] { display: none; }
.metrics-compare-result-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 4px; background: transparent; text-align: left; cursor: pointer; font-size: 11px; transition: background 0.1s ease; }
.metrics-compare-result-item:hover { background: #f2f5f8; }
.metrics-compare-res-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #444; }
.metrics-compare-result-item strong { color: var(--accent-dark); font-size: 11px; flex-shrink: 0; }
.metrics-compare-empty, .metrics-compare-loading, .metrics-compare-hint { padding: 9px 8px; font-size: 11px; color: var(--muted); text-align: center; }
.metrics-chart-placeholder { display: flex; align-items: center; justify-content: center; min-height: 180px; padding: 24px; text-align: center; }
.metrics-chart-placeholder-card { max-width: 440px; padding: 18px 22px; border: 1px dashed #d6dae0; border-radius: 8px; background: #fafbfc; }
.metrics-chart-placeholder-card .placeholder-icon { font-size: 24px; display: block; margin-bottom: 6px; }
.metrics-chart-placeholder-card strong { display: block; font-size: 13px; color: #333; margin-bottom: 4px; }
.metrics-chart-placeholder-card p { margin: 0; font-size: 11.5px; color: #666; line-height: 1.45; }
.screener-compare-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border: 1px solid #cfcfcf; border-radius: 6px; background: #fff; color: #444; font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.screener-compare-btn:hover { border-color: var(--accent); color: var(--accent-dark); background: #f8faff; }
.screener-compare-btn svg { color: var(--accent); }
.metrics-chart-head h5 { display: flex; align-items: center; gap: 8px; margin: 0; color: #333; font-size: 14px; }
.metrics-chart-hint { color: var(--muted); font-size: 11px; font-weight: 400; }
.metrics-chart-clear { height: 24px; padding: 0 10px; border: 1px solid #d6d6d6; border-radius: 4px; background: #fff; color: #666; font-size: 10px; cursor: pointer; }
.metrics-chart-clear:hover { background: #e0e7ff; color: #4338ca; }
.metrics-chart-legend { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 4px 0 10px; }
.metrics-palette { position: absolute; z-index: 20; display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
.metrics-palette-color { width: 18px; height: 18px; padding: 0; border: 2px solid transparent; border-radius: 50%; cursor: pointer; }
.metrics-palette-color:hover { transform: scale(1.2); }
.metrics-palette-color.active { border-color: #222; }
.metrics-legend-item { display: inline-flex; align-items: center; gap: 7px; padding: 3px 8px 3px 5px; border: 1px solid var(--line); border-radius: 14px; background: #fafafa; font-size: 11px; }
.metrics-swatch { width: 16px; height: 16px; padding: 0; border: 1px solid rgba(0, 0, 0, .18); border-radius: 50%; cursor: pointer; }
.metrics-swatch:hover { transform: scale(1.15); }
.metrics-legend-label { max-width: 230px; overflow: hidden; color: #444; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.metrics-legend-type { padding: 1px 7px; border-radius: 8px; background: #eef1f5; color: #7a8595; font-size: 9.5px; font-weight: 700; }
.metric-cagr-line { fill: none; stroke: #111; stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.metric-cagr-label { position: absolute; z-index: 5; padding: 2px 6px; border-radius: 3px; background: #111; color: #fff; font-size: 9.5px; font-weight: 700; line-height: 1.35; white-space: nowrap; transform: translate(-50%, -50%); cursor: grab; }
.metric-cagr-label.dragging { cursor: grabbing; }
.metrics-legend-remove { display: grid; width: 17px; height: 17px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: #e4e6ea; color: #666; font-size: 12px; line-height: 1; cursor: pointer; }
.metrics-legend-remove:hover { background: #fdecec; color: var(--red); }
.metrics-chart-body { position: relative; min-height: 300px; }
#metrics-chart { display: block; width: 100%; height: 300px; }
.metric-line { fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.metric-dot { fill: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.metrics-chart-tooltip-row { display: flex; align-items: center; gap: 6px; }
.metrics-chart-tooltip-row .metric-legend-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; }
.metrics-chart-tooltip-row b { margin-left: auto; padding-left: 14px; font-family: Georgia, serif; font-size: 12px; font-weight: 400; white-space: nowrap; }

/* ── Resultados (filings) del screener ─────────────────────────── */
.screener-toolbar[hidden], .screener-period-toggle[hidden] { display: none; }
.filings-view { padding-top: 12px; }
.filings-head { display: flex; align-items: center; gap: 12px; margin-bottom: 7px; }
.screener-block table.filings-table { table-layout: auto; min-width: 640px; }
.filings-table th, .filings-table td { text-align: left; white-space: nowrap; }
.filings-table th { padding: 8px 12px; font-size: 9px; }
.filings-table td { padding: 8px 12px; font-size: 11px; color: #444; }
.filings-table td:first-child { display: table-cell; color: #444; }
.filings-table tbody tr:hover td, .filings-table tbody tr:hover td.sticky-col { background: #fafafa; }
.filing-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 20px; padding: 0 7px; border-radius: 3px; font-size: 9px; font-weight: 700; }
.filing-badge-10q { border: 1px solid #c9d9e8; background: #eef3f8; color: #24548f; }
.filing-badge-10k { border: 1px solid #c7d2fe; background: #e0e7ff; color: #4338ca; }
.filing-action-presentation { border-color: #f3d3a8; background: #fdf4e7; color: #9a5b13; white-space: nowrap; }
.filing-action-presentation:hover { border-color: #d99a3f; color: #7a4610; }
.filing-action-release { border-color: #cbd5e1; background: #f8fafc; color: #475569; white-space: nowrap; }
.filing-action-release:hover { border-color: #94a3b8; color: #1e293b; }
.filing-period { color: #333; font-weight: 600; }
.filing-date { color: #777; font-size: 10px; }
.filing-actions { display: flex; gap: 6px; }
.filing-action { display: inline-flex; height: 24px; align-items: center; padding: 0 9px; border: 1px solid #ccc; border-radius: 3px; background: #fff; color: #555; font-size: 10px; font-weight: 600; cursor: pointer; text-decoration: none; }
.filing-action:hover { border-color: var(--accent); color: var(--accent-dark); }
.filing-action-download { border-color: #c7d2fe; background: #f8faff; color: #4338ca; }
.filing-action-analyze { border-color: #a8d8b1; background: #f2fbf4; color: #22703a; white-space: nowrap; }
.filing-action-analyze:hover { border-color: var(--green); color: #1c5c30; }
.filing-action-analyze.filing-action-locked { border-color: #d8dde3; background: #f8fafc; color: #64748b; cursor: pointer; }
.filing-action-analyze.filing-action-locked:hover { border-color: #cbd5e1; background: #f1f5f9; color: #475569; }
.filing-action-analyze.filing-action-ready { border-color: #16a34a; background: #ecfdf5; color: #15803d; font-weight: 700; }
.filing-action-analyze.filing-action-ready:hover { border-color: #15803d; background: #d1fae5; color: #166534; }
.filing-rating-pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 3px; font-size: 10px; font-weight: 700; border: 1px solid #fde68a; background: #fffbeb; color: #b45309; white-space: nowrap; cursor: pointer; user-select: none; transition: all 0.15s ease; }
.filing-rating-pill:hover { background: #fef3c7; border-color: #f59e0b; color: #92400e; transform: translateY(-1px); box-shadow: 0 1px 3px rgba(245, 158, 11, 0.25); }
.filing-rating-pill .filing-rating-star { color: #f59e0b; font-size: 11px; line-height: 1; }
.filing-rating-pill-empty { border-color: #e2e8f0; background: #f8fafc; color: #64748b; }
.filing-rating-pill-empty:hover { background: #f1f5f9; border-color: #cbd5e1; color: #475569; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); }
.filing-rating-pill-empty .filing-rating-star { color: #94a3b8; }
.filing-lock-icon { margin-right: 4px; vertical-align: -1px; opacity: 0.85; }
.filing-lock-pill { display: inline-flex; align-items: center; margin-left: 5px; padding: 1px 5px; border-radius: 3px; background: #e2e8f0; color: #475569; font-size: 8.5px; font-weight: 700; line-height: 1.2; text-transform: uppercase; letter-spacing: 0.2px; }
.filings-scope-note { margin-left: auto; font-size: 10.5px; font-weight: 500; color: #64748b; background: #f1f5f9; border: 1px solid #e2e8f0; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.filing-action-loading { display: inline-flex; height: 24px; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid #e2e8f0; border-radius: 3px; background: #f8fafc; color: #64748b; font-size: 9.5px; font-weight: 600; white-space: nowrap; cursor: default; user-select: none; }
.filing-action-loading:hover { border-color: #e2e8f0; color: #64748b; }
.filing-table-loading-cell { text-align: center !important; padding: 40px 16px !important; color: #64748b; font-size: 12px; font-weight: 500; }
.filing-table-loading-cell .loading-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #e2e8f0; border-top-color: var(--accent); border-radius: 50%; animation: filings-spin .8s linear infinite; vertical-align: -3px; margin-right: 8px; }
.loading-spinner-sm { display: inline-block; width: 10px; height: 10px; border: 1.5px solid rgba(100, 116, 139, .3); border-top-color: currentColor; border-radius: 50%; animation: filings-spin .8s linear infinite; vertical-align: -1px; }
.filings-presentations-status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; color: #92400e; background: #fef3c7; border: 1px solid #fde68a; white-space: nowrap; }
.filings-presentations-status[hidden] { display: none; }
.filings-presentations-status .loading-spinner-sm { border-color: rgba(180, 83, 9, .25); border-top-color: #b45309; }

/* ── Modal de vista previa de informes ─────────────────────────── */
.filings-preview-backdrop { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 22px; background: rgba(0, 0, 0, .75); }
.filings-preview-backdrop[hidden] { display: none; }
.filings-preview { display: flex; flex-direction: column; width: min(1100px, 96vw); height: min(86vh, 900px); overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 22px 55px rgba(0,0,0,.4); }
.filings-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafafa; }
.filings-preview-head strong { color: #333; font-size: 12px; }
.filings-preview-actions { display: flex; align-items: center; gap: 14px; }
.filings-preview-actions a { color: var(--accent-dark); font-size: 11px; font-weight: 600; text-decoration: none; }
.filings-preview-actions a:hover { text-decoration: underline; }
.filings-preview-close { border: 0; background: transparent; color: #888; font-size: 22px; line-height: 1; cursor: pointer; }
.filings-preview-close:hover { color: #222; }
.filings-preview-frame-wrap { position: relative; flex: 1; display: flex; min-height: 0; }
.filings-preview-loading { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 9px; background: #fff; color: #777; font-size: 12px; }
.filings-preview-loading[hidden] { display: none; }
.filings-preview-loading .loading-spinner { width: 15px; height: 15px; border: 2px solid #ddd; border-top-color: var(--accent); border-radius: 50%; animation: filings-spin .8s linear infinite; }
@keyframes filings-spin { to { transform: rotate(360deg); } }
.filings-preview-pages { flex: 1; overflow: auto; padding: 18px; background: #525659; }
.filings-preview-pages[hidden] { display: none; }
.filings-preview-pages img { display: block; width: 100%; max-width: 860px; margin: 0 auto 14px; border-radius: 2px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }

/* ── Histórico y pie ──────────────────────────────────────────── */
.history-panel { border-top: 1px solid var(--line); }
.history-panel .section-title-row h2 { margin-bottom: 0; }
.history-panel .section-title-row { align-items: flex-end; }
.history-panel .section-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.text-button { border: 0; background: transparent; color: var(--accent-dark); font-size: 12px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.history-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.history-filter { display: flex; flex-direction: column; gap: 5px; margin: 0; border: 0; padding: 0; }
.history-filter > span, .history-date-type legend { color: #777; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.history-filter input[type="text"], .history-filter input[type="date"] { height: 34px; padding: 0 10px; border: 1px solid #d5d5d5; border-radius: 5px; background: #fff; color: var(--ink); font-size: 12px; outline: 0; }
.history-filter input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.history-company { position: relative; }
.history-company input { width: 220px; }

.history-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid #d5d5d5;
  border-radius: 6px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, .15), 0 8px 10px -6px rgba(0, 0, 0, .1);
  max-height: 240px;
  overflow-y: auto;
}

.history-suggest-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #f1f1f1;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease;
}

.history-suggest-option:last-child { border-bottom: 0; }

.history-suggest-option:hover,
.history-suggest-option.active { background: #eef2ff; }

.history-suggest-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

.history-suggest-ticker {
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 800;
  flex-shrink: 0;
}

.history-suggest-count {
  flex-shrink: 0;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 8px;
  background: #f1f1f1;
  color: #777;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.history-suggest-empty {
  padding: 10px;
  font-size: 11.5px;
  color: #777;
  text-align: center;
}
.history-date-type { flex-direction: row; align-items: flex-end; }
.history-date-option { display: flex; align-items: center; gap: 5px; }
.history-date-option input { accent-color: var(--accent); }
.history-date-option span { color: var(--muted); font-size: 12px; }
.history-date-type .history-date-option + .history-date-option { margin-left: 10px; }
.history-clear { height: 34px; padding: 0 14px; font-size: 11px; }
.history-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px 0 6px; }
.history-empty p { margin: 0; color: #999; font-size: 12px; }
.history-panel tbody tr { cursor: pointer; }
.history-panel td:last-child { text-align: right; }
.history-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 680px; border-collapse: collapse; }
th { padding: 0 10px 10px; border-bottom: 1px solid var(--line); color: #777; font-size: 10px; font-weight: 700; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; }
tbody tr:hover { background: #eef2ff; }
td:first-child { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.table-file { position: relative; width: 26px; height: 26px; overflow: hidden; }
.table-file img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
td strong { font-size: 11px; font-weight: 600; color: var(--ink); }
.td-ticker { margin-left: 5px; padding: 1px 6px; border-radius: 3px; background: #f4f4f4; color: #888; font-family: monospace; font-size: 10px; font-weight: 700; }
.td-change { font-family: monospace; font-size: 11px; font-weight: 700; }
.table-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.table-status i { width: 5px; height: 5px; border-radius: 50%; }
.table-status.done { color: #15803d; background: #ecfdf3; }
.table-status.done i { background: var(--green); }
.table-status.warning { color: var(--accent-dark); background: #eef2ff; }
.table-status.warning i { background: var(--accent); }
.row-action { min-width: 30px; height: 25px; padding: 0 9px; border: 1px solid #ddd; border-radius: 5px; background: #fff; color: #777; font-size: 9.5px; font-weight: 700; letter-spacing: .02em; cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.row-action:hover { border-color: var(--accent); background: #eef2ff; color: var(--accent-dark); }
.row-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after { display: inline-block; margin-left: 4px; color: #c4c4c4; font-size: 9px; content: '↕'; }
th[data-sort]:hover { color: var(--ink); }
th.sorted-asc::after, th.sorted-desc::after { color: var(--accent-dark); font-weight: 700; }
th.sorted-asc::after { content: '↑'; }
th.sorted-desc::after { content: '↓'; }
.empty-hint { margin-top: 12px; color: #999; font-size: 10px; }
.page-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 28px 27px; color: #999; font-size: 10px; }
.page-footer b { padding: 0 4px; color: #ccc; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 40; max-width: 320px; padding: 12px 15px; border: 1px solid #bbb; border-radius: 5px; background: #1e293b; box-shadow: 0 5px 18px rgba(0,0,0,.22); color: #fff; font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(9px); transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }

/* ── Modal de autenticación ───────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; background: rgba(0, 0, 0, .55); }
.modal { position: relative; width: min(430px, 100%); padding: 26px 27px 22px; border-radius: 10px; background: #fff; box-shadow: 0 22px 55px rgba(0,0,0,.35); }
.modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: #999; font-size: 22px; line-height: 1; }
.modal-close:hover { color: #222; }
.modal-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; color: #444; font-size: 13px; font-weight: 700; }
.modal-brand .cifra-symbol { font-size: 17px; }
.modal h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.modal-subtitle { margin: 0 0 17px; color: var(--muted); font-size: 13px; }
.modal-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.modal-tab { padding: 10px 0; border: 0; background: #f2f2f2; color: var(--muted); font-size: 13px; font-weight: 700; }
.modal-tab:hover { color: var(--ink); }
.modal-tab.active { background: #fff; color: var(--accent-dark); box-shadow: inset 0 -2px 0 var(--accent); }
.auth-field { display: block; margin-bottom: 14px; }
.auth-field > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.auth-field input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #cfcfcf; border-radius: 6px; background: #fff; color: var(--ink); font-size: 14px; outline: 0; transition: .15s ease; }
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.modal-error { margin: 0 0 13px; padding: 9px 11px; border: 1px solid #f0c4c1; border-radius: 6px; background: #fdf0ef; color: #c0392b; font-size: 12px; }
.auth-submit { width: 100%; min-height: 44px; border-radius: 7px; font-size: 14px; }
.verify-hint { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.verify-actions { display: flex; justify-content: space-between; margin: -2px 0 14px; }
.verify-actions .link-button { padding: 0; border: 0; background: none; color: var(--accent-dark); font-size: 12px; font-weight: 700; cursor: pointer; }
.verify-actions .link-button:hover { text-decoration: underline; }
.verify-actions .link-button:disabled { color: #9a9a9a; cursor: not-allowed; text-decoration: none; }
.forgot-row { justify-content: flex-start; margin: 2px 0 14px; }
.modal-note { margin: 14px 0 0; color: #9a9a9a; font-size: 11px; text-align: center; }
.oauth-section { margin-bottom: 14px; }
.oauth-google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 42px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: #374151; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; box-sizing: border-box; }
.oauth-google-btn:hover { background: #f9fafb; border-color: #9ca3af; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.oauth-google-btn:focus-visible { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.google-icon { flex-shrink: 0; }
.auth-divider { display: flex; align-items: center; text-align: center; margin: 14px 0 12px; color: #8c8c8c; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid #e5e5e5; }
.auth-divider span { padding: 0 10px; }

/* ── Menú contraído y responsive ──────────────────────────────── */
.app-shell.sidebar-collapsed .sidebar { width: 68px; }
.app-shell.sidebar-collapsed .main-content { margin-left: 68px; }
.app-shell.sidebar-collapsed .brand-area { width: 68px; flex-basis: 68px; padding-right: 21px; padding-left: 21px; }
.app-shell.sidebar-collapsed .brand-lockup strong, .app-shell.sidebar-collapsed .nav-link > span, .app-shell.sidebar-collapsed .nav-section-title, .app-shell.sidebar-collapsed .new-badge, .app-shell.sidebar-collapsed .nav-arrow, .app-shell.sidebar-collapsed .sidebar-footer { display: none; }
.app-shell.sidebar-collapsed .brand-lockup { margin: auto; }
.app-shell.sidebar-collapsed .main-nav { padding-right: 11px; padding-left: 11px; }
.app-shell.sidebar-collapsed .nav-link { justify-content: center; padding: 0; }

@media (max-width: 1120px) {
  :root { --sidebar-width: 232px; }
  .brand-area { padding-left: 16px; }
}

@media (max-width: 900px) {
  .topbar { position: fixed; }
  .brand-area { width: auto; flex-basis: auto; gap: 13px; border-right: 0; }
  .collapse-button { order: -1; }
  .search-wrap { width: min(430px, 45vw); margin-left: 8px; }
  .promo-button { padding-right: 10px; padding-left: 10px; font-size: 11px; }
  .sidebar { transform: translateX(-100%); box-shadow: 8px 0 22px rgba(0,0,0,.18); }
  .sidebar.open { transform: translateX(0); }
  .backdrop { display: block; position: fixed; inset: var(--topbar-height) 0 0; z-index: 14; background: rgba(0,0,0,.32); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .backdrop.visible { opacity: 1; pointer-events: auto; }
  .main-content, .app-shell.sidebar-collapsed .main-content { margin-left: 0; }
  .app-shell.sidebar-collapsed .sidebar { width: var(--sidebar-width); }
  .app-shell.sidebar-collapsed .brand-area { width: auto; flex-basis: auto; padding-right: 12px; padding-left: 16px; }
  .app-shell.sidebar-collapsed .brand-lockup strong, .app-shell.sidebar-collapsed .nav-link > span, .app-shell.sidebar-collapsed .nav-section-title, .app-shell.sidebar-collapsed .new-badge, .app-shell.sidebar-collapsed .nav-arrow, .app-shell.sidebar-collapsed .sidebar-footer { display: initial; }
  .app-shell.sidebar-collapsed .nav-link > span { overflow: hidden; }
  .app-shell.sidebar-collapsed .nav-section-title { display: flex; }
  .app-shell.sidebar-collapsed .sidebar-footer { display: block; }
  .app-shell.sidebar-collapsed .nav-link { justify-content: initial; padding-right: 12px; padding-left: 12px; }
  .app-shell.sidebar-collapsed .company-nav-head { display: flex; }
}

@media (max-width: 700px) {
  .topbar { height: 58px; }
  :root { --topbar-height: 58px; }
  .brand-lockup strong { font-size: 14px; }
  .search-wrap { flex: 1; width: auto; height: 38px; margin-left: 0; }
  .search-wrap input { font-size: 13px; }
  .search-shortcut, .settings-button { display: none; }
  .topbar-actions { padding-right: 7px; }
  .ghost-button { display: none; }
  .promo-button { display: none; }
  .user-email { display: none; }
  .user-chip { padding-right: 5px; }
  .market-section, .analysis-section, .history-panel, .screener-section { padding: 22px 15px; }
  .section-title-row h2 { font-size: 21px; }
  .market-grid, .analysis-layout { grid-template-columns: 1fr; }
  .screener-company-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .profile-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .profile-source { text-align: left; }
  .profile-quote-card { align-items: flex-start; flex-direction: column; }
  .profile-sparkline { width: 100%; height: 64px; }
  .profile-card-grid { grid-template-columns: 1fr; }
  .screener-toolbar { align-items: flex-start; flex-wrap: wrap; gap: 7px 10px; }
  .screener-period-range { order: 3; width: 100%; }
  .screener-tools { margin-left: auto; }
  .screener-tabs { overflow-x: auto; }
  .screener-tab { flex: 0 0 auto; padding-right: 11px; padding-left: 11px; }
  .market-grid { gap: 8px; }
  .market-card { min-height: 120px; }
  .analysis-title { align-items: flex-start; }
  .scope-badge { font-size: 8px; }
  .upload-panel, .coverage-panel { padding: 16px; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .form-footer p { max-width: none; }
  .primary-button { width: 100%; }
  .result-grid { grid-template-columns: 1fr; }
  .page-footer { align-items: flex-start; flex-direction: column; gap: 7px; padding-right: 15px; padding-left: 15px; }
  .toast { right: 14px; bottom: 14px; left: 14px; max-width: none; }
}

.report-block { margin-top: 14px; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .04); }
.report-block h5 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.report-block .table-wrap { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 6px; }
.report-block .table-wrap table { min-width: 0; width: 100%; border-collapse: collapse; }
.report-block .table-wrap th { padding: 8px 9px; font-size: 9.5px; text-align: left; text-transform: uppercase; letter-spacing: .04em; background: #1f2937; color: #fff; border-right: 1px solid rgba(255, 255, 255, .08); white-space: nowrap; }
.report-block .table-wrap td { padding: 7px 9px; font-size: 11px; color: var(--ink); border-top: 1px solid #eef0f2; border-right: 1px solid #f3f4f6; }
.report-block .table-wrap tbody tr:nth-child(odd) { background: #f3f4f6; }
.report-block .table-wrap td:first-child { color: var(--ink); font-weight: 700; }
.report-extras { margin: 10px 0 0; font-size: 11.5px; font-weight: 700; color: var(--ink); }
.report-notes { margin: 8px 0 0; padding-left: 18px; color: #4b5563; font-size: 11px; line-height: 1.5; }
.report-notes li { margin: 3px 0; }
.report-hint { margin: 12px 0 0; color: var(--muted); font-size: 10.5px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ── Estilos de Informe y Reglas de Análisis ── */
.report-block .table-wrap td.cell-bold {
  font-weight: 700 !important;
  color: var(--ink) !important;
}
.report-block .table-wrap td.pct-positive {
  color: #16a34a !important;
  font-weight: 600;
}
.report-block .table-wrap td.pct-negative {
  color: #dc2626 !important;
  font-weight: 600;
}

/* Paleta cromática coordinada para cada ajuste y su nota (*1, *2, *3...) */
.highlight-c1, .highlight-adjust { background-color: #fef08a !important; color: #854d0e !important; }
.highlight-c2 { background-color: #c7d2fe !important; color: #4338ca !important; }
.highlight-c3 { background-color: #bbf7d0 !important; color: #15803d !important; }
.highlight-c4 { background-color: #e9d5ff !important; color: #7e22ce !important; }
.highlight-c5 { background-color: #bae6fd !important; color: #0369a1 !important; }
.highlight-c6 { background-color: #fbcfe8 !important; color: #be185d !important; }

.highlight-adjust, [class*="highlight-c"] {
  font-weight: 700 !important;
  padding: 1px 5px;
  border-radius: 3px;
  display: inline-block;
}
.highlight-note {
  font-weight: 700 !important;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
  display: inline-block;
}

/* El cribador conserva las ocho columnas visibles en pantallas estrechas. */
.screener-block table { min-width: fit-content; }
.result-actions .primary-button { width: auto; }

/* ── Barra de Valoración y Reporte de Errores de Análisis ────── */
.analysis-feedback-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

.analysis-rating-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}

.rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.star-btn {
  background: transparent;
  border: 0;
  padding: 0 2px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #cbd5e1;
  transition: color 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.star-btn:hover {
  transform: scale(1.18);
}

.star-btn.active,
.star-btn.hovered {
  color: #f59e0b;
}

.rating-summary-text {
  font-size: 11px;
  color: #64748b;
  margin-left: 4px;
  font-weight: 500;
}

.report-error-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.report-error-trigger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.report-error-trigger svg {
  flex-shrink: 0;
}

/* Modal de Reporte de Error */
.error-report-modal-backdrop {
  z-index: 9999;
}

.error-report-modal {
  width: min(480px, 95vw);
}

.error-report-modal .modal-title {
  display: flex;
  align-items: center;
  margin: 0 0 4px;
  font-size: 16px;
  color: #0f172a;
}

.error-report-modal .modal-subtitle {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.error-report-modal select:focus,
.error-report-modal textarea:focus {
  outline: 0;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18) !important;
}

/* ── Página Inicio (sin menú lateral) ───────────────────────── */
.home-main { padding-top: var(--topbar-height); }

.home-topbar { justify-content: space-between; }
.home-top-links { display: flex; align-items: center; gap: 4px; padding-left: 16px; }
.home-top-link { display: inline-flex; height: 34px; align-items: center; gap: 7px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: #cfcfcf; font-size: 12.5px; font-weight: 600; }
.home-top-link:hover { background: #334155; color: #fff; }
.home-top-link.active { background: var(--accent-soft); color: var(--accent-dark); }
.home-top-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }

.search-kbd { display: grid; height: 22px; min-width: 52px; place-items: center; margin-left: auto; margin-right: 11px; padding: 0 7px; border: 1px solid #c9c9c9; border-radius: 4px; background: #fafafa; color: #7a7a7a; font-size: 10px; font-weight: 600; }

.home-hero { display: flex; flex-direction: column; align-items: center; padding: 54px 24px 12px; }
.home-brand-row { display: flex; align-items: center; gap: 11px; }
.home-brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.home-brand .brand-mark { font-size: 27px; }
.home-brand strong { font-size: 27px; letter-spacing: -.02em; }
.beta-badge { padding: 4px 9px; border: 1px solid #a5b4fc; border-radius: 20px; background: #eef2ff; color: var(--accent-dark); font-size: 10px; font-weight: 700; }
.home-search { width: min(660px, 92%); height: 50px; margin-top: 26px; border: 1px solid #d6d6d6; border-radius: 9px; box-shadow: 0 2px 10px rgba(0, 0, 0, .05); }

.home-menu-section { display: grid; width: min(880px, 92%); grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 38px auto 10px; }
.home-menu-card { display: flex; align-items: center; gap: 13px; padding: 19px 17px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .04); color: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.home-menu-card:hover { border-color: #a5b4fc; box-shadow: 0 6px 18px rgba(67, 56, 202, .1); }
.home-menu-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-menu-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-dark); }
.home-menu-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.home-menu-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.home-menu-copy strong { color: var(--ink); font-size: 14.5px; }
.home-menu-copy small { color: var(--soft-muted); font-size: 11px; line-height: 1.45; }
.home-menu-arrow { color: #818cf8; font-size: 16px; font-weight: 700; }

.home-analisis-section { padding-top: 14px; }

.home-grid-section { padding: 38px 28px 6px; }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-card { padding: 15px 15px 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.home-card:hover { border-color: #a5b4fc; box-shadow: 0 4px 14px rgba(67, 56, 202, .08); }
.home-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-card-head { display: flex; align-items: center; gap: 11px; }
.home-card-logo { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 6px; color: #fff; font-size: 14px; font-weight: 700; }
.home-card-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 1px; }
.home-card-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.home-card-copy small { color: var(--soft-muted); font-size: 10.5px; white-space: nowrap; }
.home-card-fav { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border: 0; border-radius: 5px; background: transparent; color: #b8b8b8; }
.home-card-fav:hover { background: #fdeeee; color: var(--red); }
.home-card-fav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.home-card-fav.active { color: var(--red); }
.home-card-fav.active svg { fill: currentColor; }
.home-card-note { margin-top: 12px; color: var(--soft-muted); font-size: 11px; }
.home-card-quote { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; padding: 11px 12px; border-radius: 6px; background: var(--surface-soft); }
.home-card-numbers { display: flex; min-width: 0; flex-direction: column; }
.home-card-numbers strong { font-family: Georgia, serif; font-size: 18px; font-weight: 400; white-space: nowrap; }
.quote-arrow { display: inline-block; font-size: 9px; margin-right: 3px; vertical-align: 1px; }
.home-card-numbers small { font-size: 11px; font-weight: 700; white-space: nowrap; }
.home-card-updated { margin-top: 3px; color: #9b9b9b !important; font-size: 9.5px !important; font-weight: 400 !important; }
.home-card-quote .sparkline { width: 108px; height: 46px; margin: 0; }

/* ── Página Empresa ─────────────────────────────────────────── */
.trial-banner { display: flex; align-items: center; gap: 9px; padding: 10px 28px; border-bottom: 1px solid #c7d2fe; background: #eef2ff; color: #3730a3; font-size: 12px; }
.trial-banner svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: var(--accent-dark); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.trial-banner strong { margin-right: 3px; color: #312e81; }
.company-wrap { padding: 22px 28px 34px; }
.company-loading { margin: 16px 0; color: var(--muted); font-size: 12.5px; }
.company-section { padding-top: 14px; }
.company-wrap .company-section.home-grid-section,
.company-wrap .company-section.portfolio-page-section,
.company-wrap .company-section.home-analisis-section,
.company-wrap .company-section.novedades-page-section {
  padding: 0;
  border-top: none;
  background: transparent;
}
.company-wrap .company-section.portfolio-page-section > #portfolio-section {
  max-width: 100%;
}
.company-nav-head {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.company-nav-head:hover {
  background-color: #e5e5e5;
}

.company-head-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 340px); gap: 12px; }
.company-head { display: flex; align-items: center; gap: 14px; padding: 15px 17px; }
.company-logo { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent-dark); font-size: 19px; font-weight: 700; }
.company-logo img, .company-nav-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.company-head-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 6px; }
.company-title-row { display: flex; min-width: 0; align-items: baseline; gap: 10px; }
.company-title-row h1 { margin: 0; overflow: hidden; font-size: 22px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.company-meta { min-width: 0; overflow: hidden; color: var(--soft-muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.company-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.ticker-select { display: inline-flex; min-height: 27px; align-items: center; gap: 5px; padding: 0 10px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-dark); font-size: 11px; font-weight: 700; }
.icon-chip { position: relative; display: inline-grid; width: 29px; height: 29px; place-items: center; border: 1px solid #d3d3d3; border-radius: 5px; background: #fff; color: #666; }
.icon-chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.icon-chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.icon-chip.active { border-color: var(--red); color: var(--red); }
.icon-chip.active svg { fill: currentColor; }
.icon-chip .new-badge { position: absolute; top: -8px; right: -10px; margin: 0; }

.favorites-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.favorites-market-table { width: 100%; min-width: 1060px; border-collapse: collapse; table-layout: auto; }
.favorites-market-table th { padding: 8px 10px; border-bottom: 1px solid #cfcfcf; background: #fafafa; color: #666; font-size: 10px; font-weight: 700; text-align: right; white-space: nowrap; text-transform: none; }
.favorites-market-table th:first-child, .favorites-market-table th:nth-child(2) { text-align: left; }
.favorites-market-table td { padding: 5px 10px; border-bottom: 1px solid var(--line-soft); color: #444; font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.favorites-market-table tbody tr { cursor: pointer; }
.favorites-market-table tbody tr:hover td { background: #eef2ff; }
.favorites-market-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.favorites-market-table td:first-child { display: table-cell; color: var(--ink); text-align: left; }
.favorite-name-cell { min-width: 210px; }
.favorite-flag { display: inline-block; width: 20px; margin-right: 6px; font-size: 14px; line-height: 1; text-align: center; vertical-align: -1px; }
.favorite-company-link, .favorite-symbol-link { color: #1b5a99; font-weight: 700; text-decoration: none; }
.favorite-company-link:hover, .favorite-symbol-link:hover { color: #0e3d6c; text-decoration: underline; }
.favorites-market-table td.positive { color: var(--green); font-weight: 700; }
.favorites-market-table td.negative { color: var(--red); font-weight: 700; }
.favorites-market-table td.favorite-last { font-weight: 700; }
.favorites-market-table td.favorite-last.positive { background: #d9f3dc; }
.favorites-market-table td.favorite-last.negative { background: #f9dddd; }
.favorites-market-table tbody tr:hover td.favorite-last.positive { background: #cceecf; }
.favorites-market-table tbody tr:hover td.favorite-last.negative { background: #f5cece; }
.favorite-time { display: inline-flex; align-items: center; gap: 5px; }
.favorite-market-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #aaa; }
.favorite-market-dot.open { background: var(--green); }
.favorite-market-dot.closed { background: var(--red); }
.favorite-market-dot.unknown { background: #aaa; }
.favorite-table-fav { display: inline-grid; width: 24px; height: 24px; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--red); cursor: pointer; }
.favorite-table-fav:hover { background: #fdeeee; }
.favorite-table-fav svg { width: 15px; height: 15px; fill: currentColor; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.favorites-empty { padding: 22px 16px; border: 1px dashed var(--line); border-radius: 7px; color: var(--muted); font-size: 12.5px; text-align: center; }

.company-quote { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; cursor: pointer; }
.company-quote:hover { border-color: var(--accent); }
.company-quote:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.company-quote-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.company-quote-copy strong { font-family: Georgia, serif; font-size: 24px; font-weight: 400; white-space: nowrap; }
.company-quote-copy small { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.quote-sparkline { width: min(190px, 48%); height: 62px; overflow: visible; }

.profile-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 12px; }
.profile-card-block, .chart-block { padding: 16px 18px 13px; border: 1px solid var(--line); border-radius: 5px; background: #fff; box-shadow: var(--shadow); }
.profile-card-block h5, .chart-block h5 { display: flex; align-items: center; gap: 5px; margin: 0 0 9px; color: #333; font-size: 14px; }
.profile-info-block, .profile-desc-block { margin-top: 12px; }
.profile-desc-block p { margin: 0; color: #657c98; font-size: 11.5px; line-height: 1.55; }

.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.chart-head h5 { margin: 0; font-size: 14px; font-weight: 700; color: #1e293b; }
.chart-head-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.chart-quote-badge { display: inline-flex; align-items: center; gap: 8px; padding: 3px 9px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-variant-numeric: tabular-nums; line-height: 1.2; transition: all 0.15s ease; }
.chart-quote-badge.is-hovering { background: #eef2ff; border-color: #4f46e5; box-shadow: 0 1px 4px rgba(79, 70, 229, 0.14); }
.chart-quote-badge-price { font-family: Georgia, serif; font-size: 15px; font-weight: 700; color: #0f172a; display: inline-flex; align-items: center; gap: 3px; }
.chart-quote-badge-price .quote-arrow { font-size: 9.5px; }
.chart-quote-badge-price.positive { color: #16a34a; }
.chart-quote-badge-price.negative { color: #dc2626; }
.chart-quote-badge-change { font-size: 11.5px; font-weight: 600; }
.chart-quote-badge-change.positive { color: #16a34a; }
.chart-quote-badge-change.negative { color: #dc2626; }
.chart-quote-badge-date { font-size: 11px; color: #64748b; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; white-space: nowrap; }
.chart-quote-badge-ma { font-size: 10.5px; font-weight: 600; color: #2563eb; background: #eff6ff; border: 1px solid #bfdbfe; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.home-card-updated.quote-hovering { color: #4338ca !important; font-weight: 600; }
.chart-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chart-ranges { display: flex; overflow: hidden; border: 1px solid #d6d6d6; border-radius: 6px; }
.chart-ranges button { min-width: 32px; height: 26px; padding: 0 7px; border: 0; border-right: 1px solid #ddd; background: #fff; color: #64748b; font-size: 10.5px; font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.chart-ranges button:last-child { border-right: 0; }
.chart-ranges button:hover { background: #e0e7ff; color: #4338ca; }
.chart-ranges button.active { background: #e0e7ff; color: #4338ca; font-weight: 700; }
.chart-tools { display: flex; align-items: center; gap: 5px; }
.chart-tools button { height: 26px; padding: 0 9px; border: 1px solid #d6d6d6; border-radius: 6px; background: #fff; color: #64748b; font-size: 10.5px; font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.chart-tools button:hover { background: #e0e7ff; color: #4338ca; }
.chart-tools button.active { background: #e0e7ff; color: #4338ca; font-weight: 700; }
.chart-fs { display: grid; width: 28px; padding: 0; place-items: center; }
.chart-fs svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.chart-body { position: relative; min-height: 380px; background: #fafcff; border: 1px solid #edf2f7; border-radius: 9px; padding: 8px 10px 4px; margin-bottom: 8px; }
#price-chart { display: block; width: 100%; height: 380px; overflow: visible; }
.chart-line { fill: none; stroke: #4f46e5; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.chart-area { fill: url(#company-chart-grad); opacity: 0.85; pointer-events: none; }
.chart-ma { fill: none; stroke: var(--ma-stroke, #3b82f6); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.chart-ma-control { position: relative; display: flex; align-items: center; gap: 4px; }
.chart-ma-chips { display: flex; align-items: center; gap: 4px; }
.chart-ma-chip { display: inline-flex !important; align-items: center; gap: 5px; height: 26px; padding: 0 8px !important; border: 1px solid #d6d6d6 !important; border-radius: 6px; background: #fff !important; color: #64748b !important; font-size: 10.5px; font-weight: 600; cursor: pointer; transition: all 0.15s ease; user-select: none; }
.chart-ma-chip:hover { background: #f8fafc !important; color: #334155 !important; border-color: #cbd5e1 !important; }
.chart-ma-chip.active { background: #e0e7ff !important; color: #4338ca !important; border-color: #818cf8 !important; font-weight: 700; }
.chart-ma-chip .ma-chip-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.chart-ma-config-btn { display: inline-flex !important; align-items: center; justify-content: center; gap: 3px; height: 26px; padding: 0 7px !important; border: 1px solid #d6d6d6 !important; border-radius: 6px; background: #fff !important; color: #64748b !important; font-size: 10.5px; font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.chart-ma-config-btn:hover, .chart-ma-config-btn.is-open { background: #e0e7ff !important; color: #4338ca !important; border-color: #f59e0b !important; }
.chart-ma-popover { position: absolute; top: calc(100% + 6px); right: 0; width: 260px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08); z-index: 100; font-family: inherit; }
.chart-ma-popover-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11.5px; font-weight: 700; color: #1e293b; }
.chart-ma-popover-close { background: none !important; border: none !important; padding: 0 !important; font-size: 16px; line-height: 1; color: #94a3b8 !important; cursor: pointer; height: auto !important; }
.chart-ma-popover-close:hover { color: #475569 !important; background: none !important; }
.chart-ma-list { display: flex; flex-direction: column; gap: 6px; margin: 9px 0; max-height: 190px; overflow-y: auto; }
.chart-ma-item { display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 6px; font-size: 11.5px; }
.chart-ma-item-check { cursor: pointer; accent-color: #4f46e5; margin: 0; }
.chart-ma-item-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chart-ma-item-label { color: #475569; font-weight: 600; font-size: 11px; }
.chart-ma-item-input { width: 60px; height: 22px; border: 1px solid #cbd5e1; border-radius: 4px; padding: 0 5px; font-size: 11.5px; font-weight: 700; color: #0f172a; text-align: center; margin-left: auto; }
.chart-ma-item-input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 1px #4f46e5; }
.chart-ma-item-del { background: none !important; border: none !important; padding: 0 2px !important; height: auto !important; color: #cbd5e1 !important; font-size: 15px; cursor: pointer; line-height: 1; }
.chart-ma-item-del:hover { color: #ef4444 !important; background: none !important; }
.chart-ma-add-row { display: flex; gap: 6px; margin-bottom: 6px; }
.chart-ma-add-input { flex: 1; height: 26px; border: 1px solid #cbd5e1; border-radius: 5px; padding: 0 8px; font-size: 11px; color: #0f172a; }
.chart-ma-add-input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 1px #4f46e5; }
.chart-ma-add-submit { height: 26px !important; padding: 0 10px !important; background: #4f46e5 !important; color: #fff !important; border: none !important; border-radius: 5px; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chart-ma-add-submit:hover { background: #4338ca !important; color: #fff !important; }
.chart-ma-quick-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 10px; color: #64748b; margin-top: 4px; padding-top: 6px; border-top: 1px dashed #f1f5f9; }
.chart-ma-quick-presets button { height: 20px !important; padding: 0 5px !important; background: #f1f5f9 !important; border: 1px solid #e2e8f0 !important; border-radius: 3px; font-size: 10px; color: #475569 !important; cursor: pointer; }
.chart-ma-quick-presets button:hover { background: #e0e7ff !important; border-color: #818cf8 !important; color: #4338ca !important; }
.chart-grid { stroke: #f1f5f9; stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.chart-label { fill: #787b86; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 9.5px; font-variant-numeric: tabular-nums; }
.chart-label-x { text-anchor: middle; font-family: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; font-size: 10px; }
.chart-tag { fill: #4f46e5; }
.chart-tag-text { fill: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 10px; font-weight: 700; }
.chart-crosshair { stroke: #787b86; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.chart-dot { fill: #fff; stroke: #4f46e5; stroke-width: 2.5; vector-effect: non-scaling-stroke; pointer-events: none; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25)); }
.chart-tooltip { position: fixed; z-index: 2147483647 !important; padding: 10px 14px; border-radius: 8px; background: rgba(15, 23, 42, 0.95); color: #fff; font-size: 11px; line-height: 1.4; pointer-events: none; box-shadow: 0 4px 16px rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(4px); }
.chart-tooltip strong { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; font-weight: 700; color: #ffffff; }
.chart-tooltip span { color: #94a3b8; font-size: 10.5px; }
.chart-block:fullscreen,
.chart-block.is-fullscreen,
.val-chart-block:fullscreen,
.val-chart-block.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 14px 24px 16px !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
.chart-block:fullscreen .chart-body,
.chart-block.is-fullscreen .chart-body,
.val-chart-block:fullscreen .val-chart-body,
.val-chart-block.is-fullscreen .val-chart-body {
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100vh - 165px);
  display: flex;
  flex-direction: column;
}
.chart-block:fullscreen .company-chart-canvas-inner,
.chart-block.is-fullscreen .company-chart-canvas-inner,
.val-chart-block:fullscreen .company-chart-canvas-inner,
.val-chart-block.is-fullscreen .company-chart-canvas-inner {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
}
.chart-block:fullscreen #price-chart,
.chart-block.is-fullscreen #price-chart,
.val-chart-block:fullscreen #val-chart,
.val-chart-block.is-fullscreen #val-chart {
  width: 100%;
  height: 100% !important;
  max-height: calc(100vh - 165px) !important;
  overflow: visible !important;
}
.chart-block:fullscreen .pf-timeline-bar-wrap,
.chart-block.is-fullscreen .pf-timeline-bar-wrap,
.val-chart-block:fullscreen .pf-timeline-bar-wrap,
.val-chart-block.is-fullscreen .pf-timeline-bar-wrap {
  margin-top: 4px;
  flex-shrink: 0;
}
.chart-message { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }

.placeholder-block { padding: 30px 22px; text-align: center; }
.placeholder-block strong { display: block; font-size: 16px; }
.placeholder-block p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }

/* ── Responsive Inicio / Empresa ────────────────────────────── */
@media (max-width: 1100px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .company-head-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .home-top-links { padding-left: 8px; }
  .home-top-link { padding: 0 8px; font-size: 11.5px; }
  .home-menu-section { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .home-hero { padding-top: 36px; }
  .home-brand strong, .home-brand .brand-mark { font-size: 22px; }
  .home-grid-section { padding: 26px 15px 4px; }
  .home-grid { grid-template-columns: 1fr; }
  .trial-banner { padding: 9px 15px; }
  .company-wrap { padding: 16px 15px 26px; }
  .company-head { flex-wrap: wrap; }
  .company-title-row { flex-direction: column; gap: 3px; }
  .company-meta { white-space: normal; }
  .chart-body, #price-chart { min-height: 240px; height: 240px; }
  .chart-head { align-items: flex-start; flex-direction: column; }
  .company-quote { align-items: flex-start; flex-direction: column; }
  .quote-sparkline { width: 100%; height: 58px; }
}

/* ── Popover de listas de seguimiento ───────────────────────── */

.watch-popover {
  position: fixed;
  z-index: 1200;
  width: 280px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
  color: var(--ink);
  font-size: 12.5px;
}

.watch-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.watch-popover-head strong { display: block; font-size: 12.5px; }

.watch-popover-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.watch-popover-close { border: 0; background: transparent; color: #999; font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px; }
.watch-popover-close:hover { color: var(--ink); }

.watch-popover-list { max-height: min(320px, 45vh); overflow-y: auto; padding: 5px; overscroll-behavior: contain; }
.watch-popover-list::-webkit-scrollbar { width: 8px; }
.watch-popover-list::-webkit-scrollbar-thumb { background: #d3d3d3; border-radius: 4px; }
.watch-popover-list::-webkit-scrollbar-thumb:hover { background: #b5b5b5; }

.watch-popover-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.watch-popover-row:hover { background: #f6f6f6; }
.watch-popover-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.watch-popover-check {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  border: 1.5px solid #ccc;
  border-radius: 4px;
  color: #fff;
}
.watch-popover-check svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.4; }
.watch-popover-row.checked .watch-popover-check { background: var(--accent); border-color: var(--accent); }

.watch-popover-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-popover-row.checked .watch-popover-name { color: var(--accent-dark); }

.watch-popover-count { color: var(--muted); font-size: 11px; white-space: nowrap; }

.watch-popover-delete {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #b5b5b5;
  cursor: pointer;
}
.watch-popover-delete:hover { background: #fdeeee; color: var(--red); }
.watch-popover-delete svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.watch-popover-delete.armed {
  width: auto;
  padding: 0 9px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}
.watch-popover-delete.armed:hover { background: #d33; color: #fff; }

.watch-popover-empty { padding: 14px 10px; color: var(--muted); text-align: center; }

.watch-popover-create {
  display: flex;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line-soft);
}

.watch-popover-create-input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #d3d3d3;
  border-radius: 5px;
  font-size: 12px;
  color: var(--ink);
}
.watch-popover-create-input:focus { border-color: var(--accent); outline: none; }

.watch-popover-create-btn {
  padding: 6px 12px;
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.watch-popover-create-btn:hover:not(:disabled) { background: var(--accent-dark); }
.watch-popover-create-btn:disabled { opacity: .5; cursor: default; }

.watch-popover-calendar-section {
  padding: 4px 6px;
  border-top: 1px solid #f0f0f0;
  margin-top: 2px;
}

.watch-popover-calendar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.watch-popover-calendar-row:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.watch-popover-calendar-row.checked {
  background: #eff6ff;
  border-color: #93c5fd;
}

.watch-popover-calendar-row.checked .watch-popover-check {
  background: #2563eb;
  border-color: #2563eb;
}

.watch-popover-calendar-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.watch-popover-calendar-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
}

.watch-popover-calendar-row.checked .watch-popover-calendar-title {
  color: #1d4ed8;
}

.watch-popover-calendar-desc {
  font-size: 10px;
  color: #64748b;
  margin-top: 1px;
}

.watch-popover-calendar-row.locked {
  cursor: not-allowed;
  background: #f8fafc;
  border-color: #cbd5e1;
  opacity: 0.95;
}

.watch-popover-calendar-row.locked:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.watch-popover-calendar-row.locked .watch-popover-check {
  background: #2563eb;
  border-color: #2563eb;
}

.watch-popover-calendar-row.locked .watch-popover-calendar-title {
  color: #1e293b;
}

.watch-popover-cal-badge-held {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 9.5px;
  font-weight: 700;
  margin-left: 4px;
}

.watch-popover-lock-icon {
  font-size: 11px;
  opacity: 0.7;
  margin-left: auto;
}

.watch-popover-email-section {
  padding: 4px 6px 6px;
  border-top: 1px dashed #e2e8f0;
  margin-top: 2px;
}

.watch-popover-email-main {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.watch-popover-email-main:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.watch-popover-email-main.checked {
  background: #f0fdf4;
  border-color: #86efac;
}

.watch-popover-email-main.checked .watch-popover-check {
  background: #059669;
  border-color: #059669;
}

.watch-popover-email-main.checked .watch-popover-calendar-title {
  color: #047857;
}

.watch-popover-email-subs {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px 4px 2px 18px;
  transition: all 0.2s ease;
}

.watch-popover-email-subs.collapsed {
  display: none;
}

.watch-popover-sub-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3.5px 6px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  color: #475569;
  user-select: none;
  transition: background 0.12s ease;
}

.watch-popover-sub-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.watch-popover-sub-item.checked {
  color: #0f172a;
  font-weight: 600;
}

.watch-popover-sub-check {
  width: 13px;
  height: 13px;
  border: 1.5px solid #cbd5e1;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.watch-popover-sub-check svg {
  width: 9px;
  height: 9px;
  stroke: #fff;
  stroke-width: 2.8;
  fill: none;
}

.watch-popover-sub-item.checked .watch-popover-sub-check {
  background: #059669;
  border-color: #059669;
}

.watch-popover-sub-label {
  flex: 1;
  font-size: 10.5px;
  line-height: 1.2;
}

/* ── Sección de listas de seguimiento ───────────────────────── */

.watch-section-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.watch-section-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.watch-section-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid #d3d3d3;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.watch-section-chip:hover { border-color: var(--accent); }
.watch-section-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.watch-section-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

.watch-section-chip-name { font-weight: 700; }

.watch-section-chip-count {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  border-radius: 9px;
  background: #ececec;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}
.watch-section-chip.active .watch-section-chip-count { background: var(--accent); color: #fff; }

.watch-section-chip-delete {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  color: #b5b5b5;
}
.watch-section-chip-delete:hover { background: #fdeeee; color: var(--red); }
.watch-section-chip-delete svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.watch-section-chip-delete.armed {
  width: auto;
  padding: 0 7px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
}
.watch-section-chip-delete.armed:hover { background: #d33; color: #fff; }

.watch-section-create {
  display: flex;
  gap: 6px;
}

.watch-section-create-input {
  width: 150px;
  padding: 6px 9px;
  border: 1px solid #d3d3d3;
  border-radius: 16px;
  font-size: 12px;
  color: var(--ink);
}
.watch-section-create-input:focus { border-color: var(--accent); outline: none; }

.watch-section-create-btn {
  padding: 6px 12px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.watch-section-create-btn:hover:not(:disabled) { background: var(--accent-dark); }
.watch-section-create-btn:disabled { opacity: .5; cursor: default; }

.watch-section-empty {
  padding: 22px 16px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* ── Cartera ────────────────────────────────────────────────── */

.pf-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pf-summary-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.pf-summary-card span { display: block; color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pf-summary-card strong { display: block; margin-top: 5px; font-size: 17px; font-variant-numeric: tabular-nums; }
.pf-summary-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; }
.pf-summary-card strong.positive { color: var(--green); }
.pf-summary-card strong.negative { color: var(--red); }

.pf-panel {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.pf-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.pf-panel-head h4 { margin: 0; font-size: 14px; }
.pf-panel-head h5 { margin: 0; font-size: 12.5px; }
.pf-panel-head .secondary-button { padding: 5px 11px; font-size: 11.5px; }
.pf-sub-head { margin-top: 16px; }

.pf-hint { margin: 8px 2px 0; color: var(--muted); font-size: 11px; }

.pf-table-wrap { overflow-x: auto; }
.pf-positions-table { width: 100%; min-width: 1180px; border-collapse: collapse; }
.pf-positions-table th {
  padding: 8px 9px;
  border-bottom: 1px solid #cfcfcf;
  background: #fafafa;
  color: #666;
  font-size: 10px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.pf-positions-table th:first-child { text-align: left; }
.pf-positions-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
  color: #444;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.pf-positions-table td:first-child { text-align: left; }
.pf-positions-table td.positive { color: var(--green); font-weight: 700; }
.pf-positions-table td.negative { color: var(--red); font-weight: 700; }
.pf-positions-table tbody tr[data-ticker] { cursor: pointer; }
.pf-positions-table tbody tr[data-ticker]:hover td { background: #eef2ff; }
.pf-positions-table tbody tr[data-ticker]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pf-positions-table .pf-totals-row td {
  background: #fafafa;
  border-top: 2px solid #cfcfcf;
  font-weight: 700;
  color: var(--ink);
}
.pf-company-cell strong { display: block; color: var(--ink); font-size: 12px; }
.pf-company-sub { display: block; color: var(--muted); font-size: 10.5px; }

.pf-transactions-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.pf-transactions-table th {
  padding: 8px 9px;
  border-bottom: 1px solid #cfcfcf;
  background: #fafafa;
  color: #666;
  font-size: 10px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.pf-transactions-table th:first-child, .pf-transactions-table th:nth-child(2), .pf-transactions-table th:nth-child(3) { text-align: left; }
.pf-transactions-table td {
  padding: 6px 9px;
  border-bottom: 1px solid var(--line-soft);
  color: #444;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.pf-transactions-table td:first-child, .pf-transactions-table td:nth-child(2), .pf-transactions-table td:nth-child(3) { text-align: left; }
.pf-transactions-table td.positive { color: var(--green); font-weight: 700; }
.pf-transactions-table td.negative { color: var(--red); font-weight: 700; }

.pf-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}
.pf-type-badge.buy { background: #d9f3dc; color: var(--green); }
.pf-type-badge.sell { background: #f9dddd; color: var(--red); }

.pf-delete-tx {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--red);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.pf-delete-tx:hover { background: #f9dddd; border-color: var(--red); }

.pf-donuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.pf-donut-block h5 { margin: 0 0 10px; font-size: 12.5px; }
.pf-donut-wrap { display: flex; align-items: center; gap: 16px; }
.pf-donut { width: 130px; height: 130px; flex: 0 0 130px; }
.pf-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.pf-legend-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
  font-size: 11.5px;
  color: #444;
}
.pf-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; align-self: center; }
.pf-legend-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-legend-pct { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-legend-value { color: var(--muted); font-variant-numeric: tabular-nums; }

.pf-form { display: flex; flex-direction: column; gap: 8px; }
.pf-form-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}
.pf-field { display: flex; flex-direction: column; gap: 4px; }
.pf-field > span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pf-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 9px;
  border: 1px solid #d3d3d3;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink);
  background: #fff;
}
.pf-input:focus { border-color: var(--accent); outline: none; }
.pf-ticker-wrap { position: relative; }
.pf-ticker-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  overflow: hidden;
}
.pf-ticker-result {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: #fff;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}
.pf-ticker-result:hover { background: #eef2ff; }
.pf-ticker-result span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pf-ticker-result strong { color: var(--accent); flex: 0 0 auto; }
.pf-ticker-empty { padding: 9px 10px; color: var(--muted); font-size: 11.5px; }
.pf-form-note { margin: 0; color: var(--red); font-size: 11.5px; }
.pf-form-note.hidden, .hidden { display: none; }
.pf-submit { align-self: end; white-space: nowrap; }
.pf-form-block { margin-bottom: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 7px; background: #fcfcfc; }

.pf-empty-state { padding: 26px 16px; text-align: center; }
.pf-empty-state p { margin: 0 auto 14px; max-width: 480px; color: var(--muted); font-size: 12.5px; }

.pf-history-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, .6);
}
.pf-history-backdrop[hidden] { display: none; }
.pf-history-modal {
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-height: min(86vh, 720px);
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(0, 0, 0, .35);
}
.pf-history-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.pf-history-head h4 { margin: 0; font-size: 15px; flex: 0 0 auto; }
.pf-history-count { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; text-align: right; }
.pf-history-close {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #777;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.pf-history-close:hover { color: #222; border-color: #bbb; }
.pf-history-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #fafafa;
}
.pf-history-filter { display: flex; flex-direction: column; gap: 3px; }
.pf-history-filter > span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pf-history-filter select, .pf-history-filter input { min-width: 130px; width: auto; }
.pf-history-modal-body { overflow: auto; padding: 8px 18px 18px; }
.pf-history-empty { padding: 26px 0; color: var(--muted); font-size: 12.5px; text-align: center; }

.pf-company-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.pf-chart-panel {
  margin-top: 20px;
  margin-bottom: 18px;
  padding: 18px 22px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  transition: all 0.2s ease;
}
.pf-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pf-chart-title-wrap h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.01em;
}
.pf-chart-title-wrap p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 11.5px;
}
.pf-chart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pf-range-pills {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  border: 1px solid #e2e8f0;
}
.pf-range-pill {
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pf-range-pill:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}
.pf-range-pill.active {
  color: #ffffff;
  background: #2563eb;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.35);
}
.pf-chart-zoom-group {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  border: 1px solid #e2e8f0;
}
.pf-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pf-zoom-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.pf-zoom-btn:active {
  transform: scale(0.92);
}
.pf-chart-metric-select {
  height: 32px;
  padding: 0 28px 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}
.pf-chart-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pf-chart-picker-btn:hover,
.pf-chart-picker-btn.active {
  background: #eef2ff;
  color: #2563eb;
  border-color: #93c5fd;
}
.pf-chart-fullscreen-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pf-chart-fullscreen-btn:hover,
.pf-chart-fullscreen-btn.active {
  background: #eef2ff;
  color: #2563eb;
  border-color: #93c5fd;
}
.pf-chart-close-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
}
.pf-chart-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* ── Chart Fullscreen Mode ─────────────────────────────────── */
.pf-chart-panel:fullscreen,
.pf-chart-panel.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 14px 24px 16px !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.pf-chart-panel:fullscreen .pf-chart-layout,
.pf-chart-panel.is-fullscreen .pf-chart-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  margin-bottom: 6px;
  height: calc(100vh - 165px);
}

.pf-chart-panel:fullscreen .pf-chart-main,
.pf-chart-panel.is-fullscreen .pf-chart-main {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pf-chart-panel:fullscreen .pf-chart-canvas-wrap,
.pf-chart-panel.is-fullscreen .pf-chart-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pf-chart-panel:fullscreen [data-pf-chart],
.pf-chart-panel.is-fullscreen [data-pf-chart] {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pf-chart-panel:fullscreen [data-pf-chart-canvas-inner],
.pf-chart-panel.is-fullscreen [data-pf-chart-canvas-inner] {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.pf-chart-panel:fullscreen .pf-chart-svg,
.pf-chart-panel.is-fullscreen .pf-chart-svg {
  width: 100%;
  height: 100% !important;
  max-height: calc(100vh - 165px) !important;
  overflow: visible !important;
}

.pf-chart-panel:fullscreen .pf-chart-sidebar,
.pf-chart-panel.is-fullscreen .pf-chart-sidebar {
  max-height: calc(100vh - 165px);
  overflow-y: auto;
}

.pf-chart-panel:fullscreen .pf-timeline-bar-wrap,
.pf-chart-panel.is-fullscreen .pf-timeline-bar-wrap {
  margin-top: 4px;
  flex-shrink: 0;
}

.pf-chart-panel:fullscreen .pf-chart-note,
.pf-chart-panel.is-fullscreen .pf-chart-note {
  margin-top: 3px;
  flex-shrink: 0;
}

.pf-chart-panel:fullscreen .chart-quote-badge,
.pf-chart-panel.is-fullscreen .chart-quote-badge {
  padding: 5px 12px;
  border-radius: 7px;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.pf-chart-panel:fullscreen .chart-quote-badge.is-hovering,
.pf-chart-panel.is-fullscreen .chart-quote-badge.is-hovering {
  background: #eef2ff;
  border-color: #4f46e5;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.18);
}

.pf-chart-panel:fullscreen .chart-quote-badge-price,
.pf-chart-panel.is-fullscreen .chart-quote-badge-price {
  font-size: 20px;
}

.pf-chart-panel:fullscreen .chart-quote-badge-change,
.pf-chart-panel.is-fullscreen .chart-quote-badge-change {
  font-size: 13px;
}

.pf-chart-panel:fullscreen .chart-quote-badge-date,
.pf-chart-panel.is-fullscreen .chart-quote-badge-date {
  font-size: 12px;
}

.pf-chart-panel:fullscreen .chart-quote-badge-ma,
.pf-chart-panel.is-fullscreen .chart-quote-badge-ma {
  font-size: 12px;
  padding: 2px 8px;
}

/* ── Elements Picker Panel ─────────────────────────────────── */
.pf-chart-picker-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}
.pf-chart-picker-panel[hidden] {
  display: none;
}
.pf-picker-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}
.pf-picker-tabs {
  display: flex;
  gap: 4px;
}
.pf-picker-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pf-picker-tab:hover {
  background: #ffffff;
  color: #1e293b;
}
.pf-picker-tab.active {
  background: #ffffff;
  color: #2563eb;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.pf-picker-pill {
  display: inline-block;
  padding: 1px 6px;
  font-size: 9.5px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 700;
}
.pf-picker-tab.active .pf-picker-pill {
  background: #eff6ff;
  color: #2563eb;
}
.pf-picker-search-wrap {
  flex: 1;
  max-width: 240px;
  min-width: 150px;
}
.pf-picker-search-input {
  width: 100%;
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  outline: none;
}
.pf-picker-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.pf-picker-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pf-picker-act-btn {
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 500;
  color: #475569;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.pf-picker-act-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.pf-picker-count-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid #bfdbfe;
}
.pf-chart-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.pf-chart-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 11px;
  user-select: none;
}
.pf-chart-choice:hover {
  border-color: #93c5fd;
  background: #f8faff;
}
.pf-chart-choice.selected {
  border-color: #60a5fa;
  background: #eff6ff;
}
.pf-chart-choice input[type="checkbox"] {
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}
.pf-choice-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pf-choice-content {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pf-choice-content strong {
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-choice-content small {
  font-size: 10px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-choice-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.pf-choice-badge.valores {
  background: #dbeafe;
  color: #1d4ed8;
}
.pf-choice-badge.grupos {
  background: #fef3c7;
  color: #b45309;
}
.pf-choice-badge.lotes {
  background: #e0e7ff;
  color: #4338ca;
}

/* ── Status Bar & Chart Layout ─────────────────────────────── */
.pf-chart-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 10.5px;
  color: #64748b;
}
.pf-chart-status-info {
  font-weight: 500;
}
.pf-chart-source-tag {
  font-size: 10px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.pf-chart-layout {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-top: 4px;
}
.pf-chart-main {
  flex: 1;
  min-width: 0;
}
.pf-chart-canvas-wrap {
  position: relative;
  background: #fafcff;
  border: 1px solid #edf2f7;
  border-radius: 9px;
  padding: 8px 10px 4px;
}
.pf-chart-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 10px 12px;
}
.pf-chart-legend-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

/* ── SVG Chart Elements ────────────────────────────────────── */
.pf-chart-svg {
  display: block;
  width: 100%;
  height: 320px;
  overflow: visible;
}
.pf-chart-svg path {
  vector-effect: non-scaling-stroke;
}
.pf-chart-line {
  vector-effect: non-scaling-stroke;
  transition: opacity 0.15s ease, stroke-width 0.15s ease;
}
.pf-chart-area {
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}
.pf-chart-zero {
  stroke: #94a3b8;
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}
.pf-chart-grid-line {
  stroke: #f1f5f9;
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.pf-chart-vgrid-line {
  stroke: #f1f5f9;
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.pf-chart-tick-mark {
  stroke: #cbd5e1;
  stroke-width: 1;
}
.pf-chart-axis-baseline {
  stroke: #e2e8f0;
  stroke-width: 1;
}
.pf-chart-y-label {
  fill: #787b86;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.pf-chart-x-label {
  fill: #787b86;
  font-size: 10px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
  user-select: none;
}
.pf-chart-x-label.major {
  fill: #1e222d;
  font-weight: 700;
}
.pf-chart-crosshair {
  stroke: #787b86;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}
.pf-chart-x-badge {
  pointer-events: none;
}
.pf-chart-x-badge-bg {
  fill: #1e222d;
}
.pf-chart-x-badge-text {
  fill: #ffffff;
  font-size: 10px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
  user-select: none;
}
.pf-chart-y-badge {
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.38));
}
.pf-chart-y-badge-bg {
  fill: #0f172a;
}
.pf-chart-y-badge-arrow {
  pointer-events: none;
}
.pf-chart-y-badge-text {
  fill: #ffffff;
  font-size: 11px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  user-select: none;
  dominant-baseline: central;
}
.pf-chart-hover-layer {
  pointer-events: none;
}
.pf-chart-hover-dot-wrap {
  pointer-events: none;
}
.pf-chart-hover-dot-halo {
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(79, 70, 229, 0.45));
}
.pf-chart-dot,
.pf-chart-hover-dot,
.pf-chart-hover-ma-dot {
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}
[data-pf-chart-canvas-inner] {
  position: relative;
  user-select: none;
  touch-action: none;
}
.pf-chart-overlay {
  cursor: crosshair;
}
[data-pf-chart-canvas-inner].panning,
[data-pf-chart-canvas-inner].panning .pf-chart-overlay,
[data-chart-canvas-inner].panning,
[data-chart-canvas-inner].panning .pf-chart-overlay,
[data-val-canvas-inner].panning,
[data-val-canvas-inner].panning .pf-chart-overlay {
  cursor: grabbing !important;
}
[data-pf-chart-canvas-inner].measuring,
[data-pf-chart-canvas-inner].measuring .pf-chart-overlay,
[data-pf-chart-canvas-inner].measuring-active,
[data-pf-chart-canvas-inner].measuring-active .pf-chart-overlay,
[data-chart-canvas-inner].measuring,
[data-chart-canvas-inner].measuring .pf-chart-overlay,
[data-chart-canvas-inner].measuring-active,
[data-chart-canvas-inner].measuring-active .pf-chart-overlay,
[data-val-canvas-inner].measuring,
[data-val-canvas-inner].measuring .pf-chart-overlay,
[data-val-canvas-inner].measuring-active,
[data-val-canvas-inner].measuring-active .pf-chart-overlay {
  cursor: crosshair !important;
}
.pf-measure-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pf-measure-tool-btn:hover {
  background: #f1f5f9;
}
.pf-measure-tool-btn.active {
  background: #fef2f2 !important;
  border-color: #f87171 !important;
  color: #dc2626 !important;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.pf-chart-measure-layer {
  pointer-events: none;
}
.pf-chart-measure-layer[hidden] {
  display: none !important;
}
.pf-chart-measure-box,
.pf-chart-measure-diagonal,
.pf-chart-measure-pt1,
.pf-chart-measure-pt2 {
  pointer-events: none;
}
.pf-chart-measure-pt1,
.pf-chart-measure-pt2 {
  filter: drop-shadow(0 1px 2px rgba(220, 38, 38, 0.3));
}
.pf-chart-measure-diagonal {
  filter: drop-shadow(0 1px 2px rgba(220, 38, 38, 0.25));
}
.pf-chart-measure-badge {
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}
.pf-chart-measure-badge-text {
  font-family: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
  user-select: none;
}

/* ── Google Finance Style Right-Click Compare Layer ──────────── */
[data-chart-canvas-inner].comparing,
[data-chart-canvas-inner].comparing .pf-chart-overlay,
[data-val-canvas-inner].comparing,
[data-val-canvas-inner].comparing .pf-chart-overlay {
  cursor: crosshair !important;
  user-select: none;
}
.pf-chart-compare-layer {
  pointer-events: none;
}
.pf-chart-compare-layer[hidden] {
  display: none !important;
}
.pf-chart-compare-band,
.pf-chart-compare-v1,
.pf-chart-compare-v2,
.pf-chart-compare-baseline,
.pf-chart-compare-connector,
.pf-chart-compare-pt1,
.pf-chart-compare-pt2,
.pf-chart-compare-pt1-halo,
.pf-chart-compare-pt2-halo,
.pf-chart-compare-badge {
  pointer-events: none;
}
.pf-chart-compare-badge {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
.pf-chart-compare-badge-text {
  font-family: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
  user-select: none;
}
.pf-chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 250px;
  color: #94a3b8;
  font-size: 12px;
}

/* ── Dual-Handle Timeline Brush Bar ────────────────────────── */
.pf-timeline-bar-wrap {
  margin-top: 10px;
  padding: 10px 14px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.pf-timeline-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
}
.pf-timeline-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 8px;
}
.pf-timeline-chip-title {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pf-timeline-date-chip strong {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.pf-timeline-hint {
  font-size: 10.5px;
  color: #94a3b8;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-timeline-track {
  position: relative;
  height: 32px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  overflow: hidden;
  user-select: none;
  cursor: pointer;
}
.pf-timeline-sparkline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
  pointer-events: none;
}
.pf-timeline-mask {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(226, 232, 240, 0.82);
  backdrop-filter: blur(1px);
  pointer-events: none;
}
.pf-timeline-mask.left {
  left: 0;
}
.pf-timeline-mask.right {
  right: 0;
}
.pf-timeline-window {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(37, 99, 235, 0.12);
  border-top: 2px solid #2563eb;
  border-bottom: 2px solid #2563eb;
  display: flex;
  align-items: stretch;
  cursor: grab;
  touch-action: none;
}
.pf-timeline-window.dragging {
  cursor: grabbing;
  background: rgba(37, 99, 235, 0.2);
  border-color: #1d4ed8;
}
.pf-timeline-window-body {
  flex: 1;
  min-width: 0;
  height: 100%;
}
.pf-timeline-handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 14px;
  background: #2563eb;
  border: 1.5px solid #ffffff;
  border-radius: 4px;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  touch-action: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: background 0.15s ease, transform 0.1s ease;
}
.pf-timeline-handle.left {
  left: -7px;
}
.pf-timeline-handle.right {
  right: -7px;
}
.pf-timeline-handle:hover,
.pf-timeline-handle.active {
  background: #1d4ed8;
  transform: scaleY(1.1);
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.4);
}
.pf-handle-grip {
  width: 2px;
  height: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 1px;
}

/* ── Legend Chips ──────────────────────────────────────────── */
.pf-chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 270px;
  overflow-y: auto;
}
.pf-legend-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  margin-bottom: 5px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pf-legend-chip:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.pf-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pf-legend-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: #1e293b;
}
.pf-legend-val {
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, monospace;
  margin-left: 4px;
}
.pf-legend-val.positive {
  color: #059669;
}
.pf-legend-val.negative {
  color: #dc2626;
}
.pf-legend-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: all 0.1s;
}
.pf-legend-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

.pf-chart-note {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 10.5px;
}
.pf-chart-trigger {
  display: inline-grid;
  width: 25px;
  height: 25px;
  margin-left: auto;
  padding: 4px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: #2563eb;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pf-chart-trigger:hover,
.pf-chart-trigger:focus-visible {
  background: #eaf1ff;
  outline: none;
}
.pf-chart-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.pf-lot-date .pf-chart-trigger {
  float: right;
  margin: -4px 0 0 6px;
}

/* ── Dashboard de cartera estilo DivvyDiary ─────────────────── */

.portfolio-page-section {
  padding: 30px 48px 44px;
  border-top: 1px solid #e1e3e7;
  background: #f5f6f8;
}

.portfolio-page-section > #portfolio-section {
  max-width: 1180px;
  margin: 0 auto;
}

.pf-dashboard {
  color: #1d2a39;
}

.pf-metric-strip {
  display: grid;
  grid-template-columns: 1.08fr 1fr 1fr;
  overflow: hidden;
  border: 1px solid #dfe2e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 32, 45, .08);
}

.pf-metric-card {
  position: relative;
  min-height: 86px;
  padding: 17px 20px 14px;
}

.pf-metric-card + .pf-metric-card { border-left: 1px solid #dfe2e6; }

.pf-metric-label {
  display: flex;
  min-height: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  color: #6f7b89;
  font-size: 11px;
}

.pf-metric-label > span { min-width: 0; }
.pf-metric-label i { display: inline-grid; width: 12px; height: 12px; margin-left: 3px; place-items: center; border-radius: 50%; background: #77818c; color: #fff; font-size: 8px; font-style: normal; font-weight: 700; vertical-align: 1px; }

.pf-period-select, .pf-select {
  height: 28px;
  padding: 0 9px;
  border: 1px solid #edf0f3;
  border-radius: 6px;
  background: #f7f8fa;
  color: #425064;
  font-size: 10px;
  font-weight: 700;
}

.pf-metric-value-row { display: flex; align-items: baseline; gap: 9px; margin-top: 4px; }
.pf-metric-value-row strong { color: #1c2a3b; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pf-metric-trend { font-size: 11px; font-weight: 700; white-space: nowrap; }
.pf-metric-trend.positive { color: #078c6a; }
.pf-metric-trend.negative { color: #dc4a4a; }
.pf-metric-action { position: absolute; right: 17px; bottom: 11px; color: #aeb7c2; font-size: 14px; }
.pf-net-toggle { display: inline-flex; align-items: center; gap: 9px; color: #8b96a3; font-size: 10px; font-weight: 400; white-space: nowrap; }

.pf-switch {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 19px;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #dfe3e8;
  cursor: pointer;
}

.pf-switch span { display: block; width: 15px; height: 15px; margin-left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); transition: transform .15s ease; }
.pf-switch.on { background: #4f46e5; }
.pf-switch.on span { transform: translateX(15px); }
.pf-switch:disabled { cursor: not-allowed; opacity: .95; }

.pf-dashboard-tabs {
  display: flex;
  min-height: 68px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid #dfe2e6;
}

.pf-tab-list { display: flex; min-width: 0; align-items: flex-end; gap: 6px; overflow-x: auto; }
.pf-dashboard-tab { display: inline-flex; height: 43px; align-items: center; gap: 8px; padding: 0 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #687588; font-size: 12px; white-space: nowrap; }
.pf-dashboard-tab span { color: #738092; font-size: 16px; line-height: 1; }
.pf-dashboard-tab:hover { color: #4f46e5; }
.pf-dashboard-tab.active { border-bottom-color: #4f46e5; color: #4338ca; font-weight: 700; }
.pf-dashboard-tab.active span { color: #4f46e5; }
.pf-dashboard-add { margin-bottom: 8px; padding: 7px 11px; border: 1px solid #d6dce3; border-radius: 6px; background: #fff; color: #506075; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pf-dashboard-add:hover { border-color: #4f46e5; color: #4338ca; }

.pf-allocation-card, .pf-broker-panel, .pf-dividend-panel, .pf-placeholder-panel {
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid #dfe2e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 32, 45, .08);
}

.pf-allocation-card { padding: 17px 19px 0; }
.pf-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 10px; }
.pf-card-head h4 { margin: 0; color: #1e2c3d; font-size: 15px; font-weight: 700; }
.pf-card-head p { margin: 4px 0 0; color: #8a96a4; font-size: 11px; }
.pf-allocation-head { margin-bottom: 6px; }
.pf-allocation-controls { display: flex; align-items: center; gap: 13px; }
.pf-control-toggle { display: inline-flex; align-items: center; gap: 8px; color: #8a96a4; font-size: 10px; }
.pf-control-toggle .pf-switch { width: 35px; }

.pf-allocation-layout { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(280px, 1fr); align-items: center; gap: 32px; min-height: 380px; padding: 8px 10px 14px; }
.pf-allocation-visual { position: relative; width: min(100%, 380px); aspect-ratio: 1; margin: 0 auto; }
.pf-allocation-donut { display: block; width: 100%; height: 100%; overflow: visible; }
.pf-allocation-donut circle { stroke-width: 23; }
.pf-donut-slice { cursor: pointer; transition: opacity 0.15s ease, filter 0.15s ease; }
.pf-donut-slice:hover, .pf-donut-slice.hovered { filter: brightness(1.08) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.14)); }
.pf-allocation-visual.has-hover .pf-donut-slice:not(.hovered):not(:hover) { opacity: 0.35; }
.pf-allocation-center { position: absolute; top: 50%; left: 50%; display: flex; width: 48%; align-items: center; flex-direction: column; gap: 4px; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.pf-allocation-center span { color: #64748b; font-size: 11.5px; font-weight: 500; }
.pf-allocation-center strong { color: #0f172a; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-allocation-legend { max-height: 360px; margin: 0; padding: 0 16px 0 0; overflow-y: auto; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.pf-allocation-legend-item { display: flex; min-height: 30px; align-items: center; gap: 10px; color: #334155; font-size: 12px; border-radius: 6px; padding: 3px 8px; cursor: pointer; transition: background-color 0.15s ease, opacity 0.15s ease; }
.pf-allocation-legend-item:hover, .pf-allocation-legend-item.hovered { background: #f1f5f9; }
.pf-allocation-legend.has-hover .pf-allocation-legend-item:not(.hovered):not(:hover) { opacity: 0.45; }
.pf-allocation-swatch { width: 12px; height: 12px; flex: 0 0 12px; border-radius: 3px; }
.pf-allocation-legend-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pf-allocation-legend-item strong { min-width: 54px; color: #0f172a; font-size: 12px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.pf-card-footer { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #e3e6e9; }
.pf-footer-hint { color: #9aa4b0; font-size: 10.5px; }
.pf-footer-link { padding: 0; border: 0; background: transparent; color: #4338ca; font-size: 11px; }
.pf-footer-link:hover { color: #c94f35; text-decoration: underline; text-underline-offset: 2px; }
.pf-outline-button { min-height: 29px; padding: 0 10px; border: 1px solid #d7dde3; border-radius: 6px; background: #fff; color: #5b6a7d; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.pf-outline-button:hover { border-color: #4f46e5; color: #4338ca; }

.pf-positions-views { display: inline-flex; overflow: hidden; border: 1px solid #d7dde3; border-radius: 6px; background: #fff; }
.pf-view-button { min-height: 29px; padding: 0 13px; border: 0; border-right: 1px solid #e2e6ea; background: transparent; color: #5b6a7d; font-size: 10.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pf-view-button:last-child { border-right: 0; }
.pf-view-button:hover { background: #f7f9fb; color: #4338ca; }
.pf-view-button.active { background: var(--accent-soft); color: var(--accent-dark); }

.pf-expand-head { width: 26px; }
.pf-expand-cell { padding: 0 4px !important; }
.pf-expand-btn { display: grid; width: 26px; height: 26px; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #9aa6b4; font-size: 11px; line-height: 1; cursor: pointer; transition: background 0.15s, color 0.15s; }
.pf-expand-btn::before { content: '▸'; display: block; transition: transform 0.18s ease; }
.pf-expand-btn:hover, .pf-expand-btn.open { background: #eef2ff; color: #4338ca; }
.pf-expand-btn.open::before { transform: rotate(90deg); }
.pf-broker-table tbody tr.pf-row-expanded td { background: #f5f7ff !important; }
.pf-lot-row td { background: #fafbfc !important; color: #4a5a6d; font-size: 10.5px; }
.pf-lot-row .pf-expand-cell { text-align: center !important; }
.pf-lot-row .pf-lot-date { text-align: left; color: #8290a0; }
.pf-lot-row .pf-lot-date .pf-lot-badge { margin-left: 6px; }
.pf-lot-date-line { display: block; white-space: nowrap; }
.pf-lot-date-line + .pf-lot-date-line { margin-top: 3px; }
.pf-lot-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; background: #eef2f5; color: #354356; font-size: 9.5px; font-weight: 700; }
.pf-lot-badge.sell { background: #fdeeee; color: #c94f35; }
.pf-lot-badge.sold { background: #eee9f7; color: #6b4fa1; }
.pf-status-badge { display: inline-block; flex: 0 0 auto; padding: 2px 6px; border-radius: 4px; font-size: 8.5px; font-weight: 700; white-space: nowrap; }
.pf-status-badge.sold { background: #fdeeee; color: #c94f35; }
.pf-status-badge.partial { background: #eef2ff; color: #4338ca; }

.pf-broker-panel, .pf-dividend-panel { padding: 17px 0 0; }
.pf-broker-panel > .pf-card-head, .pf-dividend-panel > .pf-card-head { margin: 0 19px 12px; }
.pf-broker-table-wrap, .pf-dividend-table-wrap { overflow-x: auto; }
.pf-broker-table > tbody > tr > td:first-child,
.pf-transactions-table > tbody > tr > td:first-child {
  display: table-cell;
  align-items: unset;
  gap: unset;
}
.pf-broker-table, .pf-dividend-table { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: auto; }
.pf-broker-table.pf-table-wide { min-width: 940px; }
.pf-broker-table.pf-table-wide td { font-size: 10px; }
.pf-broker-table th, .pf-dividend-table th { padding: 8px 3px; border-bottom: 1px solid #dce1e6; background: #fafbfc; color: #8290a0; font-size: 8.5px; font-weight: 700; text-align: right; text-transform: uppercase; white-space: nowrap; }
.pf-broker-table th:first-child, .pf-dividend-table th:first-child { text-align: left; }
.pf-sort-mark { margin-left: 3px; color: #a5afba; font-size: 11px; }
.pf-broker-table th[data-sort-key] { cursor: pointer; user-select: none; }
.pf-broker-table th[data-sort-key]:hover, .pf-broker-table th.pf-sort-active { color: #4338ca; }
.pf-broker-table th.pf-sort-active .pf-sort-mark { color: #4338ca; }
.pf-mode-toggle { display: inline-grid; width: 19px; height: 19px; margin-left: 4px; place-items: center; border: 1px solid #d7dde3; border-radius: 5px; background: #fff; color: #5b6a7d; font-size: 10px; font-weight: 700; line-height: 1; cursor: pointer; vertical-align: middle; }
.pf-mode-toggle:hover { border-color: #4f46e5; color: #4338ca; }
.pf-mode-toggle.active { background: #eef2ff; border-color: #4f46e5; color: #4338ca; }
.pf-mode-toggle-text { width: auto; min-width: 38px; padding: 0 5px; font-size: 9px; }
.pf-broker-table td, .pf-dividend-table td { padding: 7px 4px; border-bottom: 1px solid #eef0f2; color: #26364a; font-size: 10.5px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pf-broker-table tbody tr:nth-child(even) td, .pf-dividend-table tbody tr:nth-child(even) td { background: #fafbfc; }
.pf-broker-table tbody tr[data-ticker], .pf-dividend-table tbody tr[data-ticker] { cursor: pointer; }
.pf-broker-table tbody tr[data-ticker]:hover td, .pf-dividend-table tbody tr[data-ticker]:hover td { background: #f5f7ff; }
.pf-broker-table tbody tr[data-ticker]:focus-visible, .pf-dividend-table tbody tr[data-ticker]:focus-visible { outline: 2px solid #4f46e5; outline-offset: -2px; }
.pf-broker-first-head { min-width: 125px; }
.pf-broker-company { display: flex; min-width: 115px; align-items: center; gap: 7px; text-align: left !important; }
.pf-company-logo { display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; overflow: hidden; border-radius: 50%; background: #edf1f5; color: #637187; font-size: 11px; font-weight: 700; }
.pf-company-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pf-company-logo.fallback { background: #e9eef5; }
.pf-broker-company-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; text-align: left; }
.pf-broker-company-copy strong { overflow: hidden; color: #1d2b3c; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pf-broker-company-copy small, .pf-double-value small { color: #8a99aa; font-size: 10px; }
.pf-double-value { display: flex; min-width: 82px; align-items: flex-end; flex-direction: column; gap: 2px; }
.pf-double-value strong { color: #26364a; font-size: 11px; font-weight: 400; }
.pf-double-value.positive strong, .pf-broker-table td.positive .pf-double-value strong { color: #078c6a; }
.pf-double-value.negative strong, .pf-broker-table td.negative .pf-double-value strong { color: #dc4a4a; }

.pf-chart-tooltip {
  position: fixed;
  z-index: 2147483647 !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 140px;
  max-width: 320px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 11px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.pf-chart-tooltip[hidden] { display: none; }
.pf-chart-tooltip-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 3px; }
.pf-chart-tooltip-header {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.pf-chart-tooltip-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pf-chart-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pf-chart-tooltip-name {
  color: #cbd5e1;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.pf-chart-tooltip-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  white-space: nowrap;
}
.pf-chart-tooltip-val.positive {
  color: #34d399;
}
.pf-chart-tooltip-val.negative {
  color: #f87171;
}

/* Measurement Tooltip Card */
.pf-measure-tooltip-head {
  padding-bottom: 7px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pf-measure-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #93c5fd;
}
.pf-measure-badge-tag.positive {
  color: #34d399;
}
.pf-measure-badge-tag.negative {
  color: #f87171;
}
.pf-measure-period {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
}
.pf-measure-sub {
  font-size: 10px;
  color: #94a3b8;
}
.pf-measure-tooltip-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pf-measure-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
}
.pf-measure-row-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pf-measure-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  font-weight: 500;
  color: #e2e8f0;
}
.pf-measure-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  white-space: nowrap;
}
.pf-measure-from-to {
  font-size: 9.5px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.pf-measure-diff {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pf-measure-diff.positive {
  color: #34d399;
}
.pf-measure-diff.negative {
  color: #f87171;
}
.pf-double-value.positive small { color: #078c6a; }
.pf-double-value.negative small { color: #dc4a4a; }
.pf-broker-table td.positive, .pf-lot-row td.positive, .pf-broker-totals-row td.positive { color: var(--green); font-weight: 700; }
.pf-broker-table td.negative, .pf-lot-row td.negative, .pf-broker-totals-row td.negative { color: var(--red); font-weight: 700; }
.pf-broker-totals-row td { border-top: 2px solid #d4dbe2; background: #f6f8fa !important; color: #1d2b3c; font-weight: 700; }
.pf-broker-totals-row .pf-broker-company strong { font-size: 11px; }

.pf-dividend-panel { padding-bottom: 0; }
.pf-dividend-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 19px 15px; }
.pf-dividend-summary > div { padding: 11px 13px; border: 1px solid #e2e6ea; border-radius: 6px; background: #fbfcfd; }
.pf-dividend-summary span { display: block; color: #8290a0; font-size: 10px; }
.pf-dividend-summary strong { display: block; margin-top: 5px; color: #1d2b3c; font-size: 16px; font-variant-numeric: tabular-nums; }
.pf-dividend-table { min-width: 650px; }
.pf-dividend-table td:first-child { text-align: left; }

.pf-operations-form-panel { margin-top: 20px; }
.pf-operations-form-panel .pf-form-block { margin: 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 0; }
.pf-placeholder-panel { display: flex; min-height: 260px; align-items: center; justify-content: center; flex-direction: column; padding: 30px; text-align: center; }
.pf-placeholder-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: #eef2ff; color: #4f46e5; font-size: 21px; }
.pf-placeholder-panel h4 { margin: 15px 0 5px; font-size: 16px; }
.pf-placeholder-panel p { max-width: 410px; margin: 0; color: #8491a0; font-size: 12px; }
.pf-dashboard-empty-add { width: auto; }
.pf-empty-state { margin-top: 20px; border: 1px solid #dfe2e6; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(20, 32, 45, .08); }

@media (max-width: 900px) {
  .portfolio-page-section { padding-right: 24px; padding-left: 24px; }
  .pf-allocation-layout { grid-template-columns: minmax(330px, 1fr) minmax(270px, .9fr); gap: 10px; }
  .pf-allocation-legend { padding-right: 4px; }
}

@media (max-width: 700px) {
  .portfolio-page-section { padding: 20px 15px 30px; }
  .pf-metric-strip { grid-template-columns: 1fr; }
  .pf-metric-card { min-height: 80px; }
  .pf-metric-card + .pf-metric-card { border-top: 1px solid #dfe2e6; border-left: 0; }
  .pf-dashboard-tabs { min-height: 59px; align-items: flex-end; }
  .pf-tab-list { gap: 0; }
  .pf-dashboard-tab { padding: 0 10px; font-size: 11px; }
  .pf-dashboard-tab span { display: none; }
  .pf-dashboard-add { padding: 6px 8px; font-size: 10px; }
  .pf-allocation-card { padding-right: 12px; padding-left: 12px; }
  .pf-allocation-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .pf-allocation-controls { width: 100%; justify-content: space-between; }
  .pf-allocation-layout { display: flex; min-height: 0; align-items: stretch; flex-direction: column; gap: 14px; padding: 12px 0 18px; }
  .pf-allocation-visual { width: min(100%, 420px); }
  .pf-allocation-legend { max-height: none; padding: 0 5px; }
  .pf-dividend-summary { grid-template-columns: 1fr; margin-right: 12px; margin-left: 12px; }
  .pf-broker-panel > .pf-card-head, .pf-dividend-panel > .pf-card-head { margin-right: 12px; margin-left: 12px; }
  .pf-card-head { align-items: flex-start; flex-direction: column; }
  .pf-card-head .pf-outline-button { align-self: flex-start; }
  .pf-groups-section > .pf-card-head { margin-right: 12px; margin-left: 12px; }
  .pf-groups-head-actions { flex-wrap: wrap; }
  .pf-groups-tabs { margin-right: 12px; margin-left: 12px; flex-wrap: wrap; }
  .pf-groups-tab-actions { padding-bottom: 6px; }
  .pf-groups-empty { margin-right: 12px; margin-left: 12px; }
  .pf-dashboard-empty-add { width: auto; }
  .pf-chart-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .pf-chart-controls { width: 100%; justify-content: flex-start; }
  .pf-chart-controls .pf-metric-wrap { flex: 1; min-width: 130px; }
  .pf-chart-controls .pf-select { width: 100%; min-width: 0; }
  .pf-range-pills { overflow-x: auto; max-width: 100%; }
  .pf-chart-layout { flex-direction: column; }
  .pf-chart-sidebar { width: 100%; }
  .pf-chart-legend { display: flex; flex-wrap: wrap; gap: 6px; max-height: none; }
  .pf-timeline-info { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .pf-timeline-hint { display: none; }
}

/* ── Pestañas y grupos de la cartera ───────────────────────── */

.pf-g-dot { display: inline-block; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; }
.pf-g-pills { display: inline-flex; max-width: 110px; flex-wrap: wrap; gap: 3px; align-items: center; }
.pf-g-pill { display: inline-flex; align-items: center; gap: 4px; max-width: 82px; overflow: hidden; padding: 1px 6px; border-radius: 9px; background: #f2f5f8; color: #44536a; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pf-groups-cell { text-align: left !important; }
.pf-g-add { display: inline-grid; width: 20px; height: 20px; margin-left: 4px; place-items: center; border: 1px solid #d7dde3; border-radius: 5px; background: #fff; color: #8a99aa; font-size: 11px; line-height: 1; cursor: pointer; vertical-align: middle; }
.pf-g-add:hover { border-color: #4f46e5; color: #4338ca; background: #eef2ff; }

.pf-groups-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e3e7eb; }
.pf-groups-section > .pf-card-head { margin: 0 19px 12px; }
.pf-groups-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pf-groups-title h5 { margin: 0; color: #1d2b3c; font-size: 12px; }
.pf-groups-hint { margin: 3px 0 0; color: #8a99aa; font-size: 10.5px; }
.pf-groups-controls { display: flex; align-items: center; gap: 6px; }
.pf-positions-head-actions, .pf-groups-head-actions { display: flex; align-items: center; gap: 10px; }
.pf-show-all-btn { display: inline-flex; align-items: center; gap: 5px; color: #2563eb; border-color: #cbd5e1; }
.pf-show-all-btn:hover { border-color: #2563eb; color: #1d4ed8; background: #eff6ff; }
.pf-show-all-btn svg { stroke: #2563eb; }
.pf-toggle-chart-btn { display: inline-flex; align-items: center; gap: 6px; }
.pf-toggle-chart-btn svg { color: #4f46e5; }
.pf-chart-empty-clean { text-align: center; padding: 24px 20px; }
.pf-chart-empty-clean p { margin: 0; }
.pf-chart-empty-clean strong { color: #334155; font-size: 13px; }
.pf-chart-empty-sub { max-width: 500px; margin-top: 6px !important; color: #64748b !important; font-size: 11.5px !important; line-height: 1.5; }
.pf-inline-chart-icon { display: inline-grid; place-items: center; width: 17px; height: 17px; vertical-align: middle; background: #eff6ff; border-radius: 4px; color: #2563eb; }
.pf-legend-empty-hint { padding: 10px 12px; color: #94a3b8; font-size: 11px; font-style: italic; list-style: none; }
.pf-groups-tabs { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 19px; border-bottom: 1px solid #e3e7eb; }
.pf-groups-tab-list { display: flex; min-width: 0; align-items: flex-end; gap: 6px; overflow-x: auto; }
.pf-groups-tab { display: inline-flex; height: 40px; align-items: center; gap: 6px; padding: 0 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #687588; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pf-groups-tab:hover { color: #4f46e5; }
.pf-groups-tab.active { border-bottom-color: #4f46e5; color: #4338ca; }
.pf-groups-tab-actions { display: flex; align-items: center; gap: 6px; padding: 0 0 8px; }
.pf-g-row-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 0; margin-left: 6px; }
.pf-groups-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0; }
.pf-groups-empty { margin: 14px 19px; padding: 12px 14px; border: 1px dashed #d3d9e0; border-radius: 8px; background: #fbfcfd; color: #8a99aa; font-size: 11px; }

.pf-g-pill-item { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid #d7dde3; border-radius: 7px; background: #fff; }
.pf-g-pill-item.active { border-color: #4f46e5; box-shadow: 0 0 0 1px #4f46e5; }
.pf-g-pill-btn { display: inline-flex; min-height: 27px; align-items: center; gap: 6px; padding: 0 8px; border: 0; background: transparent; color: #3b4a5f; font-size: 10.5px; font-weight: 700; cursor: pointer; }
.pf-g-pill-btn:hover { color: #4338ca; }
.pf-g-count { padding: 1px 6px; border-radius: 8px; background: #eef2f5; color: #5b6a7d; font-size: 9.5px; }
.pf-g-pill-edit, .pf-g-pill-del { display: grid; width: 25px; height: 27px; place-items: center; border: 0; border-left: 1px solid #eceff2; background: transparent; color: #8a99aa; font-size: 11px; cursor: pointer; }
.pf-g-pill-edit:hover { background: #f1f4f7; color: #4338ca; }
.pf-g-pill-del:hover { background: #fdeeee; color: var(--red); }

.pf-g-form { margin-top: 12px; padding: 12px; border: 1px dashed #d3d9e0; border-radius: 8px; background: #fff; }
.pf-g-form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pf-g-form-head { margin-bottom: 9px; }
.pf-g-form-title { color: #1d2b3c; font-size: 11.5px; font-weight: 700; }
.pf-g-form-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.pf-g-name { width: 220px; height: 30px; }
.pf-g-color { width: 44px; height: 30px; padding: 2px; border: 1px solid #d7dde3; border-radius: 6px; background: #fff; cursor: pointer; }
.pf-g-members-title { margin: 0 0 8px; color: #5b6a7d; font-size: 10.5px; font-weight: 700; }
.pf-g-members-list { max-height: 280px; overflow-y: auto; padding-right: 6px; overscroll-behavior: contain; }
.pf-g-member-item { padding: 6px 0; border-bottom: 1px solid #eef1f4; }
.pf-g-member-item:last-child { border-bottom: 0; }
.pf-g-action-check { display: flex; align-items: center; gap: 8px; font-size: 11px; cursor: pointer; }
.pf-g-action-check input, .pf-g-subline-check input { accent-color: var(--accent); cursor: pointer; }
.pf-g-action-check strong { color: #1d2b3c; }
.pf-g-action-check small { color: #8a99aa; }
.pf-g-sublines { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 12px; margin: 5px 0 0 22px; }
.pf-g-subline-check { display: flex; align-items: center; gap: 7px; color: #5b6a7d; font-size: 10px; cursor: pointer; }
.pf-g-subline-check span { white-space: nowrap; }
.pf-g-form-actions { display: flex; gap: 8px; margin-top: 12px; }
.pf-g-form-actions .primary-button { min-width: 120px; }
.pf-g-form-actions .pf-outline-button { min-height: 30px; }

.pf-g-popover { position: fixed; z-index: 1400; width: 280px; max-height: min(400px, 70vh); overflow: hidden; border-radius: 10px; background: #fff; box-shadow: 0 10px 34px rgba(0, 0, 0, .22); }
.pf-g-popover[hidden] { display: none; }
.pf-g-popover-row.disabled { opacity: .55; cursor: default; }
.pf-g-popover-row.disabled:hover { background: transparent; }
.pf-g-popover-row.disabled .watch-popover-name { color: var(--muted); }
.pf-g-popover-row.disabled .pf-g-dot { filter: saturate(.6); }

.pf-g-lot-row td { background: #fafbfc !important; color: #4a5a6d; font-size: 10.5px; }
.pf-g-lot-action .pf-broker-company-copy strong { font-size: 10px; }
.pf-g-members-table { min-width: 720px; }
.pf-g-groups-table { min-width: 940px; }
.pf-g-groups-table tbody tr.pf-row-expanded td { background: #f5f7ff !important; }
.pf-g-groups-table .pf-g-row-actions .pf-g-pill-edit,
.pf-g-groups-table .pf-g-row-actions .pf-g-pill-del { width: 24px; height: 24px; }

/* ── Panel de Dividendos (Diseño idéntico a capturas) ───────── */

.pf-dividend-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.pf-dividend-card {
  overflow: hidden;
  border: 1px solid #dfe2e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 32, 45, .06);
  padding: 20px 22px;
}

.pf-dividend-card .pf-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.pf-dividend-card .pf-card-head h4 {
  margin: 0;
  color: #1e2c3d;
  font-size: 15px;
  font-weight: 700;
}

.pf-dividend-card .pf-card-head p {
  margin: 4px 0 0;
  color: #8a96a4;
  font-size: 11px;
}

.pf-segmented-toggle {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #d7dde3;
  border-radius: 6px;
  background: #fff;
}

.pf-seg-btn {
  min-height: 28px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid #e2e6ea;
  background: transparent;
  color: #687588;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pf-seg-btn:last-child {
  border-right: 0;
}

.pf-seg-btn:hover {
  background: #f8fafc;
  color: #4338ca;
}

.pf-seg-btn.active {
  background: #fff;
  color: #4338ca;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(235, 98, 68, 0.2);
}

/* 1. Distribución de tus dividendos */

.pf-dist-head-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-dist-select {
  height: 28px;
  padding: 0 8px;
  border: 1px solid #d7dde3;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.pf-dist-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: center;
  margin-top: 12px;
}

.pf-dist-visual-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pf-dist-donut-wrap {
  position: relative;
  width: min(100%, 290px);
  aspect-ratio: 1;
}

.pf-dist-donut-svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(0deg);
}

.pf-dist-slice {
  cursor: pointer;
  transition: stroke-width 0.2s ease, opacity 0.2s ease;
}

.pf-dist-slice:hover,
.pf-dist-slice.highlighted {
  stroke-width: 44;
  opacity: 0.9;
}

.pf-dist-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  width: 60%;
}

.pf-dist-donut-center span {
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
}

.pf-dist-donut-center strong {
  margin-top: 4px;
  color: #0f172a;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pf-dist-timeline-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 340px);
  margin-top: 4px;
}

.pf-dist-play-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid #d7dde3;
  border-radius: 50%;
  background: #fff;
  color: #64748b;
  font-size: 11px;
  cursor: pointer;
}

.pf-dist-play-btn.playing {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.pf-dist-play-btn:hover {
  border-color: #4f46e5;
  color: #4f46e5;
}

.pf-dist-play-btn.playing:hover {
  background: #4338ca;
  color: #fff;
}

.pf-dist-timeline-track {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pf-dist-timeline-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #94a3b8;
}

.pf-dist-timeline-tick {
  cursor: pointer;
  transition: color 0.15s ease;
}

.pf-dist-timeline-tick:hover {
  color: #4f46e5;
}

.pf-dist-timeline-tick.active {
  color: #0f172a;
  font-weight: 700;
}

.pf-dist-timeline-line {
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  position: relative;
  overflow: hidden;
}

.pf-dist-timeline-progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: #4f46e5;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.pf-dist-download-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 4px;
}

.pf-dist-download-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.pf-dist-legend-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 8px;
}

.pf-dist-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pf-dist-legend-row:hover,
.pf-dist-legend-row.highlighted {
  background: #f8fafc;
}

.pf-dist-legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex: 0 0 11px;
}

.pf-dist-legend-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 11.5px;
}

.pf-dist-legend-val {
  color: #334155;
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* 2. Gráfico apilado de 12 meses */

.pf-stacked-chart-area {
  position: relative;
  width: 100%;
  height: 250px;
  padding: 24px 0 0;
}

.pf-stacked-avg-line-wrap {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 2;
  transform: translateY(-50%);
}

.pf-stacked-avg-pill {
  padding: 2px 7px;
  border-radius: 4px;
  background: #4338ca;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}

.pf-stacked-avg-dashed {
  flex: 1;
  border-bottom: 1.5px dashed #4f46e5;
  opacity: 0.8;
}

.pf-stacked-columns {
  position: absolute;
  top: 10px;
  left: 70px;
  right: 10px;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  align-items: flex-end;
}

.pf-stacked-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.pf-stacked-top-val {
  margin-bottom: 5px;
  color: #475569;
  font-size: 9.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pf-stacked-bar-wrap {
  width: 100%;
  height: calc(100% - 38px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.pf-stacked-bar {
  width: min(100%, 38px);
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
}

.pf-stacked-seg {
  width: 100%;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.pf-stacked-seg:hover {
  opacity: 0.8;
}

.pf-stacked-month-label {
  height: 20px;
  line-height: 20px;
  color: #94a3b8;
  font-size: 9.5px;
  text-align: center;
  white-space: nowrap;
}

.pf-stacked-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.pf-stacked-avg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-size: 11px;
  cursor: pointer;
}

.pf-stacked-avg-toggle input {
  accent-color: #4f46e5;
  cursor: pointer;
}

/* 3. Matriz de dividendos */

.pf-matrix-card {
  padding-bottom: 0;
}

.pf-matrix-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.pf-matrix-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: auto;
}

.pf-matrix-table th {
  padding: 8px 6px;
  border-bottom: 1px solid #dce1e6;
  background: #fafbfc;
  color: #8290a0;
  font-size: 9px;
  font-weight: 700;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

.pf-matrix-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #eef0f2;
  color: #26364a;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.pf-matrix-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.pf-matrix-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.pf-matrix-table tbody tr:hover td {
  background: #f5f7ff;
}

.pf-matrix-sticky-company {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  text-align: left !important;
  min-width: 160px;
}

.pf-matrix-table th.pf-matrix-sticky-company {
  background: #fafbfc;
}

.pf-matrix-table tbody tr:nth-child(even) .pf-matrix-sticky-company {
  background: #fafbfc;
}

.pf-matrix-table tbody tr:hover .pf-matrix-sticky-company {
  background: #f5f7ff;
}

.pf-matrix-company-logo {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  flex: 0 0 22px;
}

.pf-matrix-sticky-sum {
  position: sticky;
  left: 160px;
  background: #fff;
  z-index: 2;
  min-width: 90px;
  border-right: 1px solid #e2e6ea;
}

.pf-matrix-table th.pf-matrix-sticky-sum {
  background: #fafbfc;
}

.pf-matrix-table tbody tr:nth-child(even) .pf-matrix-sticky-sum {
  background: #fafbfc;
}

.pf-matrix-table tbody tr:hover .pf-matrix-sticky-sum {
  background: #f5f7ff;
}

.pf-matrix-sum-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pf-matrix-growth-icon {
  color: #4338ca;
  font-weight: 700;
  font-size: 11px;
}

/* 4. Resumen de dividendos (Grid de tarjetas) */

.pf-summary-grid-desc {
  color: #64748b !important;
  font-size: 11px !important;
  margin-top: 4px !important;
}

.pf-summary-head-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-summary-toggle-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #d7dde3;
  border-radius: 4px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
}

.pf-summary-toggle-btn:hover {
  background: #f8fafc;
  color: #1e293b;
}

.pf-summary-period-select {
  height: 28px;
  padding: 0 8px;
  border: 1px solid #d7dde3;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.pf-month-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.pf-month-card {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pf-month-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #edf2f7;
}

.pf-month-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pf-month-card-title strong {
  color: #1e293b;
  font-size: 11px;
}

.pf-month-card-count {
  color: #4338ca;
  font-size: 10px;
  font-weight: 600;
}

.pf-month-card-total {
  color: #078c6a;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pf-month-card-body {
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pf-month-payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.pf-month-payment-row:hover {
  background: #f5f7ff;
}

.pf-month-payment-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.pf-month-payment-left .pf-company-logo {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  font-size: 9px;
  border-radius: 50%;
}

.pf-matrix-sticky-company .pf-company-logo {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  font-size: 9px;
  border-radius: 50%;
}

.pf-dist-legend-row .pf-company-logo {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  font-size: 8px;
  border-radius: 50%;
}

.pf-month-badge-logo {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 7.5px;
  font-weight: 700;
  flex: 0 0 18px;
}

.pf-month-payment-desc {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pf-month-payment-desc strong {
  color: #1e293b;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-month-payment-desc small {
  color: #94a3b8;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.pf-month-payment-amount {
  color: #1e293b;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pf-summary-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.pf-export-csv-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #4338ca;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
}

.pf-export-csv-btn:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .pf-month-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .pf-dist-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 700px) {
  .pf-month-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Calendario de Eventos de la Cartera ───────────────────── */

.pf-calendar-dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: pfFadeIn 0.2s ease;
}

/* Empresas en seguimiento del Calendario */
.pf-cal-companies-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pf-cal-companies-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pf-cal-companies-title-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pf-cal-companies-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-cal-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
}

.pf-cal-companies-title-row h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.pf-cal-companies-total-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.pf-cal-companies-quick-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 2px;
}

.pf-cal-companies-quick-edit-btn:hover {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.pf-cal-companies-sub {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.pf-cal-companies-sub strong {
  color: #334155;
}

/* Buscador de añadir empresa */
.pf-cal-add-company-wrap {
  position: relative;
  min-width: 260px;
  max-width: 380px;
  flex: 1;
}

.pf-cal-add-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.pf-cal-search-icon {
  position: absolute;
  left: 10px;
  color: #94a3b8;
  pointer-events: none;
}

.pf-cal-add-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 32px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 12.5px;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.pf-cal-add-input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.pf-cal-add-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.pf-cal-result-already {
  margin-left: auto;
  margin-right: 8px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 4px;
}

/* Chips de empresas */
.pf-cal-companies-body {
  margin-top: 2px;
}

.pf-cal-companies-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 2px 0;
}

.pf-cal-company-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  max-width: 310px;
}

.pf-cal-company-chip:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.pf-cal-company-chip.chip-portfolio {
  border-color: #bfdbfe;
  background: #f0f7ff;
}

.pf-cal-company-chip.chip-portfolio:hover {
  border-color: #93c5fd;
  background: #e0effe;
}

.pf-cal-chip-logo {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: contain;
  background: #ffffff;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

.pf-cal-chip-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.pf-cal-chip-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.pf-cal-chip-sym {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.pf-cal-chip-comp-name {
  font-size: 10.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 105px;
}

.pf-cal-chip-origin-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.pf-cal-chip-origin-pill.origin-portfolio {
  background: #dbeafe;
  color: #1e40af;
}

.pf-cal-chip-origin-pill.origin-tracking {
  background: #f1f5f9;
  color: #475569;
}

.pf-cal-chip-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  transition: background-color 0.15s, color 0.15s;
}

.pf-cal-chip-edit-btn:hover {
  background: #eff6ff;
  color: #2563eb;
}

.pf-cal-chip-edit-btn.is-custom {
  color: #2563eb;
  background: #eff6ff;
}

.pf-cal-chip-edit-btn.is-custom:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

.pf-cal-chip-custom-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2563eb;
  border: 1px solid #ffffff;
}

.pf-cal-chip-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  padding: 2px;
  flex-shrink: 0;
}

.pf-cal-chip-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.15s, color 0.15s;
}

.pf-cal-chip-delete-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.pf-cal-companies-empty {
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

.pf-cal-companies-empty p {
  margin: 0;
}

/* KPIs de resumen */
.pf-cal-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.pf-cal-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.18s ease;
}

.pf-cal-kpi-card.pf-cal-kpi-interactive {
  cursor: pointer;
  user-select: none;
}

.pf-cal-kpi-card.pf-cal-kpi-interactive:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}

.pf-cal-kpi-card.kpi-dimmed {
  opacity: 0.52;
  background: #f8fafc;
  border-style: dashed;
}

.pf-cal-kpi-card.kpi-dimmed .pf-cal-kpi-icon {
  filter: grayscale(1);
  opacity: 0.6;
}

.pf-cal-kpi-head-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pf-cal-kpi-pill {
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 5.5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pf-cal-kpi-pill.visible {
  background: #dcfce7;
  color: #166534;
}

.pf-cal-kpi-pill.hidden {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.pf-cal-kpi-pill.filter-note {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.pf-cal-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pf-cal-kpi-icon.icon-all {
  background: #f1f5f9;
  color: #475569;
}

.pf-cal-kpi-icon.icon-earnings {
  background: #eff6ff;
  color: #2563eb;
}

.pf-cal-kpi-icon.icon-exdiv {
  background: #fffbeb;
  color: #d97706;
}

.pf-cal-kpi-icon.icon-payout {
  background: #ecfdf5;
  color: #059669;
}

.pf-cal-kpi-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pf-cal-kpi-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.pf-cal-kpi-value {
  font-size: 17px;
  color: #0f172a;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.pf-cal-kpi-sub {
  font-size: 9.5px;
  color: #94a3b8;
  margin-top: 1px;
}

.text-emerald {
  color: #059669 !important;
}

.text-amber {
  color: #d97706 !important;
}

/* Tarjeta principal del calendario */
.pf-cal-card {
  padding: 16px 20px 20px;
}

.pf-cal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.pf-cal-month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-cal-month-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  min-width: 150px;
  text-align: center;
  margin: 0;
}

.pf-cal-year-dim {
  color: #94a3b8;
  font-weight: 500;
  font-size: 14px;
}

.pf-cal-nav-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.pf-cal-today-btn {
  height: 30px;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
}

.pf-cal-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pf-cal-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.pf-cal-filter-btn {
  border: 0;
  background: transparent;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.pf-cal-filter-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.pf-cal-filter-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pf-filter-badge {
  font-size: 9.5px;
  background: #e2e8f0;
  color: #475569;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 600;
}

.pf-cal-filter-btn.active .pf-filter-badge {
  background: #0f172a;
  color: #fff;
}

.pf-filter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.pf-cal-filter-btn.inactive {
  opacity: 0.52;
  color: #94a3b8;
  background: transparent;
  text-decoration: line-through;
  text-decoration-color: #cbd5e1;
}

.pf-cal-filter-btn.inactive .pf-filter-dot {
  filter: grayscale(1);
  opacity: 0.35;
}

.pf-cal-filter-btn.inactive .pf-filter-badge {
  opacity: 0.5;
}

.pf-cal-config-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.pf-cal-config-trigger-btn:hover {
  color: #0f172a;
  background: #f8fafc;
  border-color: #94a3b8;
}

.pf-cal-config-trigger-btn.has-active-filters {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  font-weight: 700;
}

.pf-cal-config-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  display: inline-block;
  box-shadow: 0 0 0 2px #bfdbfe;
}

.dot-earnings { background: #2563eb; }
.dot-exdiv { background: #d97706; }
.dot-payout { background: #059669; }

/* Grid de días del calendario */
.pf-cal-grid-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.pf-cal-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.pf-cal-weekday-header {
  padding: 9px 8px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pf-cal-weekday-header.weekend {
  color: #94a3b8;
}

.pf-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #e2e8f0;
  gap: 1px;
}

.pf-cal-cell {
  min-height: 105px;
  background: #ffffff;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.15s ease;
}

.pf-cal-cell:hover {
  background: #fafafa;
}

.pf-cal-cell.other-month {
  background: #f8fafc;
  opacity: 0.55;
}

.pf-cal-cell.today {
  background: #eff6ff;
}

.pf-cal-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 2px;
}

.pf-cal-cell.today .pf-cal-day-num {
  color: #1d4ed8;
}

.pf-cal-today-badge {
  font-size: 8.5px;
  font-weight: 700;
  background: #2563eb;
  color: #fff;
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: uppercase;
}

.pf-cal-cell-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.pf-cal-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 9.5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.1s ease, filter 0.1s ease;
  border: 1px solid transparent;
}

.pf-cal-chip:hover {
  transform: scale(1.02);
  filter: brightness(0.95);
}

.pf-cal-chip.chip-earnings {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.pf-cal-chip.chip-exdiv {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.pf-cal-chip.chip-payout {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.pf-cal-chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pf-cal-chip-ticker {
  font-weight: 700;
  font-size: 9.5px;
}

.pf-cal-chip-label {
  font-size: 9px;
  opacity: 0.9;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.pf-cal-more-chip {
  font-size: 9.5px;
  font-weight: 600;
  color: #64748b;
  padding: 1px 4px;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
  background: #f1f5f9;
}

.pf-cal-more-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Vista Lista / Agenda */
.pf-cal-list-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pf-cal-day-group {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.pf-cal-day-group.today-group {
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px #bfdbfe;
}

.pf-cal-day-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.pf-cal-day-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.pf-cal-day-group.today-group .pf-cal-day-circle {
  background: #2563eb;
}

.pf-cal-day-heading {
  font-size: 11.5px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.pf-cal-today-pill {
  font-size: 9px;
  font-weight: 700;
  background: #2563eb;
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
}

.pf-cal-day-count {
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 500;
}

.pf-cal-day-items {
  display: flex;
  flex-direction: column;
}

.pf-cal-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  gap: 12px;
  border-bottom: 1px solid #f8fafc;
  transition: background 0.15s ease;
  cursor: pointer;
}

.pf-cal-list-item:last-child {
  border-bottom: 0;
}

.pf-cal-list-item:hover {
  background: #f8fafc;
}

.pf-cal-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pf-cal-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pf-cal-item-name-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pf-cal-item-name-row strong {
  font-size: 11.5px;
  color: #0f172a;
}

.pf-cal-item-ticker {
  font-size: 9.5px;
  color: #64748b;
  font-weight: 600;
}

.pf-cal-item-desc {
  font-size: 10.5px;
  color: #64748b;
}

.pf-cal-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pf-cal-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2.5px 7px;
  border-radius: 6px;
}

.badge-earnings {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-exdiv {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-payout {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.pf-cal-status-pill {
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}

.pf-cal-status-pill.publicado,
.pf-cal-status-pill.cobrado,
.pf-cal-status-pill.ejecutado {
  background: #dcfce7;
  color: #15803d;
}

.pf-cal-status-pill.confirmado {
  background: #dbeafe;
  color: #1e40af;
}

.pf-cal-chip-origin-icon {
  font-size: 8.5px;
  line-height: 1;
  margin-right: 2px;
}

.pf-cal-chip.chip-is-portfolio {
  border-left: 2px solid #2563eb;
}

.pf-cal-chip.chip-is-watchlist {
  border-left: 2px solid #94a3b8;
  opacity: 0.92;
}

.pf-cal-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1.5px 6px;
  border-radius: 4px;
  letter-spacing: 0.01em;
}

.pf-cal-source-badge.portfolio {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.pf-cal-source-badge.watchlist {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.pf-cal-modal-origin-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.pf-cal-modal-origin-pill.portfolio {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.pf-cal-modal-origin-pill.watchlist {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.pf-cal-modal-unheld {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  font-style: italic;
}

.pf-cal-item-btn {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
}

/* Modal de Detalle */
.pf-cal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: pfFadeIn 0.15s ease;
}

.pf-cal-modal {
  background: #fff;
  border-radius: 14px;
  width: min(100%, 460px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  animation: pfFadeIn 0.2s ease;
}

.pf-cal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
}

.pf-cal-modal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pf-cal-modal-brand h4 {
  margin: 0;
  font-size: 12.5px;
  color: #0f172a;
  font-weight: 700;
}

.pf-cal-modal-brand p {
  margin: 2px 0 0;
  font-size: 10.5px;
  color: #64748b;
}

.pf-cal-modal-close {
  background: transparent;
  border: 0;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
}

.pf-cal-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.pf-cal-modal-body {
  padding: 16px 18px;
}

.pf-cal-modal-desc {
  font-size: 11.5px;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 14px;
}

.pf-cal-modal-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #e2e8f0;
}

.pf-cal-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

.pf-cal-modal-row span {
  color: #64748b;
}

.pf-cal-modal-row strong {
  color: #0f172a;
  font-weight: 600;
}

.pf-cal-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}

.pf-cal-empty-state {
  text-align: center;
  padding: 36px 16px;
  color: #64748b;
}

.pf-cal-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.pf-cal-empty-state h4 {
  font-size: 13px;
  color: #0f172a;
  margin: 0 0 4px;
}

.pf-cal-empty-state p {
  font-size: 11.5px;
  margin: 0;
  color: #94a3b8;
}

.pf-cal-grid-empty-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: #64748b;
  margin-top: 12px;
}

.pf-cal-grid-empty-notice .pf-cal-notice-icon {
  font-size: 14px;
}

.pf-cal-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

/* Banner de eventos ocultos */
.pf-cal-hidden-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  animation: pfFadeIn 0.2s ease;
}

.pf-cal-hidden-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
  color: #92400e;
}

.pf-cal-hidden-text strong {
  color: #78350f;
  font-size: 12px;
}

.pf-cal-hidden-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pf-cal-hidden-action {
  background: #d97706;
  color: #ffffff;
  border: 0;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pf-cal-hidden-action:hover {
  background: #b45309;
}

.pf-cal-hidden-action.secondary {
  background: transparent;
  color: #92400e;
  border: 1px solid #d97706;
}

.pf-cal-hidden-action.secondary:hover {
  background: #fef3c7;
}

/* Modal de configuración de visualización */
.pf-cal-config-modal,
.pf-cal-company-edit-modal {
  width: min(100%, 540px);
}

.pf-cal-modal-desc {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 14px 0;
  line-height: 1.45;
}

.pf-cal-modal-desc strong {
  color: #0f172a;
}

.pf-cal-config-modal-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pf-cal-config-section {
  margin-bottom: 16px;
}

.pf-cal-config-section:last-of-type {
  margin-bottom: 12px;
}

.pf-cal-config-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
  margin: 0 0 8px 2px;
}

.pf-cal-config-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 6px;
}

.pf-cal-config-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.pf-cal-config-item input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.pf-cal-config-item-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.pf-cal-config-item-icon.earnings { background: #eff6ff; }
.pf-cal-config-item-icon.exdiv { background: #fffbeb; }
.pf-cal-config-item-icon.payout { background: #ecfdf5; }
.pf-cal-config-item-icon.portfolio { background: #eff6ff; color: #2563eb; }
.pf-cal-config-item-icon.watchlist { background: #f8fafc; color: #64748b; }

.pf-cal-config-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.pf-cal-config-item-info span {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.pf-cal-config-item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-cal-config-item-title-row strong {
  font-size: 12px;
  color: #0f172a;
  font-weight: 600;
}

.pf-cal-config-tag {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.pf-cal-config-tag.earnings { background: #eff6ff; color: #1d4ed8; }
.pf-cal-config-tag.exdiv { background: #fffbeb; color: #b45309; }
.pf-cal-config-tag.payout { background: #ecfdf5; color: #047857; }
.pf-cal-config-tag.portfolio { background: #eff6ff; color: #1e40af; }
.pf-cal-config-tag.watchlist { background: #f1f5f9; color: #475569; }

.pf-cal-config-presets-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 14px;
}

.pf-cal-presets-heading {
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  display: block;
  margin-bottom: 8px;
}

.pf-cal-presets-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pf-cal-preset-pill {
  font-size: 10.5px;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pf-cal-preset-pill:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

@media (max-width: 1000px) {
  .pf-cal-kpis-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .pf-cal-kpis-grid {
    grid-template-columns: 1fr;
  }
  .pf-cal-card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .pf-cal-toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .pf-cal-filters {
    overflow-x: auto;
  }
}

/* ── Análisis de Resultados con IA en el Calendario ─────────── */

.pf-cal-modal-wide {
  width: min(100%, 560px);
}

.pf-cal-ai-callout-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
}

.pf-cal-ai-callout-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #1e3a8a;
  font-weight: 700;
  margin-bottom: 4px;
}

.pf-cal-ai-sparkle {
  font-size: 15px;
}

.pf-cal-ai-callout-box p {
  font-size: 11px;
  color: #475569;
  line-height: 1.45;
  margin: 0 0 12px;
}

.pf-cal-ai-trigger-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pf-cal-btn-trigger-ai {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 11.5px;
  font-weight: 600;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pf-cal-btn-trigger-ai:hover {
  background: #1d4ed8;
}

.pf-cal-btn-edgar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
}

.pf-cal-ai-loading-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
  margin-top: 14px;
  animation: pfFadeIn 0.2s ease;
}

.pf-cal-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: pfSpin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.pf-cal-ai-loading-text strong {
  display: block;
  font-size: 12px;
  color: #0f172a;
  margin-bottom: 2px;
}

.pf-cal-ai-loading-text p {
  font-size: 10.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.35;
}

.pf-cal-ai-error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11.5px;
  margin-top: 12px;
}

/* Caja de Resultados de la IA */
.pf-cal-ai-result-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  animation: pfFadeIn 0.25s ease;
}

.pf-cal-ai-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.pf-cal-ai-chip-pill {
  font-size: 11px;
  font-weight: 700;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: 6px;
}

.pf-cal-ai-sector-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
}

.pf-cal-ai-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pf-cal-ai-kpi {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.pf-cal-ai-kpi-lbl {
  font-size: 9.5px;
  color: #64748b;
  font-weight: 600;
}

.pf-cal-ai-kpi-val {
  font-size: 13.5px;
  color: #0f172a;
  font-weight: 700;
  margin: 2px 0 1px;
}

.pf-cal-ai-kpi-badge {
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  align-self: flex-start;
}

.pf-cal-ai-kpi-badge.positive {
  background: #dcfce7;
  color: #15803d;
}

.pf-cal-ai-kpi-badge.negative {
  background: #fee2e2;
  color: #b91c1c;
}

.pf-cal-ai-kpi-sub {
  font-size: 8.5px;
  color: #94a3b8;
}

.pf-cal-ai-highlights {
  background: #fcfcfc;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 12px;
  border: 1px solid #f1f5f9;
}

.pf-cal-ai-highlights h6 {
  margin: 0 0 6px;
  font-size: 10.5px;
  color: #334155;
  font-weight: 700;
}

.pf-cal-ai-highlights ul {
  margin: 0;
  padding-left: 18px;
  font-size: 10.5px;
  color: #475569;
  line-height: 1.4;
}

.pf-cal-ai-btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.pf-cal-btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #15803d;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.pf-cal-btn-pdf:hover {
  background: #166534;
}

.pf-cal-btn-analyzer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.pf-cal-btn-analyzer:hover {
  background: #e2e8f0;
  color: #000;
}

@media (max-width: 600px) {
  .pf-cal-ai-kpis-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Modal de Ajustes y Preferencias ────────────────────────── */

.settings-modal {
  width: min(540px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
}

.settings-modal-header {
  margin-bottom: 20px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-group-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.settings-group-icon {
  font-size: 18px;
  line-height: 1.2;
}

.settings-group-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.settings-group-desc {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: #64748b;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
}

.settings-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.settings-checkbox-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-check-custom {
  width: 17px;
  height: 17px;
  border: 1.5px solid #94a3b8;
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.15s ease;
}

.settings-checkbox-row input:checked + .settings-check-custom {
  background: #2563eb;
  border-color: #2563eb;
}

.settings-checkbox-row input:checked + .settings-check-custom::after {
  content: "✓";
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.settings-check-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.settings-check-copy strong {
  font-size: 12.5px;
  color: #1e293b;
  font-weight: 600;
}

.settings-check-copy small {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

.settings-subs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 4px 28px;
  border-left: 2px solid #cbd5e1;
  margin-left: 8px;
  margin-top: 2px;
  transition: opacity 0.2s ease;
}

.settings-subs.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.settings-subs-title {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 2px;
}

.settings-sub-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: #334155;
  padding: 2px 0;
}

.settings-sub-checkbox-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-check-custom.small {
  width: 14px;
  height: 14px;
  border-radius: 3.5px;
  margin-top: 0;
}

.settings-sub-checkbox-row input:checked + .settings-check-custom.small {
  background: #059669;
  border-color: #059669;
}

.settings-sub-checkbox-row input:checked + .settings-check-custom.small::after {
  content: "✓";
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
}

.settings-locked-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.settings-check-custom.locked {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: not-allowed;
}

.settings-locked-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
}

.settings-note {
  font-size: 11.5px;
  line-height: 1.45;
  color: #475569;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.settings-save-btn {
  padding: 9px 20px;
  font-size: 13px;
}

/* ── Alertas de Precio (Pestaña Independiente) ─────────────── */

.price-alerts-page-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.pa-dashboard-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pa-company-panel {
  padding: 24px !important;
  background: #ffffff !important;
}

.pa-company-title-row {
  margin-bottom: 20px;
}

.pa-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.pa-form-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 12px;
}

.pa-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.pa-ticker-wrap {
  position: relative;
  width: 100%;
}

.pa-ticker-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  max-height: 240px;
  overflow-y: auto;
}

.pa-ticker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.pa-ticker-option:hover {
  background: #f0fdf4;
}

.pa-ticker-option:last-child {
  border-bottom: 0;
}

.pa-option-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.pa-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
}

.pa-option-ticker {
  color: #15803d;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.pa-ticker-empty {
  padding: 12px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

.pa-ref-divider {
  color: #94a3b8;
  margin: 0 4px;
}

.pa-field label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pa-field input,
.pa-field select {
  height: 40px;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px;
  padding: 0 12px;
  color: #0f172a !important;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.pa-field input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.pa-field input:focus,
.pa-field select:focus {
  border-color: #16a34a !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.pa-ref-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 12.5px;
  color: #166534;
}

.pa-ref-label {
  color: #15803d;
  font-weight: 600;
}

.pa-ref-price {
  color: #166534;
  font-size: 14px;
  font-weight: 800;
}

.pa-ref-company {
  color: #4b5563;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.pa-form-error {
  margin: 0;
  font-size: 12px;
  color: #ef4444;
  font-weight: 600;
  margin-right: auto;
}

.pa-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #16a34a;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pa-submit-btn:hover {
  background: #15803d;
}

.pa-list-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 180px;
}

.pa-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.pa-list-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.pa-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.pa-tab {
  background: transparent;
  border: 0;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pa-tab:hover {
  color: #0f172a;
}

.pa-tab.active {
  background: #ffffff;
  color: #16a34a;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pa-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.pa-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

.pa-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  transition: all 0.15s ease;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.pa-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.pa-item.pending {
  border-left: 4px solid #2563eb;
}

.pa-item.triggered {
  border-left: 4px solid #16a34a;
  background: #f9fafb;
}

.pa-item-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.pa-item-ticker-wrap {
  display: flex;
  flex-direction: column;
  min-width: 100px;
}

.pa-item-ticker {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
  text-decoration: none;
}

.pa-item-ticker:hover {
  color: #2563eb;
  text-decoration: underline;
}

.pa-item-company {
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.pa-item-cond {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.pa-cond-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.pa-cond-pill.gte {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.pa-cond-pill.lte {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.pa-current-wrap {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #64748b;
}

.pa-current-wrap strong {
  color: #0f172a;
}

.pa-item-diff {
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
}

.pa-item-aside {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pa-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.pa-status-badge.pending {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.pa-status-badge.triggered {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.pa-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pa-delete-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

@media (max-width: 600px) {
  .pa-form-grid {
    grid-template-columns: 1fr;
  }
  .pa-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .pa-item-aside {
    width: 100%;
    justify-content: space-between;
  }
}

/* ── Pestaña Valoración ──────────────────────────────────────── */

.val-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.val-hero-panel {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.val-hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.val-hero-heading h2 {
  margin: 4px 0 2px;
  font-size: 20px;
  color: #1e293b;
}

.val-hero-heading .section-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.val-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.val-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
}

.val-badge-label {
  color: #94a3b8;
  font-size: 11px;
}

.val-badge-item strong {
  color: #0f172a;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.val-summary-block {
  padding: 14px 0 4px;
}

.val-chart-block {
  position: relative;
  margin-top: 12px;
  padding: 14px 16px 12px;
}

.val-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.val-chart-head-left h5 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #333;
  font-size: 14px;
}

.val-chart-head-left .metrics-chart-hint {
  display: block;
  margin-top: 2px;
}

.val-chart-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.val-chart-metrics {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fafafa;
}

.val-chart-metrics button {
  min-height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #666;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.val-chart-metrics button.active {
  background: var(--accent);
  color: #fff;
}

.val-chart-metrics button:not(.active):hover {
  background: #e0e7ff;
  color: #4338ca;
}

.val-chart-ranges {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fafafa;
}

.val-chart-ranges button {
  min-width: 30px;
  min-height: 24px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #666;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.val-chart-ranges button.active {
  background: #333;
  color: #fff;
}

.val-chart-ranges button:not(.active):hover {
  background: #e9e9e9;
  color: #333;
}

.val-chart-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.val-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #334155;
}

.val-stat-label {
  color: #64748b;
  font-size: 11.5px;
  font-weight: 500;
}

.val-stat-pill strong {
  color: #0f172a;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.val-chart-body {
  position: relative;
  min-height: 380px;
  background: #ffffff;
  border-radius: 4px;
}

#val-chart {
  display: block;
  width: 100%;
  height: 380px;
}

.val-bar-rect {
  transition: opacity 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

.val-bar-group:hover .val-bar-rect {
  opacity: 1;
  filter: brightness(1.1);
}

.val-adjust-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding: 3px 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.val-adjust-checkbox-label:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.val-adjust-checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
  width: 13px;
  height: 13px;
  margin: 0;
}

.val-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.val-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.val-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.val-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.val-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.val-card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #1e293b;
}

.val-card-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.val-tag-dashed {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #64748b;
}

.val-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.val-metric-display {
  margin-bottom: 10px;
}

.val-main-val {
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  color: #0f172a;
  line-height: 1.1;
  display: inline-block;
}

.val-placeholder-empty {
  color: #94a3b8;
  font-size: 26px;
}

.val-breakdown-pills {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 9px;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 5px;
  margin-bottom: 10px;
}

.val-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.val-pill-label {
  color: #64748b;
}

.val-pill-val {
  color: #1e293b;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.val-card-desc {
  margin: auto 0 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

.val-card-placeholder {
  background: #fafbfc;
  border: 1.5px dashed #cbd5e1;
}

.val-card-placeholder:hover {
  border-color: var(--accent);
  background: #f8faff;
}

.val-placeholder-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 5px;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 500;
  margin-bottom: 10px;
}

.val-placeholder-box svg {
  color: var(--accent);
  flex-shrink: 0;
}

.val-breakdown-table-panel {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.val-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.val-table-header h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.val-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid #e2e8f0;
  color: #64748b;
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f8fafc;
}

.val-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.val-table .val-num {
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #0f172a;
  white-space: nowrap;
}

.val-table .val-row-highlight td {
  background: #f5f7ff;
  color: #0f172a;
  font-weight: 600;
}

.val-table .val-row-highlight .val-num {
  color: var(--accent-dark);
  font-size: 12.5px;
}

.val-col-calc {
  color: #64748b;
  font-size: 11.5px;
}

.val-detail-txt {
  color: #64748b;
  font-size: 11px;
}

@media (max-width: 1024px) {
  .val-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .val-grid {
    grid-template-columns: 1fr;
  }
  .val-hero-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Accionariado ────────────────────────────────────────────── */
.accionariado-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px;
}
.accionariado-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.accionariado-title-group h2 {
  margin: 4px 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.accionariado-notice {
  margin: 2px 0 0;
  padding: 10px 14px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 11.5px;
  line-height: 1.5;
}
.accionariado-notice em {
  font-style: italic;
}
.accionariado-notice strong {
  color: var(--ink);
}
.accionariado-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 2px;
}
.accionariado-kpi-card {
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfbfc;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.accionariado-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}
.accionariado-kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  font-family: monospace;
}
.accionariado-kpi-sub {
  font-size: 11px;
  color: var(--muted);
}
.accionariado-tabs {
  margin-top: 6px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
}
.accionariado-table {
  width: 100%;
  border-collapse: collapse;
}
.accionariado-table th {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.accionariado-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.accionariado-table tbody tr:hover {
  background: #f8fafc;
}
.accionariado-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
}

/* ── Foro de Empresa ─────────────────────────────────────────── */
.forum-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 24px;
}

.forum-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.forum-title-group h2 {
  margin: 4px 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}

.forum-composer-wrap {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.forum-login-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 4px;
}

.forum-login-prompt-copy {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
}

.forum-login-prompt-copy svg {
  color: var(--accent);
  flex-shrink: 0;
}

.forum-login-prompt-copy strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.forum-login-prompt-copy p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.forum-login-prompt-btn {
  min-height: 36px;
}

.forum-composer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.forum-avatar-mini {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.forum-textarea-wrap textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  resize: vertical;
  min-height: 70px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.forum-textarea-wrap textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, .2);
}

.forum-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.forum-form-error {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  margin-right: auto;
}

.forum-submit-btn {
  min-width: 140px;
  min-height: 35px;
  font-size: 12px;
}

.forum-messages-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.forum-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  background: #fdfdfd;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.forum-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.forum-empty strong {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
}

.forum-empty p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.forum-messages-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.forum-thread-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forum-thread-card:hover {
  border-color: #ccd0d5;
}

.forum-message-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.forum-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #2b2f36;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.forum-avatar.small {
  width: 26px;
  height: 26px;
  font-size: 10px;
  background: #475569;
}

.forum-message-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.forum-author-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-date {
  font-size: 11px;
  color: var(--muted);
}

.forum-delete-btn {
  margin-left: auto;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  border-radius: 4px;
  color: var(--soft-muted);
  cursor: pointer;
  transition: color .15s, background .15s;
}

.forum-delete-btn:hover {
  color: var(--red);
  background: #fee2e2;
}

.forum-message-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: #24292f;
  word-break: break-word;
}

.forum-message-body p {
  margin: 0;
}

.forum-message-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
}

.forum-reply-btn {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.forum-reply-btn:hover {
  background: #f1f3f5;
  color: var(--accent-dark);
}

.forum-replies-badge {
  font-size: 11px;
  color: var(--soft-muted);
  font-weight: 600;
}

.forum-reply-form-wrap {
  margin-top: 10px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

.forum-reply-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forum-reply-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.forum-reply-submit-btn {
  min-width: 100px;
  min-height: 30px;
  font-size: 11.5px;
  padding: 0 12px;
}

.forum-cancel-reply-btn {
  font-size: 11.5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.forum-cancel-reply-btn:hover {
  color: var(--ink);
}

.forum-replies-container {
  display: flex;
  flex-direction: column;
}

.forum-replies-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding-left: 16px;
  border-left: 2px solid #e2e8f0;
}

.forum-reply-card {
  background: #fbfcfd;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forum-reply-card:hover {
  border-color: #cbd5e1;
}

/* ── Sección Novedades y Versiones ──────────────────────────── */
.novedades-page-section {
  padding-top: 14px;
}

.novedades-container {
  max-width: 980px;
  margin: 0;
}

.novedades-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.novedades-toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.novedades-count {
  font-size: 13px;
  color: var(--muted);
}

.novedades-count strong {
  color: var(--ink);
  font-weight: 700;
}

.novedades-view-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.novedades-action-btn {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
  cursor: pointer;
}

.novedades-action-btn:hover {
  text-decoration: underline;
}

.novedades-dot {
  color: #cbd5e1;
  font-size: 12px;
}

.novedades-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.novedades-search-box svg {
  color: var(--muted);
  flex-shrink: 0;
}

.novedades-search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  width: 220px;
  color: var(--ink);
}

.novedades-search-box input::placeholder {
  color: var(--soft-muted);
}

.novedades-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.novedad-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.novedad-card:hover {
  border-color: #cbd5e1;
}

.novedad-card.is-open {
  border-color: #fbd38d;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.07);
}

.novedad-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  background: #fff;
  transition: background-color 0.12s ease;
  outline: none;
}

.novedad-card-head:hover,
.novedad-card-head:focus-visible {
  background: #fbfbfb;
}

.novedad-card.is-open .novedad-card-head {
  border-bottom: 1px solid #f1f5f9;
}

.novedad-head-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.novedad-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.novedad-version-tag {
  display: inline-block;
  padding: 2px 7px;
  background: #1e293b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.novedad-status-badge.latest {
  display: inline-block;
  padding: 2px 8px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
}

.novedad-date {
  font-size: 12px;
  color: var(--muted);
}

.novedad-title {
  margin: 2px 0 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.15s ease;
  line-height: 1.35;
}

.novedad-card-head:hover .novedad-title {
  color: var(--accent-dark);
}

.novedad-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 14px;
}

.novedad-toggle-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
}

.novedad-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  transition: transform 0.2s ease, background 0.15s ease, color 0.15s ease;
}

.novedad-card.is-open .novedad-chevron {
  transform: rotate(180deg);
  background: #e0e7ff;
  color: var(--accent-dark);
}

.novedad-card-body {
  padding: 16px 18px 20px 18px;
  background: #fdfdfd;
}

.novedad-body-content {
  display: flex;
  flex-direction: column;
}

.novedad-subheading {
  margin: 0 0 6px 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.novedad-explicacion {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: #334155;
}

.novedad-cambios-wrap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}

.novedad-cambios-title {
  margin: 0 0 8px 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.novedad-cambios-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.novedad-cambio-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  line-height: 1.45;
  color: #1e293b;
}

.novedad-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 2px;
}

.novedad-tag.tag-nuevo {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.novedad-tag.tag-mejora {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.novedad-tag.tag-correccion {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.novedades-empty {
  padding: 36px 20px;
  text-align: center;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.novedades-empty svg {
  margin-bottom: 10px;
  color: #94a3b8;
}

.novedades-empty p {
  margin: 0 0 14px 0;
  font-size: 13.5px;
}

.novedades-footer-note {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: #312e81;
}

.novedades-note-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.novedades-footer-note p {
  margin: 0;
  line-height: 1.5;
}

.novedades-footer-note code {
  background: #e0e7ff;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11.5px;
  color: #3730a3;
}

@media (max-width: 640px) {
  .novedades-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .novedades-search-box {
    width: 100%;
  }
  .novedades-search-box input {
    width: 100%;
  }
  .novedad-toggle-hint {
    display: none;
  }
}

/* ── Botón y Modal de Donaciones ───────────────────────────── */
.sidebar-donations-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #c7d2fe;
  border-radius: 7px;
  background: #f8faff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  text-align: left;
  box-sizing: border-box;
}

.sidebar-donations-btn:hover {
  background: #e0e7ff;
  border-color: #818cf8;
  color: #312e81;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(67, 56, 202, 0.12);
}

.donations-btn-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.donations-btn-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.donations-btn-badge {
  padding: 1px 6px;
  border-radius: 4px;
  background: #e0e7ff;
  border: 1px solid #a5b4fc;
  color: #4338ca;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.donations-modal {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 26px 20px;
}

.donations-modal-header {
  text-align: center;
  margin-bottom: 18px;
}

.donations-header-badge {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  margin-bottom: 10px;
}

.donations-heart-big {
  font-size: 24px;
  line-height: 1;
}

.donations-modal-header h3 {
  margin: 0 0 6px 0;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.donations-modal-header p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.donations-amount-section {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.donations-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.donations-amount-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.donation-amount-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.donation-amount-pill small {
  font-size: 9.5px;
  font-weight: 400;
  color: var(--soft-muted);
  margin-top: 2px;
}

.donation-amount-pill:hover {
  border-color: #fbd38d;
  background: #f8faff;
}

.donation-amount-pill.active {
  border-color: var(--accent);
  background: #eef2ff;
  color: var(--accent-dark);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.donation-amount-pill.active small {
  color: var(--accent-dark);
  font-weight: 600;
}

.donations-custom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.donations-custom-label {
  font-size: 12px;
  color: var(--muted);
}

.donations-custom-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 105px;
}

.donations-custom-input-wrap input {
  width: 100%;
  height: 32px;
  padding: 0 22px 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  box-sizing: border-box;
}

.donations-custom-input-wrap input:focus {
  border-color: var(--accent);
  outline: none;
}

.donations-custom-input-wrap .currency-symbol {
  position: absolute;
  right: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

.donations-methods-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.donations-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.donation-method-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.donation-method-btn.method-bmac {
  background: #ffdd00;
  color: #1a1a1a;
  border-color: #e6c700;
}

.donation-method-btn.method-bmac:hover {
  background: #ffe326;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(255, 221, 0, 0.35);
}

.donation-method-btn.method-paypal {
  background: #0070ba;
  color: #fff;
  border-color: #005ea6;
}

.donation-method-btn.method-paypal:hover {
  background: #0079c8;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 112, 186, 0.35);
}

.donation-method-btn.method-kofi {
  background: #ff5e5b;
  color: #fff;
  border-color: #f24b48;
}

.donation-method-btn.method-kofi:hover {
  background: #ff6f6c;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(255, 94, 91, 0.35);
}

.donation-method-btn .method-icon {
  font-size: 18px;
  line-height: 1;
}

.donation-method-btn .method-icon-svg {
  flex-shrink: 0;
}

.donation-method-btn .method-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.donation-method-btn .method-info strong {
  font-size: 13.5px;
  line-height: 1.2;
}

.donation-method-btn .method-info small {
  font-size: 10.5px;
  opacity: 0.88;
  margin-top: 1px;
}

.donation-method-btn .method-arrow {
  font-size: 16px;
  font-weight: 700;
}

.donation-card-box {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.donation-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.donation-box-badge {
  padding: 1px 6px;
  background: #0099ff;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  border-radius: 3px;
  text-transform: uppercase;
}

.donation-box-header strong {
  font-size: 12.5px;
  color: var(--ink);
}

.donation-copy-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  background: var(--surface-soft);
  border-radius: 6px;
  border: 1px dashed var(--line);
}

.donation-copy-value {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.compact-btn {
  min-height: 26px;
  padding: 0 10px;
  font-size: 11px;
}

.donation-box-hint {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}

.donation-crypto-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.donation-crypto-summary {
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  list-style: none;
}

.donation-crypto-summary::-webkit-details-marker {
  display: none;
}

.donation-crypto-details[open] .crypto-chevron {
  transform: rotate(180deg);
}

.crypto-chevron {
  transition: transform 0.2s ease;
  color: var(--muted);
}

.donation-crypto-body {
  padding: 10px 12px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crypto-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

.crypto-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.crypto-info strong {
  font-size: 11.5px;
  color: var(--ink);
}

.crypto-info code {
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donations-settings-accordion {
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.donations-settings-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 0;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}

.donations-settings-toggle:hover {
  color: var(--accent-dark);
}

.donations-settings-panel {
  margin-top: 8px;
  padding: 12px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
}

.cfg-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-field.compact {
  margin-bottom: 6px;
}

.auth-field.compact > span {
  font-size: 10px;
  margin-bottom: 3px;
}

.auth-field.compact input {
  height: 32px;
  font-size: 12px;
  padding: 0 8px;
}

.donations-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

/* ── Botón Sidebar Reportes ────────────────────────────────── */
.sidebar-report-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  text-align: left;
  box-sizing: border-box;
}

.sidebar-report-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.report-btn-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.report-btn-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.report-btn-badge {
  padding: 1px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Zona de capturas de pantalla / Dropzone para reportes ── */
.report-attach-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-attach-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.report-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 6px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  outline: none;
}

.report-dropzone:hover,
.report-dropzone:focus-visible,
.report-dropzone.is-dragover {
  border-color: var(--accent);
  background: #f8faff;
}

.report-dropzone-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  pointer-events: none;
}

.report-dropzone-content svg {
  color: var(--accent);
  flex-shrink: 0;
}

.report-dropzone-content strong {
  color: var(--ink);
}

.report-previews-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.report-thumb-item {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background: #000;
}

.report-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.report-thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.report-thumb-del:hover {
  background: #dc2626;
}

/* ==========================================================================
   ADMINISTRACIÓN Y PANTALLA DE REPORTES
   - Badges de admin y botones de regeneración de análisis
   - Parte 1: Supervisión de Informes IA por Empresa y Resultados
   - Parte 2: Tabla y Gestión de Reportes Generales
   ========================================================================== */

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: auto;
  box-shadow: 0 1px 3px rgba(124, 58, 237, 0.35);
}

.account-plan-admin {
  color: #9333ea !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em;
}

.filing-action-regenerate {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
  font-weight: 700 !important;
  transition: all 0.15s ease;
}

.filing-action-regenerate:hover {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
  color: #b91c1c !important;
  transform: translateY(-1px);
}

.admin-regen-report-btn {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.admin-regen-report-btn:hover {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #7f1d1d !important;
  transform: translateY(-1px);
}

/* ── Contenedor General de la Pantalla de Reportes ─────────────────── */
.reportes-page-section {
  padding: 24px 32px 64px;
}

.reports-page-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Encabezado y Navegación de Pestañas ────────────────────────────── */
.reports-header-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.reports-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reports-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.reports-main-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.reports-admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fdf4ff;
  border: 1px solid #f0abfc;
  color: #86198f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.reports-subtitle {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  max-width: 860px;
}

.reports-tabs-nav {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.reports-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reports-nav-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.reports-nav-btn.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.2);
}

.reports-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.reports-nav-btn.active .reports-tab-badge {
  background: #f87171;
  color: #7f1d1d;
}

/* ── KPI Stats Grid ────────────────────────────────────────────────── */
.reports-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.reports-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-icon-blue { background: #eff6ff; color: #2563eb; }
.stat-icon-amber { background: #fffbeb; color: #d97706; }
.stat-icon-red { background: #fef2f2; color: #dc2626; }
.stat-icon-green { background: #f0fdf4; color: #16a34a; }

.stat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-val {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Barras de Herramientas y Filtros ───────────────────────────────── */
.reports-tab-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reports-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.reports-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 240px;
}

.reports-search-wrap svg {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  pointer-events: none;
}

.reports-search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  outline: none;
  background: #f8fafc;
  color: #0f172a;
  transition: all 0.15s ease;
}

.reports-search-input:focus {
  background: #fff;
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.reports-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.report-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.report-chip:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.report-chip.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.reports-filters-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reports-select {
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

.reports-select:focus {
  border-color: #0f172a;
  background: #fff;
}

/* ── PARTE 1: Tarjetas de Empresas y Resultados de IA ─────────────── */
.company-reports-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.company-reports-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease;
}

.company-reports-card.card-has-errors {
  border-color: #fca5a5;
  box-shadow: 0 0 0 1px #fecaca;
}

.company-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  gap: 16px;
  flex-wrap: wrap;
}

.company-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.company-card-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #0f172a;
  color: #4f46e5;
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.company-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.company-card-name {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.company-card-ticker {
  background: #e2e8f0;
  color: #334155;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.company-card-sub {
  font-size: 12px;
  color: #64748b;
  display: block;
  margin-top: 2px;
}

.company-error-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
}

.company-ok-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
}

/* Lista de Resultados de la Empresa */
.company-results-container {
  display: flex;
  flex-direction: column;
}

.company-result-item {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s ease;
}

.company-result-item:last-child {
  border-bottom: 0;
}

.company-result-item:hover {
  background: #fafafa;
}

.result-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.result-item-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.result-item-period {
  font-size: 14px;
  color: #0f172a;
  font-weight: 700;
}

.result-item-accession {
  font-size: 11px;
  color: #94a3b8;
  font-family: monospace;
}

.result-item-date,
.result-item-model {
  font-size: 12px;
  color: #64748b;
}

.result-item-feedback-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}

.res-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
}

.res-rating-pill .star {
  color: #f59e0b;
}

.res-rating-pill.pill-muted {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
}

.res-error-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.res-error-pill.pill-warning {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
}

.res-error-pill.pill-ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
}

.result-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-regen {
  background: #b91c1c !important;
  color: #fff !important;
  border-color: #991b1b !important;
  font-weight: 700 !important;
}

.btn-regen:hover {
  background: #991b1b !important;
}

/* Incidencias reportadas por usuarios en análisis */
.res-error-reports-wrap {
  margin-top: 14px;
  padding: 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
}

.res-error-reports-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 10px;
}

.res-errors-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.res-error-card {
  background: #fff;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 12px 14px;
}

.res-error-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.res-error-category {
  font-weight: 700;
  color: #b91c1c;
  background: #fee2e2;
  padding: 1px 6px;
  border-radius: 4px;
}

.res-error-date,
.res-error-user {
  color: #64748b;
}

.res-error-desc {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.45;
  margin-bottom: 10px;
}

.res-error-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.res-error-status-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.res-error-status-select,
.general-status-select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
}

.res-error-notes-input,
.general-notes-input {
  flex: 1;
  min-width: 160px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  outline: none;
}

.res-error-notes-input:focus,
.general-notes-input:focus {
  border-color: #0f172a;
}

/* ── PARTE 2: Tabla de Reportes Generales ──────────────────────────── */
.reports-table-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.reports-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.reports-data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reports-data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.reports-data-table tr:last-child td {
  border-bottom: 0;
}

.reports-data-table tr:hover td {
  background: #f8fafc;
}

.col-id {
  font-weight: 700;
  color: #64748b;
  width: 50px;
}

.col-date {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

.col-category {
  white-space: nowrap;
}

.category-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}

.category-tag.tag-bug { background: #fee2e2; color: #b91c1c; }
.category-tag.tag-screener { background: #fef3c7; color: #92400e; }
.category-tag.tag-market_data { background: #dbeafe; color: #1e40af; }
.category-tag.tag-portfolio { background: #ede9fe; color: #5b21b6; }
.category-tag.tag-suggestion { background: #dcfce7; color: #166534; }

.col-details {
  max-width: 380px;
}

.general-report-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.general-report-desc {
  margin: 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
  white-space: pre-wrap;
}

.report-images-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.report-img-thumb-link {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background: #000;
}

.report-img-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.15s ease;
}

.report-img-thumb:hover {
  transform: scale(1.1);
}

.col-user {
  font-size: 12px;
  color: #475569;
  white-space: nowrap;
}

.status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.status-badge.status-pending { background: #fef2f2; color: #dc2626; }
.status-badge.status-reviewed { background: #fef3c7; color: #b45309; }
.status-badge.status-resolved { background: #f0fdf4; color: #16a34a; }
.status-badge.status-dismissed { background: #f1f5f9; color: #64748b; }

.report-notes-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reports-table-empty,
.reports-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #64748b;
  background: #fff;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
}

.reports-empty-state h3 {
  margin: 12px 0 6px;
  color: #0f172a;
}

/* ── Acceso no autorizado a reportes ───────────────────────────────── */
.reports-unauthorized-card {
  max-width: 480px;
  margin: 60px auto;
  text-align: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 36px 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.unauthorized-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.reports-unauthorized-card h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.reports-unauthorized-card p {
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ── Estilos de Análisis Anual 10-K (Conclusión, Extractos SEC y Calificación) ── */
.annual-conclusion-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.annual-conclusion-header {
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.annual-conclusion-header h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
}

.annual-conclusion-subtitle {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.annual-deepdive-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.annual-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.annual-card-text {
  margin: 0 0 10px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #374151;
}

.annual-metric-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.annual-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 10.5px;
  color: #334155;
}

.annual-badge strong {
  color: #0f172a;
}

.annual-badge.badge-accent {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

/* Gráfico de evolución del número de acciones */
.shares-chart {
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.sc-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.sc-svg {
  width: 100%;
  height: auto;
  display: block;
}

.annual-calc-box {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f8fafc;
  border-radius: 0 6px 6px 0;
  font-size: 11px;
  color: #334155;
  line-height: 1.5;
}

.annual-calc-box strong {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

.annual-calc-box p {
  margin: 2px 0;
}

.annual-calc-box .calc-impact {
  margin-top: 6px;
  color: #b45309;
  font-weight: 600;
}

/* Extractos visuales SEC */
.sec-extract-card {
  margin: 10px 0 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.sec-extract-head {
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sec-extract-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  background: #475569;
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.sec-extract-title {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
}

.sec-extract-summary {
  margin-left: auto;
  font-size: 10px;
  color: #64748b;
  font-style: italic;
}

.sec-table-wrap {
  overflow-x: auto;
}

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

.sec-table th {
  padding: 6px 10px;
  text-align: left;
  background: #1e293b;
  color: #f8fafc;
  font-weight: 700;
  border-bottom: 1px solid #334155;
  white-space: nowrap;
}

.sec-table td {
  padding: 5px 10px;
  color: #1e293b;
  border-top: 1px solid #f1f5f9;
  border-right: 1px solid #f8fafc;
}

.sec-table tbody tr:nth-child(odd) {
  background: #f8fafc;
}

.sec-table tbody tr:hover {
  background: #f1f5f9;
}

.sec-highlight-yellow {
  background: #fef08a !important;
  color: #854d0e !important;
  font-weight: 700 !important;
}

.sec-highlight-orange {
  background: #c7d2fe !important;
  color: #4338ca !important;
  font-weight: 700 !important;
}

.sec-highlight-soft {
  background: #e2e8f0 !important;
  color: #1e293b !important;
  font-weight: 600 !important;
}

.sec-table th.sec-th-num {
  text-align: right;
}

.sec-table td.sec-col-metric {
  font-weight: 600;
  color: #0f172a;
  text-align: left;
}

.sec-table td.sec-col-prev {
  font-weight: 600;
  color: #475569;
  background-color: #f8fafc;
  text-align: right;
  white-space: nowrap;
}

.sec-table td.sec-col-guidance {
  font-weight: 700;
  color: #1e293b;
  text-align: right;
  white-space: nowrap;
}

.sec-table td.sec-col-proj {
  font-weight: 700;
  color: #0d9488 !important;
  background-color: #f0fdfa !important;
  text-align: right;
  white-space: nowrap;
}

.sec-table td.sec-col-num {
  font-weight: 600;
  text-align: right;
}

/* Watchlist */
.watchlist-card {
  border-left: 3px solid #16a34a;
}

.watchlist-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}

.watchlist-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 11px;
  line-height: 1.5;
  color: #374151;
}

.watchlist-check {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

/* Nota de Resultados (Rating) */
.annual-rating-card {
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
}

.annual-rating-card.score-high {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid #22c55e;
}

.annual-rating-card.score-mid {
  background: linear-gradient(135deg, #fefce8 0%, #fef08a 100%);
  border: 2px solid #eab308;
}

.annual-rating-card.score-low {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 2px solid #ef4444;
}

.annual-rating-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.annual-rating-badge {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #0f172a;
}

.annual-rating-score {
  font-size: 26px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

.annual-rating-score small {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
}

.annual-rating-rationale {
  margin: 6px 0;
  font-size: 12px;
  line-height: 1.55;
  color: #1e293b;
  font-weight: 500;
}

.annual-rating-disclaimer {
  margin: 6px 0 0;
  font-size: 10px;
  color: #64748b;
  font-style: italic;
}

