/* ═══════════════════════════════════════════════════════════════════
   ALPHA FINANCE SCREENER  —  market-map/screener/screener.css
   Usa la base de marketMap.css (layout, switch, hero, barra de índices).
   Aquí: la búsqueda con IA, los filtros y la tabla de resultados.
   ═══════════════════════════════════════════════════════════════════ */

.sc-page { gap: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Hero: búsqueda con IA ─────────────────────────────────────── */
.sc-meta { margin: 12px 0 0; font: 500 13.5px/1.5 'Inter', sans-serif; color: #6b7b80; }
.sc-meta b { color: #16242a; font-weight: 700; }
.sc-ask {
  display: flex; align-items: center; gap: 8px; width: min(720px, 100%); margin: 20px auto 0;
  background: #fff; border: 1.5px solid rgba(84, 140, 146, 0.35); border-radius: 16px; padding: 6px 6px 6px 14px;
  box-shadow: 0 10px 28px rgba(22, 36, 42, 0.07);
}
.sc-ask:focus-within { border-color: #548C92; box-shadow: 0 10px 28px rgba(84, 140, 146, 0.18); }
.sc-ask__icon { color: #5B4BC4; font-size: 15px; }
.sc-ask input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 500 15px 'Inter', sans-serif; color: #16242a; padding: 10px 4px; }
.sc-ask input::placeholder { color: rgba(22, 36, 42, 0.42); }
.sc-ask__btn {
  flex-shrink: 0; border: 0; cursor: pointer; border-radius: 11px; padding: 11px 16px;
  background: #285260; color: #fff; font: 700 14px 'Inter', sans-serif;
}
.sc-ask__btn:hover { background: #1f4350; }
.sc-ask__btn:disabled { opacity: .6; cursor: progress; }
.sc-ask__msg { min-height: 20px; margin: 10px auto 0; max-width: 720px; font: 500 13.5px/1.5 'Inter', sans-serif; color: #3d4b50; }
.sc-ask__msg.is-error { color: #c0392b; }
.sc-ask__msg i { color: #5B4BC4; margin-right: 6px; }

.sc-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.sc-preset {
  border: 1px solid rgba(22, 36, 42, 0.10); background: #fff; color: #285260; cursor: pointer;
  font: 700 12.5px 'Inter', sans-serif; padding: 8px 12px; border-radius: 999px;
}
.sc-preset:hover { background: rgba(84, 140, 146, 0.08); }
.sc-preset.is-on { background: #285260; border-color: #285260; color: #fff; }

/* ── Panel de filtros ──────────────────────────────────────────── */
.sc-panel {
  display: flex; flex-direction: column; gap: 12px;
  background: #fff; border: 1px solid rgba(22, 36, 42, 0.09); border-radius: 18px; padding: 14px 16px;
}
.sc-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-filters:empty::before { content: 'No filters yet: showing every company. Ask the AI, pick a ready-made screen or add a filter.'; font: 500 13.5px 'Inter', sans-serif; color: rgba(22, 36, 42, 0.5); }
.sc-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; border-radius: 999px;
  background: rgba(84, 140, 146, 0.12); color: #16242a; font: 600 13px 'Inter', sans-serif;
}
.sc-chip b { font-weight: 800; color: #285260; }
.sc-chip button { border: 0; background: rgba(22, 36, 42, 0.08); color: #16242a; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 11px; display: grid; place-items: center; }
.sc-chip button:hover { background: rgba(22, 36, 42, 0.16); }

.sc-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: #f6f9f9; }
.sc-add[hidden] { display: none; }
.sc-add select, .sc-sector {
  font: 600 13.5px 'Inter', sans-serif; color: #16242a; border: 1px solid rgba(22, 36, 42, 0.14); background: #fff;
  border-radius: 10px; padding: 8px 10px; max-width: 100%;
}
.sc-add__val { display: inline-flex; align-items: center; gap: 4px; border: 1px solid rgba(22, 36, 42, 0.14); background: #fff; border-radius: 10px; padding: 0 10px 0 4px; }
.sc-add__val input { width: 90px; border: 0; outline: 0; font: 600 13.5px 'Inter', sans-serif; padding: 8px 4px; background: transparent; }
.sc-add__val em { font-style: normal; font-weight: 700; color: #6b7b80; font-size: 13px; }

.sc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sc-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid rgba(22, 36, 42, 0.12); background: #fff; color: #16242a;
  font: 700 13px 'Inter', sans-serif; padding: 8px 12px; border-radius: 10px;
}
.sc-btn:hover { background: rgba(84, 140, 146, 0.08); }
.sc-btn--dark { background: #285260; color: #fff; border-color: #285260; }
.sc-btn--dark:hover { background: #1f4350; }
.sc-btn--ghost { border-color: transparent; color: #6b7b80; }
.sc-btn:focus-visible, .sc-preset:focus-visible, .sc-ask__btn:focus-visible, .sc-table th button:focus-visible { outline: 3px solid rgba(84, 140, 146, 0.45); outline-offset: 2px; }
.sc-count { margin-left: auto; font: 700 13.5px 'Inter', sans-serif; color: #285260; }

/* ── Tabla ─────────────────────────────────────────────────────── */
.sc-table {
  overflow-x: auto; background: #fff; border: 1px solid rgba(22, 36, 42, 0.09); border-radius: 18px;
}
.sc-table table { width: 100%; border-collapse: collapse; font: 500 13.5px 'Inter', sans-serif; color: #16242a; }
.sc-table th, .sc-table td { padding: 10px 12px; border-bottom: 1px solid rgba(22, 36, 42, 0.07); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sc-table thead th { position: sticky; top: 0; background: #f8fafa; z-index: 1; }
.sc-table th button {
  border: 0; background: transparent; cursor: pointer; padding: 0;
  font: 800 11px 'Inter', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #6b7b80;
}
.sc-table th button.is-sorted { color: #285260; }
.sc-table th button .sc-arrow { margin-left: 4px; font-size: 9px; }
.sc-table th.sc-hl button { color: #285260; }
.sc-table thead th.sc-sec { font: 800 11px 'Inter', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #6b7b80; }
.sc-table td.sc-hl { background: rgba(84, 140, 146, 0.06); font-weight: 700; }
.sc-table th:first-child, .sc-table td:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 2; }
.sc-table thead th:first-child { background: #f8fafa; z-index: 3; }
.sc-table tbody tr { cursor: pointer; }
.sc-table tbody tr:hover td { background: #f6f9f9; }
.sc-table tbody tr:hover td.sc-hl { background: rgba(84, 140, 146, 0.12); }
.sc-table td.na { color: rgba(22, 36, 42, 0.35); }
.sc-table td.neg { color: #c0392b; }
.sc-co { display: flex; align-items: center; gap: 10px; min-width: 200px; max-width: 280px; text-decoration: none; color: inherit; }
.sc-co__txt { display: flex; flex-direction: column; min-width: 0; }
.sc-co__t { font-weight: 800; color: #285260; }
.sc-co__n { font-size: 12px; color: #6b7b80; overflow: hidden; text-overflow: ellipsis; }
.sc-sec { text-align: left !important; color: #3d4b50; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }

.sc-logo {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; background: #fff; border: 1px solid rgba(22, 36, 42, 0.08);
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
}
.sc-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.sc-logo.is-fallback { background: #e8f0f1; border-color: transparent; }
.sc-logo.is-fallback img { display: none; }
.sc-logo.is-fallback::after { content: attr(data-initials); font: 800 11px 'Inter', sans-serif; color: #285260; }

@keyframes sc-shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
.sc-skel { height: 44px; margin: 8px 12px; border-radius: 10px; background: linear-gradient(90deg, #eef2f3 25%, #f7f9f9 50%, #eef2f3 75%); background-size: 800px 100%; animation: sc-shimmer 1.4s linear infinite; }
.sc-empty { padding: 36px 20px; text-align: center; font: 500 14px 'Inter', sans-serif; color: #6b7b80; }

.sc-more { align-self: center; margin: 12px auto 0; display: flex; }
.sc-more[hidden] { display: none; }
.sc-state {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: #fff; border: 1px solid rgba(22, 36, 42, 0.09); border-radius: 18px; padding: 36px 20px; text-align: center;
}
.sc-state[hidden] { display: none; }
.sc-state i { font-size: 26px; color: #548C92; }
.sc-state p { margin: 0; font: 500 14.5px/1.5 'Inter', sans-serif; color: #3d4b50; max-width: 460px; }

@media (prefers-reduced-motion: reduce) { .sc-skel { animation: none; } }
@media (max-width: 640px) {
  .sc-ask { flex-wrap: wrap; padding: 8px; }
  .sc-ask__icon { display: none; }
  .sc-ask input { flex-basis: 100%; padding: 8px 6px; }
  .sc-ask__btn { width: 100%; }
  .sc-count { margin-left: 0; flex-basis: 100%; }
  .sc-co { min-width: 150px; max-width: 190px; }
}
