/* OPORTUNIDADES — UI premium tipo interfaz IA (plana, sin degradados) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0c0c;
  --bg-elev: #141414;
  --surface: #1a1a1a;
  --surface-hover: #242424;
  --border: #333333;
  --border-soft: #2a2a2a;
  --text: #fafafa;
  --text-secondary: #d4d4d8;
  --text-tertiary: #a1a1aa;
  --accent: #f4f4f5;
  --accent-fg: #111111;
  --accent-hover: #e4e4e7;
  --input-bg: #050505;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #93c5fd;
  --radius: 12px;
  --radius-sm: 8px;
  --nav-w: 240px;
  --font: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad-x: 32px;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f5;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f4f4f5;
  --border: #d4d4d8;
  --border-soft: #e4e4e7;
  --text: #18181b;
  --text-secondary: #3f3f46;
  --text-tertiary: #52525b;
  --accent: #18181b;
  --accent-fg: #fafafa;
  --accent-hover: #27272a;
  --input-bg: #ffffff;
  --ok: #059669;
  --warn: #b45309;
  --danger: #dc2626;
  --info: #1d4ed8;
  --shadow: 0 8px 24px rgba(24,24,27,.12);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  font-weight: 450;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

.app {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100vh;
}
.nav {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 14px;
  min-width: 0;
}
.nav-header {
  display: contents;
}
.nav-actions {
  display: none;
}
.nav-burger { display: none; }
.nav-theme-desk {
  display: inline-flex;
  margin: 0 0 10px;
}
.nav-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
  object-fit: cover;
  background: transparent;
}
.nav-brand-text { min-width: 0; }
.nav-title {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: var(--font) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: var(--text) !important;
  line-height: 1.25 !important;
}
.nav a.nav-link {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 2px;
}
.nav a.nav-link:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav a.nav-link.active { background: var(--surface); color: var(--text); }
.nav-foot {
  margin-top: 24px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-tertiary);
  font-size: 12px;
}

.main {
  padding: 28px var(--pad-x) 48px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}
.page-head { margin-bottom: 22px; }
.page-head-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.page-head h1 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.page-head .sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 54ch;
}
.page-head-hero .sub {
  margin-top: 8px;
  max-width: 42rem;
  text-align: center;
  font-weight: 500;
}
.logo-swap {
  position: relative;
  width: min(100%, 1024px);
  display: grid;
  justify-items: center;
  align-items: center;
  line-height: 0;
  background: transparent;
}
.logo-swap-img {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  opacity: 0;
  transition: opacity .65s ease;
  pointer-events: none;
}
.logo-swap-img.is-on {
  opacity: 1;
  position: relative;
  z-index: 1;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stat b {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.stat span { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-fg);
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn2 {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn2:hover { background: var(--surface); }

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 13.5px;
}
.callout b { color: var(--text); font-weight: 600; }
.callout a { font-weight: 600; }

.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.filtros button {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
}
.filtros button:hover { color: var(--text); background: var(--surface); }
.filtros button.on {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  font-weight: 600;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  margin-right: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.card h2, .card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
.card p { margin: 0 0 8px; color: var(--text-secondary); font-size: 13.5px; }
.meta { color: var(--text-tertiary); font-size: 12px; margin: 0; }
.lead { margin-bottom: 10px; }
.lead-head { display: flex; gap: 14px; align-items: flex-start; }
.checks {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 148px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}
.checks input {
  width: 15px;
  height: 15px;
  accent-color: #e4e4e7;
  cursor: pointer;
}
.lead.marked-me { border-color: #3f3f46; background: var(--surface-hover); }
.lead.marked-users { outline: 1px solid #3b82f6; outline-offset: -1px; }
.pasos { margin: 8px 0 0; padding-left: 1.1rem; color: var(--text-secondary); font-size: 12.5px; }
.pasos li { margin: 4px 0; }
.links { margin-top: 8px !important; }
.links a {
  display: inline-block;
  margin: 4px 10px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--info);
}
.links a.btn-ayuda {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: var(--accent-fg) !important;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
  text-decoration: none !important;
}
.links a.btn-ayuda:hover { background: var(--accent-hover); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  border-bottom: 1px solid var(--border);
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.alert { border-left: 2px solid var(--warn); }
.okbox { border-left: 2px solid var(--ok); }
.badbox { border-left: 2px solid var(--danger); }

.num {
  display: inline-flex;
  width: 22px; height: 22px;
  align-items: center; justify-content: center;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  margin-right: 8px;
}
.check { list-style: none; padding: 0; margin: 0; }
.check li {
  padding: 10px 0 10px 26px;
  position: relative;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-secondary);
}
.check li:before {
  content: "";
  position: absolute;
  left: 0; top: 14px;
  width: 14px; height: 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
}

pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow: auto;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--mono);
}

.search-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 14px;
  margin: 0 0 20px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow);
}
.search-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.search-kicker {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.search-panel h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text);
  text-transform: none;
}
.search-count-pill {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}
.search-count-pill b { color: var(--text); }

.search-hero { margin-bottom: 12px; }
.search-hero input {
  width: 100%;
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  outline: none;
}
.search-hero input::placeholder { color: var(--text-tertiary); font-weight: 400; }
.search-hero input:focus {
  border-color: var(--text-secondary);
  background: var(--input-bg);
}

.search-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.search-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}
.search-field select {
  width: 100%;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.search-field select:focus { border-color: var(--text-secondary); }

.search-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
  margin-bottom: 4px;
}
.search-foot .filtros { margin: 0; }
.search-foot .btn { padding: 7px 12px; font-size: 12.5px; }

.search-shortcuts {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.search-shortcuts-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.search-shortcuts .chips {
  margin: 0;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
.chip-tipo {
  cursor: pointer;
  appearance: none;
  font: inherit;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip-tipo:hover,
.chip-tipo.is-on {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.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;
}

@media (max-width: 900px) {
  .search-filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .search-filters { grid-template-columns: 1fr; }
  .search-head { flex-direction: column; }
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: none;
  z-index: 40;
  box-shadow: var(--shadow);
}

.empty { color: var(--text-tertiary); }

/* Controles tema / menú móvil */
.icon-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}
.icon-btn:hover { background: var(--surface-hover); }
.theme-btn .theme-icon-light { display: none; }
[data-theme="light"] .theme-btn .theme-icon-dark { display: none; }
[data-theme="light"] .theme-btn .theme-icon-light { display: inline; }

@media (max-width: 900px) {
  .search-filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .search-filters { grid-template-columns: 1fr; }
  .search-head { flex-direction: column; align-items: stretch; }
}

/* Móvil: sin márgenes laterales, texto grande y legible */
@media (max-width: 860px) {
  :root, [data-theme="dark"], [data-theme="light"] {
    --pad-x: 0px;
    --radius: 0px;
    --radius-sm: 8px;
  }
  body { font-size: 16px; line-height: 1.6; }
  .app { grid-template-columns: 1fr; }
  .nav {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    background: var(--bg-elev);
  }
  .nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }
  .nav-brand {
    padding: 0;
    margin: 0;
    border: 0;
    flex: 1;
    min-width: 0;
  }
  .nav-title { font-size: 13px !important; }
  .nav-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
  .nav-burger { display: inline-flex; }
  .nav-theme-desk { display: none; }
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .nav.is-open .nav-links { display: flex; }
  .nav a.nav-link {
    margin: 0;
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    border: 1px solid var(--border);
    background: var(--surface);
  }
  .nav a.nav-link.active {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
  }
  .nav-foot { display: none; }
  .nav.is-open .nav-foot {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-secondary);
  }

  .main {
    padding: 0 0 calc(28px + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }
  .page-head {
    padding: 8px 12px 6px;
    margin-bottom: 0;
  }
  .page-head-hero { padding: 4px 0 0; }
  .page-head-hero .sub { padding: 0 12px; margin-top: 6px; font-size: 15px; }
  .logo-swap {
    width: 100%;
    background: transparent;
  }
  .page-head h1 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
  }
  .page-head .sub {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: none;
    font-weight: 500;
  }

  .stats {
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--border);
  }
  .stat {
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    padding: 12px;
  }
  .stat b {
    font-size: 12px;
    color: var(--text-tertiary);
  }
  .stat span {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
  }

  .toolbar {
    gap: 8px;
    margin: 0;
    padding: 12px;
    border-bottom: 1px solid var(--border);
  }
  .btn, .btn2 {
    flex: 1 1 calc(50% - 8px);
    min-height: 44px;
    font-size: 14px;
    border-radius: 10px;
    padding: 10px 12px;
  }

  .callout,
  .card,
  .lead,
  .search-panel,
  .alert,
  .okbox,
  .badbox {
    border-radius: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
  }
  .callout, .card, .lead, .search-panel {
    padding-left: 12px;
    padding-right: 12px;
  }
  .card p, .lead p, .callout {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
  }
  .card h2, .card h3, .lead h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
  }
  .meta {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
  }
  .tag {
    font-size: 12px;
    font-weight: 600;
  }
  .links a {
    font-size: 14px;
    font-weight: 600;
    margin: 6px 12px 0 0;
  }
  .links a.btn-ayuda {
    padding: 8px 12px;
    font-size: 13px;
  }
  .checks {
    min-width: 0;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    color: var(--text);
  }
  .checks input { width: 18px; height: 18px; }
  .lead-head { flex-direction: column; }
  .pasos { font-size: 14px; color: var(--text-secondary); }

  .search-panel { margin: 0; padding-top: 12px; padding-bottom: 12px; }
  .search-hero input {
    font-size: 16px;
    min-height: 48px;
    border-radius: 10px;
  }
  .search-field label {
    font-size: 12px;
    color: var(--text-tertiary);
  }
  .search-field select {
    font-size: 16px;
    min-height: 44px;
    background: var(--input-bg);
  }
  .search-count-pill {
    font-size: 13px;
    color: var(--text);
  }
  .filtros button {
    font-size: 14px;
    min-height: 40px;
    color: var(--text-secondary);
  }
  .filtros button.on {
    color: var(--accent-fg);
  }

  table { font-size: 14px; }
  th, td { padding: 12px 10px; }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    text-align: center;
  }

  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    font-size: 16px !important;
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .btn, .btn2 { flex: 1 1 100%; }
  .nav-title { font-size: 12px !important; }
}
