/* ════════════════════════════════════════════════════════════════════════
   shared.css · Prospector Aliados · Baalam Taan
   CSS global compartido por todas las páginas
   ════════════════════════════════════════════════════════════════════════ */

/* ─── VARIABLES ──────────────────────────────────────────────────────── */
:root {
  --gold: #c5a059;
  --gb: rgba(197,160,89,.22);
  --gd: rgba(197,160,89,.1);
  --bg: #090f1a;
  --bg2: #0d1825;
  --bg3: #132030;
  --bg4: #1c2d42;
  --tx: #e2d5b8;
  --mu: #607a9a;
  --dim: #253548;
  --green: #34d399;
  --red: #f87171;
  --blue: #60a5fa;
  --orange: #fb923c;
  --purple: #a78bfa;
  --nav-w: 200px;
  --hdr-h: 48px;
  --mob-nav-h: 56px;
}

/* ─── RESET ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── BASE ───────────────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--tx);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── INPUTS ─────────────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--dim);
  border-radius: .4rem;
  padding: .52rem .72rem;
  font-size: .8rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--tx);
  outline: none;
  transition: border-color .2s;
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; line-height: 1.6; }
select option { background: var(--bg3); }
input[type="checkbox"], input[type="radio"] { width: auto; }

/* ─── BUTTONS ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .32rem;
  padding: .5rem .85rem;
  border-radius: .4rem;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: .78rem;
  transition: all .18s;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.btn-gold { background: var(--gold); color: #080d14; font-weight: 700; }
.btn-gold:hover { filter: brightness(1.1); }
.btn-gold:disabled { opacity: .35; cursor: not-allowed; }
.btn-g { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); color: var(--mu); }
.btn-g:hover { color: var(--tx); background: rgba(255,255,255,.07); }
.btn-o { background: transparent; border: 1px solid var(--gb); color: var(--gold); }
.btn-o:hover { background: var(--gd); }
.btn-wa { background: rgba(37,211,102,.1); border: 1px solid rgba(37,211,102,.22); color: #25d366; }
.btn-em { background: rgba(96,165,250,.1); border: 1px solid rgba(96,165,250,.22); color: var(--blue); }
.btn-ai { background: rgba(167,139,250,.1); border: 1px solid rgba(167,139,250,.22); color: var(--purple); }
.btn-ai:hover { background: rgba(167,139,250,.2); }
.btn-red { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.22); color: var(--red); }
.sm { padding: .3rem .58rem; font-size: .73rem; }
.xs { padding: .18rem .42rem; font-size: .66rem; }
.full { width: 100%; }

/* ─── HEADER ─────────────────────────────────────────────────────────── */
.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: var(--hdr-h);
  border-bottom: 1px solid var(--gb);
  background: rgba(9,15,26,.98);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: .9rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.logo em { color: var(--tx); font-style: normal; font-weight: 300; }
.logo .logo-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 6px var(--gold);
}

.hdr-r { display: flex; align-items: center; gap: .4rem; }

/* ─── CONN STATUS ────────────────────────────────────────────────────── */
.conn { font-size: .62rem; color: var(--mu); display: flex; align-items: center; gap: .28rem; }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mu); flex-shrink: 0; transition: background .3s; }
.conn-dot.ok  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.conn-dot.err { background: var(--red); }

/* ─── TOASTS ─────────────────────────────────────────────────────────── */
.toasts {
  position: fixed; bottom: .9rem; right: .9rem;
  display: flex; flex-direction: column; gap: .28rem;
  z-index: 9999; pointer-events: none;
}
.toast {
  background: var(--bg4);
  border: 1px solid var(--gb);
  border-radius: .45rem;
  padding: .55rem .85rem;
  font-size: .74rem;
  animation: toast-in .2s ease;
  max-width: 290px;
  pointer-events: auto;
  line-height: 1.4;
}
@keyframes toast-in {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ─── SPINNER ────────────────────────────────────────────────────────── */
.spin {
  display: inline-block;
  width: 12px; height: 12px;
  border: 1.5px solid rgba(197,160,89,.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.spin-p { border-top-color: var(--purple); border-color: rgba(167,139,250,.2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── FIELD ──────────────────────────────────────────────────────────── */
.field { margin-bottom: .75rem; }
.field label { display: block; font-size: .67rem; color: var(--mu); margin-bottom: .28rem; }
.field .hint { font-size: .63rem; color: var(--mu); margin-top: .25rem; line-height: 1.5; }

/* ─── SECTION ────────────────────────────────────────────────────────── */
.sec { padding: .9rem 1rem; border-bottom: 1px solid rgba(255,255,255,.04); }
.sec-t {
  font-size: .57rem; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--mu); margin-bottom: .65rem;
}
.hr { height: 1px; background: rgba(255,255,255,.05); margin: .5rem 0; }

/* ─── CARD ───────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: .75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card-title {
  font-family: 'Syne', sans-serif;
  font-size: .8rem; font-weight: 700;
  color: var(--gold); margin-bottom: .85rem;
  display: flex; align-items: center; gap: .4rem;
}

/* ─── STATUS BADGES ──────────────────────────────────────────────────── */
.status-badge {
  font-size: .55rem; font-weight: 700;
  padding: .1rem .38rem; border-radius: 100px;
  text-transform: uppercase; letter-spacing: .06em;
}
.st-nuevo      { background: rgba(96,165,250,.08);  color: #60a5fa; border: 1px solid rgba(96,165,250,.18); }
.st-contactado { background: rgba(251,146,60,.08);  color: #fb923c; border: 1px solid rgba(251,146,60,.18); }
.st-interesado { background: rgba(250,204,21,.08);  color: #fbbf24; border: 1px solid rgba(250,204,21,.18); }
.st-aliado     { background: rgba(52,211,153,.1);   color: #34d399; border: 1px solid rgba(52,211,153,.22); }
.st-descartado { background: rgba(255,255,255,.04); color: var(--mu); border: 1px solid rgba(255,255,255,.08); }

/* ─── SCORE BADGES ───────────────────────────────────────────────────── */
.score-badge {
  font-size: .6rem; font-weight: 800; width: 18px; height: 18px;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.score-hi { background: rgba(248,113,113,.15); color: #f87171; }
.score-md { background: rgba(251,146,60,.15);  color: #fb923c; }
.score-lo { background: rgba(96,165,250,.1);   color: #60a5fa; }

/* ─── MODAL ──────────────────────────────────────────────────────────── */
.mbg {
  position: fixed; inset: 0; background: rgba(0,0,0,.8);
  z-index: 500; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
  background: var(--bg2); border: 1px solid var(--gb);
  border-radius: .9rem; padding: 1.4rem;
  width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
}
.modal h2 { font-family: 'Syne', sans-serif; font-size: .9rem; font-weight: 700; margin-bottom: .9rem; }

/* ─── PROGRESS OVERLAY ───────────────────────────────────────────────── */
.prog-ov {
  position: fixed; inset: 0; background: rgba(0,0,0,.85);
  z-index: 600; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1rem;
}
.prog-ov h2 { font-family: 'Syne', sans-serif; font-size: 1.1rem; color: var(--tx); }
.prog-sub { font-size: .82rem; color: var(--mu); }
.prog-big { width: 320px; background: var(--bg3); border-radius: 100px; height: 6px; overflow: hidden; }
.prog-bar { height: 100%; background: linear-gradient(90deg, var(--purple), var(--gold)); border-radius: 100px; transition: width .4s ease; }

/* ════════════════════════════════════════════════════════════════════════
   SIDENAV — Desktop navigation sidebar
   ════════════════════════════════════════════════════════════════════════ */
#sidenav {
  width: var(--nav-w);
  background: var(--bg2);
  border-right: 1px solid rgba(255,255,255,.04);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--hdr-h);
  left: 0;
  bottom: 0;
  z-index: 80;
  overflow-y: auto;
  transition: transform .25s ease;
}

.snav-section {
  padding: .75rem .6rem .35rem;
}
.snav-label {
  font-size: .52rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--mu);
  padding: 0 .55rem; margin-bottom: .35rem;
}
.snav-item {
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem .75rem; border-radius: .45rem;
  font-size: .78rem; font-weight: 500; color: var(--mu);
  text-decoration: none; cursor: pointer; border: none; background: transparent;
  width: 100%; transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: .08rem;
}
.snav-item:hover { color: var(--tx); background: rgba(255,255,255,.04); }
.snav-item.active {
  color: var(--gold);
  background: rgba(197,160,89,.08);
  border: 1px solid rgba(197,160,89,.14);
}
.snav-item.active .snav-icon { color: var(--gold); }
.snav-icon { font-size: .9rem; line-height: 1; flex-shrink: 0; }
.snav-badge {
  margin-left: auto; font-size: .55rem; font-weight: 700;
  background: rgba(248,113,113,.15); color: #f87171;
  padding: .08rem .35rem; border-radius: 100px; min-width: 18px; text-align: center;
}
.snav-divider { height: 1px; background: rgba(255,255,255,.04); margin: .35rem .75rem; }

/* Pages that use sidenav: push content right */
body.has-sidenav .page-wrap { margin-left: var(--nav-w); }

/* ─── Sidenav bottom section ─────────────────────────────────────────── */
.snav-bottom {
  margin-top: auto;
  padding: .6rem;
  border-top: 1px solid rgba(255,255,255,.04);
}
.snav-conn {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .6rem; border-radius: .35rem;
  background: rgba(255,255,255,.02);
}
.snav-conn-txt { font-size: .62rem; color: var(--mu); }
.snav-version { font-size: .54rem; color: var(--dim); margin-top: .3rem; padding: 0 .6rem; }

/* ════════════════════════════════════════════════════════════════════════
   BOTTOM NAV — Mobile navigation
   ════════════════════════════════════════════════════════════════════════ */
#botnav {
  display: none; /* shown via media query */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mob-nav-h);
  background: rgba(13,24,37,.97);
  border-top: 1px solid var(--gb);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 300;
  flex-direction: row;
  align-items: stretch;
}
.bnav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .16rem;
  text-decoration: none;
  color: var(--mu);
  font-size: .55rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer; border: none; background: transparent;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
  padding: .3rem 0 .5rem;
  position: relative;
}
.bnav-item .bnav-icon { font-size: 1.15rem; line-height: 1; transition: transform .15s; }
.bnav-item:hover .bnav-icon,
.bnav-item:active .bnav-icon { transform: translateY(-1px); }
.bnav-item.active { color: var(--gold); }
.bnav-item.active .bnav-icon { filter: drop-shadow(0 0 6px rgba(197,160,89,.5)); }
.bnav-item .bnav-pip {
  position: absolute; top: .3rem; right: calc(50% - .9rem);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red); display: none;
  box-shadow: 0 0 4px var(--red);
}
.bnav-item .bnav-pip.show { display: block; }

/* Active bar indicator */
.bnav-item.active::after {
  content: '';
  position: absolute; bottom: 0; left: 20%; right: 20%;
  height: 2px; background: var(--gold); border-radius: 2px 2px 0 0;
}

/* ─── Page body padding for mobile nav ──────────────────────────────── */
@media (max-width: 768px) {
  body { padding-bottom: var(--mob-nav-h); }
  body.has-sidenav .page-wrap { margin-left: 0; }
  #sidenav { display: none !important; }
  #botnav { display: flex !important; }
  .hdr { padding: 0 .85rem; }
  .toasts { bottom: calc(var(--mob-nav-h) + .5rem); right: .5rem; left: .5rem; }
  .toasts .toast { max-width: 100%; }
  .mbg { align-items: flex-end; }
  .modal { max-width: 100%; border-radius: .75rem .75rem 0 0; }
}

/* ─── Desktop: sidenav adjustments ──────────────────────────────────── */
@media (min-width: 769px) {
  #botnav { display: none !important; }
  #sidenav { display: flex !important; }
}

/* ════════════════════════════════════════════════════════════════════════
   PAGE WRAPPER — wraps main content, pushes past sidenav
   ════════════════════════════════════════════════════════════════════════ */
.page-wrap {
  margin-left: var(--nav-w);
  min-height: calc(100vh - var(--hdr-h));
  transition: margin-left .25s ease;
}

/* ─── Page title blocks ──────────────────────────────────────────────── */
.page-hero {
  padding: 1.25rem 1.5rem .5rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.page-title { font-family: 'Syne', sans-serif; font-size: 1.15rem; font-weight: 800; color: var(--tx); }
.page-sub { font-size: .75rem; color: var(--mu); margin-top: .2rem; }

/* ─── Nav toggle (mobile hamburger, shown if needed) ─────────────────── */
.nav-toggle {
  width: 32px; height: 32px; border-radius: .35rem;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--mu); font-size: .9rem;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Breadcrumb ─────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: .35rem;
  font-size: .65rem; color: var(--mu); padding: .5rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.breadcrumb a { color: var(--mu); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { opacity: .4; }
.breadcrumb .cur { color: var(--tx); }

/* ─── Empty state ────────────────────────────────────────────────────── */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .7rem; padding: 4rem 2rem; text-align: center; color: var(--mu);
}
.empty h3 { font-family: 'Syne', sans-serif; font-size: .92rem; color: var(--tx); }
.empty p { font-size: .78rem; line-height: 1.6; max-width: 320px; }
.empty-icon { font-size: 2.5rem; opacity: .2; }

/* ─── Utility ────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.flex-1 { flex: 1; }
.text-gold { color: var(--gold); }
.text-mu { color: var(--mu); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-xs { font-size: .65rem; }
.text-sm { font-size: .75rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mb-2 { margin-bottom: .5rem; }

/* ─── Google fonts import hint (add to <head> of each page) ──────────── */
/* <link href="https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:wght@300;400;500&display=swap" rel="stylesheet"/> */
