/* ============================================================
   ADNEXUS — SISTEMA DE DISEÑO COMPARTIDO
   Identidad: Fraunces (display) + Inter Tight (sans) + JetBrains Mono
   Paleta: papel cálido + coral + lima + tinta
   ============================================================ */

:root {
  --paper: #F4EFE3;
  --paper-2: #EAE3D2;
  --cream: #FBF7EC;
  --ink: #14120E;
  --ink-soft: #3D362B;
  --ink-mute: #807868;
  --ink-faint: #B5AC97;
  --coral: #FF5A36;
  --coral-soft: #FFE4D9;
  --lime: #CFEC4A;
  --lime-soft: #EEF7C6;
  --mint: #B6E0C8;
  --lilac: #D4C9F1;
  --display: 'Fraunces', Georgia, serif;
  --sans: 'Inter Tight', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

body {
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255,90,54,0.06) 0%, transparent 35%),
    radial-gradient(circle at 88% 92%, rgba(207,236,74,0.08) 0%, transparent 35%);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.15'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

a { color: inherit; }

/* =========== TICKER =========== */
.ticker {
  background: var(--ink);
  color: var(--cream);
  position: relative;
  z-index: 50;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ticker-track {
  display: flex;
  gap: 48px;
  padding: 9px 0;
  animation: scroll 60s linear infinite;
  white-space: nowrap;
}
@keyframes scroll { to { transform: translateX(-50%); } }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; }
.ticker-item .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 6px var(--lime);
}
.ticker-item .coral { color: var(--coral); }
.ticker-item .lime { color: var(--lime); }

/* =========== TOP NAV =========== */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244,239,227,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.brand-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--coral);
  color: var(--cream);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: 22px;
  margin-right: 10px;
  line-height: 1;
  transform: rotate(-6deg);
}
.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand-name em { font-style: italic; font-weight: 400; }

.nav-pills {
  display: flex;
  gap: 4px;
  background: var(--paper-2);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  margin-left: 8px;
  overflow-x: auto;
  max-width: 100%;
}
.pill {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.15s;
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--sans);
}
.pill:hover { color: var(--ink); }
.pill.active { background: var(--ink); color: var(--cream); }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 12px;
  white-space: nowrap;
}
.nav-link:hover { color: var(--coral); }
.nav-link.active { color: var(--coral); }

/* =========== BUTTONS =========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  border: 1px solid var(--ink);
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
}
.btn-primary { background: var(--coral); color: var(--cream); }
.btn-primary:hover {
  background: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--coral);
}
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); }
.btn-dark { background: var(--ink); color: var(--cream); }
.btn-dark:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--coral); }
.btn-lime { background: var(--lime); color: var(--ink); }
.btn-lime:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.btn-lg { padding: 13px 24px; font-size: 14px; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--lime);
  border: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

/* =========== PAGES =========== */
.page {
  display: none;
  padding: 48px 32px 80px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.page.active { display: block; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

/* =========== HERO =========== */
.hero { margin-bottom: 56px; position: relative; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 18px;
  padding: 6px 12px;
  background: var(--cream);
  border: 1px solid var(--ink);
  border-radius: 999px;
}
.eyebrow .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--coral);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(40px, 6.5vw, 80px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 20px;
  text-wrap: balance;
}
.hero h1 em { font-style: italic; font-weight: 400; color: var(--coral); }
.hero h1 .underline { position: relative; display: inline-block; }
.hero h1 .underline::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: -3%;
  right: -3%;
  height: 14px;
  background: var(--lime);
  z-index: -1;
  border-radius: 4px;
}

.hero-desc {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 620px;
  line-height: 1.5;
  margin-bottom: 28px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.sticker {
  position: absolute;
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 18px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--lime);
  transform: rotate(8deg);
  box-shadow: 4px 4px 0 var(--ink);
  white-space: nowrap;
}
.sticker.coral { background: var(--coral); color: var(--cream); transform: rotate(-6deg); }
.sticker.lilac { background: var(--lilac); }
.sticker.tr { top: 60px; right: 40px; }
.sticker.tr2 { top: 200px; right: 200px; transform: rotate(-10deg); }
.sticker.tl { top: 30px; left: 0; transform: rotate(-8deg); }

/* =========== METRICS =========== */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 56px;
}
.metric {
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  transition: all 0.2s;
}
.metric:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.metric.coral { background: var(--coral); color: var(--cream); }
.metric.lime { background: var(--lime); }
.metric.mint { background: var(--mint); }
.metric.lilac { background: var(--lilac); }
.metric.dark { background: var(--ink); color: var(--cream); }

.metric-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
  opacity: 0.75;
}
.metric-value {
  font-family: var(--display);
  font-weight: 700;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.metric-value .unit {
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  opacity: 0.7;
}
.metric-delta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
}
.metric.coral .metric-delta,
.metric.dark .metric-delta { background: rgba(255,255,255,0.2); }

/* =========== SECTION =========== */
.section { margin-bottom: 56px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 20px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.025em;
}
.section-title em { font-style: italic; font-weight: 400; color: var(--coral); }
.section-sub {
  font-size: 14.5px;
  color: var(--ink-mute);
  margin-top: 8px;
  max-width: 520px;
}
.section-link {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 2px;
}

/* =========== PANELS / TABLES =========== */
.panel {
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  overflow: hidden;
}
.panel-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper-2);
}
.panel-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-title .live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--coral);
  animation: pulse 1.5s infinite;
}
.panel-actions {
  display: flex;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
}
.panel-actions span {
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.panel-actions span.active { background: var(--ink); color: var(--cream); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 14px 22px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--ink);
  font-weight: 500;
}
.tbl tbody td {
  padding: 16px 22px;
  border-bottom: 1px solid var(--paper-2);
  font-size: 13.5px;
  vertical-align: middle;
}
.tbl tbody tr:hover { background: var(--paper); cursor: pointer; }
.tbl tbody tr:last-child td { border-bottom: none; }

.entity { display: flex; align-items: center; gap: 10px; }
.entity .mark {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-style: italic;
  font-size: 14px;
  background: var(--cream);
  flex-shrink: 0;
}
.entity-name { font-weight: 600; }
.entity-sub { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); }

.amount {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.amount-sub { font-family: var(--mono); font-size: 10.5px; color: var(--ink-mute); }

/* status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  white-space: nowrap;
}
.status-pill .dot { width: 5px; height: 5px; border-radius: 50%; }
.status-pill.paid { background: var(--lime); }
.status-pill.paid .dot { background: var(--ink); }
.status-pill.pending { background: var(--coral-soft); }
.status-pill.pending .dot { background: var(--coral); }
.status-pill.processing { background: var(--lilac); }
.status-pill.processing .dot { background: var(--ink); }
.status-pill.active { background: var(--lime); }
.status-pill.active .dot { background: var(--ink); }
.status-pill.paused { background: var(--paper-2); }
.status-pill.paused .dot { background: var(--ink-mute); }
.status-pill.rejected { background: var(--ink); color: var(--cream); }
.status-pill.rejected .dot { background: var(--coral); }
.status-pill.new { background: var(--coral); color: var(--cream); }
.status-pill.new .dot { background: var(--cream); }
.status-pill.study { background: var(--lilac); }
.status-pill.study .dot { background: var(--ink); }
.status-pill.finished { background: var(--cream); color: var(--ink-mute); }
.status-pill.finished .dot { background: var(--ink-mute); }

/* chips */
.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--ink-faint);
  white-space: nowrap;
}
.chip.coral { background: var(--coral-soft); border-color: var(--coral); color: var(--coral); }
.chip.lime { background: var(--lime-soft); }
.chip.mint { background: var(--mint); }
.chip.lilac { background: var(--lilac); }

/* =========== TWO COL / FORMS =========== */
.two-col {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

.form-group { margin-bottom: 18px; }
.label-mono {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: all 0.15s;
}
.input:focus, .textarea:focus, .select:focus {
  background: var(--cream);
  box-shadow: 3px 3px 0 var(--coral);
  transform: translate(-1px, -1px);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2314120E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* =========== FOOTER =========== */
.footer {
  background: var(--ink);
  color: var(--cream);
  padding: 60px 32px 32px;
  position: relative;
  z-index: 2;
}
.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(251,247,236,0.15);
}
.footer h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
  opacity: 0.6;
}
.footer ul { list-style: none; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--cream); text-decoration: none; font-size: 14px; opacity: 0.9; }
.footer a:hover { color: var(--coral); }
.footer-tag {
  font-family: var(--display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
}
.footer-tag em { font-style: italic; color: var(--coral); font-weight: 400; }
.footer-desc { font-size: 14px; opacity: 0.7; max-width: 320px; }
.footer-bottom {
  max-width: 1280px;
  margin: 32px auto 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}

/* =========== UTILITIES =========== */
.dashed-card {
  background: var(--paper);
  border: 1px dashed var(--ink-faint);
  border-radius: 12px;
  padding: 14px 16px;
}
.cta-banner {
  background: var(--ink);
  color: var(--cream);
  border-radius: 24px;
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 56px;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: var(--coral);
  border-radius: 50%;
  opacity: 0.35;
}
.cta-banner .ct-l { position: relative; z-index: 2; max-width: 680px; }
.cta-banner h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 10px;
}
.cta-banner h3 em { font-style: italic; color: var(--lime); font-weight: 400; }
.cta-banner p { opacity: 0.8; font-size: 15px; max-width: 520px; }
.cta-banner .ct-r { position: relative; z-index: 2; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 4px; }

/* =========== RESPONSIVE =========== */
@media (max-width: 1100px) {
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav { padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
  .nav-pills { order: 3; width: 100%; }
  .page { padding: 32px 20px 60px; }
  .container { padding: 0 20px; }
  .metrics-row { grid-template-columns: 1fr; }
  .sticker { display: none; }
  .cta-banner { flex-direction: column; padding: 32px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}
