/* ==========================================================================
   BioAlpha Radar — GaeliKA corporate identity ("Light Blue")
   Palette : Azul claro #4FA3D1 · Verde innovación #6BC46D · Azul profundo #1F4E79
             Gris técnico #4A4A4A · Gris claro #E9EEF2 · Blanco #FFFFFF
   Type    : Montserrat (SemiBold/Medium/Regular), Inter fallback
   Ratio   : 60% blanco · 25% azul · 10% gris · 5% verde (acento)
   ========================================================================== */

:root {
  --blue:        #4FA3D1;
  --blue-deep:   #1F4E79;
  --green:       #6BC46D;
  --gray:        #4A4A4A;
  --gray-light:  #E9EEF2;
  --white:       #FFFFFF;
  --bg:          #F6F9FB;
  --blue-15:     rgba(79,163,209,0.15);
  --blue-08:     rgba(79,163,209,0.08);
  --green-12:    rgba(107,196,109,0.12);
  --shadow:      0 1px 3px rgba(31,78,121,0.08), 0 6px 24px rgba(31,78,121,0.06);
  --radius:      12px;
  --radius-sm:   8px;
  --font: 'Montserrat','Inter','Helvetica Neue',Arial,sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--gray);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-deep); }
h1,h2,h3,h4 { font-weight: 600; color: var(--blue); margin: 0 0 .4em; }
h1 { font-size: 22px; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 14px; color: var(--green); text-transform: none; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--white); border-right: 1px solid var(--gray-light);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 22px 20px 14px; border-bottom: 1px solid var(--gray-light); }
.sidebar .brand img { width: 150px; display: block; }
.sidebar .brand .tagline {
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--green); font-weight: 600; margin-top: 6px;
}
.nav { padding: 12px 10px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--gray); font-weight: 500;
  margin-bottom: 2px; transition: background .12s, color .12s;
}
.nav a:hover { background: var(--blue-08); color: var(--blue-deep); }
.nav a.active { background: var(--blue-15); color: var(--blue-deep); font-weight: 600; }
.nav a .ico { width: 18px; height: 18px; flex: none; stroke: currentColor; }
.nav .group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  color: #9bb0bf; padding: 14px 12px 6px; font-weight: 600;
}
.sidebar .user-box {
  border-top: 1px solid var(--gray-light); padding: 14px 16px; font-size: 12px;
}
.sidebar .user-box .name { font-weight: 600; color: var(--blue-deep); }
.sidebar .user-box .org { color: #8a9aa6; }
.sidebar .user-box a { font-size: 12px; }

.main { flex: 1; min-width: 0; }
.topbar {
  background: var(--white); border-bottom: 1px solid var(--gray-light);
  padding: 16px 28px; display: flex; align-items: center; justify-content: space-between;
}
.topbar .crumb { color: #8a9aa6; font-size: 12px; }
.topbar h1 { margin: 2px 0 0; }
.content { padding: 24px 28px 48px; max-width: 1280px; }

/* ---------- Cards & grid ---------- */
.grid { display: grid; gap: 18px; }
.grid.kpis { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: 1.4fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px){ .grid.kpis{grid-template-columns:repeat(2,1fr);} .grid.cols-2,.grid.cols-3{grid-template-columns:1fr;} }

.card {
  background: var(--white); border: 1px solid var(--gray-light);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.card .card-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: #8a9aa6; font-weight: 600; margin-bottom: 12px;
  display:flex; align-items:center; justify-content:space-between;
}
.card.kpi .value { font-size: 30px; font-weight: 700; color: var(--blue-deep); line-height: 1; }
.card.kpi .label { font-size: 12px; color: #8a9aa6; margin-top: 8px; }
.card.kpi .accent { color: var(--green); }
.kpi-row { display:flex; align-items:baseline; gap:8px; }

/* ---------- Score visuals ---------- */
.score-badge {
  display:inline-flex; align-items:center; justify-content:center; gap:4px;
  min-width: 46px; padding: 4px 10px; border-radius: 999px;
  font-weight: 700; font-size: 13px; color: #fff;
}
.s-high   { background: var(--green); }
.s-mid    { background: var(--blue); }
.s-low    { background: #b9c6cf; }
.delta-up   { color: var(--green); font-weight:600; }
.delta-down { color: #d9685f; font-weight:600; }
.delta-flat { color: #9bb0bf; font-weight:600; }

.momentum { display:flex; flex-direction:column; gap:8px; }
.momentum .row { display:flex; align-items:center; gap:10px; }
.momentum .row .lbl { width:96px; font-size:12px; color:var(--gray); }
.bar { flex:1; height:8px; background:var(--gray-light); border-radius:5px; overflow:hidden; }
.bar > span { display:block; height:100%; border-radius:5px; background:var(--blue); }
.bar.green > span { background: var(--green); }
.momentum .row .num { width:34px; text-align:right; font-weight:600; font-size:12px; color:var(--blue-deep); }

/* ---------- Tables ---------- */
table.data { width:100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align:left; background: var(--blue-15); color: var(--blue-deep);
  font-weight:600; padding: 10px 12px; border-bottom: 1px solid var(--gray-light);
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--gray-light); }
table.data tr:hover td { background: var(--blue-08); }
table.data .num { text-align:right; font-variant-numeric: tabular-nums; }

/* ---------- Tags / pills ---------- */
.pill {
  display:inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px;
  font-weight: 600; background: var(--gray-light); color: var(--blue-deep);
}
.pill.green { background: var(--green-12); color: #3f8b40; }
.pill.blue { background: var(--blue-15); color: var(--blue-deep); }
.pill.type { text-transform: capitalize; }

/* ---------- Timeline / events ---------- */
.timeline { list-style:none; margin:0; padding:0; }
.timeline li { display:flex; gap:12px; padding:10px 0; border-bottom:1px solid var(--gray-light); }
.timeline li:last-child { border-bottom:none; }
.timeline .dot { width:9px; height:9px; border-radius:50%; margin-top:5px; flex:none; background:var(--blue); }
.timeline .dot.clinical{background:var(--blue);} .timeline .dot.scientific{background:#7e57c2;}
.timeline .dot.regulatory{background:#e0883a;} .timeline .dot.funding{background:var(--green);}
.timeline .dot.narrative{background:#9bb0bf;} .timeline .dot.investment{background:var(--blue-deep);}
.timeline .ev-title { font-weight:600; color:var(--gray); font-size:13px; }
.timeline .ev-meta { font-size:11.5px; color:#8a9aa6; margin-top:2px; }

/* ---------- Buttons & forms ---------- */
.btn {
  display:inline-flex; align-items:center; gap:7px; cursor:pointer;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: var(--font); font-weight: 600; font-size: 13px; transition: .12s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); color:#fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(.95); color:#fff; }
.btn-ghost { background: #fff; border-color: var(--gray-light); color: var(--blue-deep); }
.btn-ghost:hover { background: var(--blue-08); }
.btn-sm { padding: 6px 11px; font-size: 12px; }

input, select, textarea {
  font-family: var(--font); font-size: 13px; color: var(--gray);
  padding: 9px 11px; border: 1px solid var(--gray-light); border-radius: var(--radius-sm);
  background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
label { font-size: 12px; font-weight: 600; color: var(--blue-deep); display:block; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.form-row { display:grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Section header ---------- */
.section-head { display:flex; align-items:center; justify-content:space-between; margin: 26px 0 12px; }
.section-head h2 { margin:0; }
.toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

/* ---------- Login ---------- */
.login-wrap {
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, #eaf4fa 0%, #f1faf2 100%);
}
.login-card {
  width: 380px; background:#fff; border-radius: 16px; padding: 36px 34px;
  box-shadow: 0 10px 40px rgba(31,78,121,0.12); border:1px solid var(--gray-light);
}
.login-card img { width: 180px; display:block; margin: 0 auto 6px; }
.login-card .tagline {
  text-align:center; font-size: 10px; letter-spacing: .16em; text-transform:uppercase;
  color: var(--green); font-weight:600; margin-bottom: 24px;
}
.login-card .err {
  background: #fdecec; color:#c0392b; padding:9px 12px; border-radius:8px;
  font-size:12.5px; margin-bottom:14px; border:1px solid #f5c6c6;
}
.login-card .btn { width:100%; justify-content:center; margin-top: 6px; }

.muted { color:#8a9aa6; }
.small { font-size:12px; }
.flex { display:flex; align-items:center; gap:10px; }
.spacer { flex:1; }
.mt-0{margin-top:0;} .mb-0{margin-bottom:0;}
.empty { text-align:center; color:#9bb0bf; padding: 30px; font-size:13px; }
.chart-box { position:relative; height: 240px; }
