/* NCBI Analytics: same tokens and feel as ncbourboninsider.com and the member dashboard. */
:root {
  --bg: #f7f5ef;
  --card: #ffffff;
  --soft: #fbf8f1;
  --text: #1c2233;
  --muted: #4e566a;
  --faint: #8a8f9c;
  --accent: #c28f00;
  --accent-strong: #e6b31a;
  --accent-ink: #2f1f00;
  --accent-deep: #7a5a00;
  --line: rgba(0, 0, 0, 0.08);
  --shadow: 0 20px 55px rgba(20, 30, 60, 0.10);
  --good: #15803d;
  --bad: #b91c1c;
  --side: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Manrope', system-ui, sans-serif;
  color: var(--text);
  line-height: 1.55;
  background: radial-gradient(circle at 12% 20%, rgba(226, 199, 120, 0.16), transparent 32%),
    radial-gradient(circle at 78% 0%, rgba(120, 146, 255, 0.10), transparent 30%),
    linear-gradient(140deg, #fdfaf4, #f2eee3 50%, #ebe6da) fixed;
  min-height: 100vh;
}

h1, h2 { font-family: 'Playfair Display', 'Manrope', serif; letter-spacing: -0.01em; margin: 0 0 0.4rem; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.15; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 0.8rem; }
a { color: var(--accent-deep); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.bad { color: var(--bad); }

/* ---------- layout ---------- */
body.has-nav { padding-left: var(--side); }

.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); overflow-y: auto;
  background: rgba(255, 255, 255, 0.96); border-right: 1px solid var(--line);
  box-shadow: 8px 0 30px rgba(20, 30, 60, 0.05); padding: 1.1rem 0.9rem 1.5rem; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; padding: 0.2rem 0.4rem 0.9rem; border-bottom: 1px solid var(--line); }
.brand img { height: 34px; width: auto; }
.brand strong { display: block; font-size: 0.95rem; color: var(--text); line-height: 1.2; }
.brand small { display: block; font-size: 0.78rem; font-weight: 800; color: var(--accent); }
.org-name { margin: 0.8rem 0.5rem 0; font-weight: 800; font-size: 0.92rem; }
.org-name span { display: block; font-weight: 600; font-size: 0.78rem; color: var(--muted); }
.menu > summary { display: none; }
.nav-group { margin: 1rem 0.5rem 0.3rem; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.nav-link { display: block; padding: 0.48rem 0.7rem; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.nav-link:hover { background: var(--soft); color: var(--text); }
.nav-link.active { background: linear-gradient(135deg, rgba(194, 143, 0, 0.14), rgba(230, 179, 26, 0.14)); color: var(--accent-deep); }
.nav-foot { margin-top: 1.2rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.who { display: block; padding: 0 0.7rem 0.3rem; font-size: 0.78rem; color: var(--faint); word-break: break-all; }

.main { max-width: 1320px; margin: 0 auto; padding: 2rem 28px 3rem; }
body.bare .main { max-width: 520px; }

.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.4rem; }
.page-head .sub, .report-head .sub { color: var(--muted); margin: 0; }
.head-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  padding: 1.3rem 1.4rem; margin-bottom: 1.2rem;
}
.card.narrow { max-width: 640px; }
.card.empty { text-align: center; padding: 2.4rem 1.4rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1.2rem; margin-bottom: 1.2rem; }
.grid-2 > .card, .grid-2 > .chart-card { margin-bottom: 0; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.9rem; margin-bottom: 1.2rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; display: grid; gap: 0.15rem; box-shadow: 0 8px 24px rgba(20, 30, 60, 0.05); }
.kpi-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.kpi-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.01em; color: #11162a; }
.kpi-note { font-size: 0.78rem; color: var(--faint); }
.delta { font-size: 0.8rem; font-weight: 700; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); }

/* ---------- charts ---------- */
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin: 0 0 1.2rem; }
.chart-card figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.1rem; margin-bottom: 0.6rem; }
.chart-box { position: relative; width: 100%; }
.chart-table { margin-top: 0.8rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th { text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); font-weight: 800; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; }
table.data td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:hover td { background: #fdf9ef; }
table.data tr.hl td { background: #fff4d6; font-weight: 700; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td a { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(194, 143, 0, 0.4); }
td a:hover { color: var(--accent-deep); }
.share { display: inline-block; width: 90px; height: 8px; border-radius: 999px; background: #efe9db; vertical-align: middle; overflow: hidden; }
.share-fill { display: block; height: 100%; background: #a87b00; border-radius: 999px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; padding: 0.65rem 1.15rem; border-radius: 999px; font: inherit; font-weight: 700; font-size: 0.92rem; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: transform 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: var(--accent-ink); box-shadow: 0 10px 24px rgba(194, 143, 0, 0.24); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn.small { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn.full { width: 100%; }
button.link, .link { background: none; border: 0; padding: 0; font: inherit; font-size: 0.88rem; font-weight: 700; color: var(--accent-deep); cursor: pointer; text-decoration: none; }
.form { display: grid; gap: 0.85rem; }
.form.row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) auto; align-items: end; }
label { display: grid; gap: 0.3rem; font-weight: 700; font-size: 0.88rem; }
label.check { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], input:not([type]), select {
  font: inherit; font-weight: 500; padding: 0.65rem 0.8rem; border-radius: 10px; border: 1px solid rgba(0, 0, 0, 0.14); background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus { outline: 2px solid rgba(194, 143, 0, 0.35); outline-offset: 1px; border-color: var(--accent); }
.radio-list { border: 0; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.radio-list legend { font-weight: 700; font-size: 0.88rem; margin-bottom: 0.3rem; }
.radio-list label { display: flex; gap: 0.5rem; font-weight: 600; }
.period { display: flex; align-items: center; gap: 0.5rem; }
.period label { font-size: 0.8rem; color: var(--muted); }
.period select { width: auto; padding: 0.45rem 0.7rem; }
form.inline { display: inline; }
.hp { position: absolute; left: -9999px; }
.inline-search input { max-width: 520px; }

.pick-list { display: grid; gap: 0.4rem; margin-top: 0.4rem; }
.pick { display: grid; text-align: left; gap: 0.1rem; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; color: var(--text); text-decoration: none; }
.pick:hover { border-color: var(--accent); background: var(--soft); }
.pick span { font-size: 0.82rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; min-height: 1.5rem; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.8rem; border-radius: 999px; background: #fff4d6; font-weight: 700; font-size: 0.85rem; }
ul.plain { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.4rem; }

/* ---------- plans ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.3rem; display: grid; gap: 0.5rem; box-shadow: var(--shadow); }
.plan.featured { background: linear-gradient(140deg, #fff8ea, #fffdf7); border-color: rgba(194, 143, 0, 0.35); }
.plan-name { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.3rem; margin: 0; }
.price { font-size: 1.8rem; font-weight: 800; margin: 0; }
.price span { font-size: 0.9rem; color: var(--muted); font-weight: 600; }

/* ---------- messages ---------- */
.flash { padding: 0.8rem 1rem; border-radius: 12px; background: #e9f7ee; border: 1px solid #b7e3c6; font-weight: 600; margin-bottom: 1rem; }
.flash.err { background: #fdecec; border-color: #f4c2c2; color: #7f1d1d; }
.note { font-size: 0.88rem; color: var(--muted); border-left: 3px solid var(--accent); padding: 0.6rem 0.9rem; background: rgba(255, 255, 255, 0.7); border-radius: 0 10px 10px 0; }
.viewas { background: #1c2233; color: #fff; padding: 0.6rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-size: 0.9rem; }
.viewas button.link { color: #ffd76a; }
.status { font-size: 0.78rem; font-weight: 800; text-transform: capitalize; padding: 0.15rem 0.55rem; border-radius: 999px; background: #eee; }
.status.s-active, .status.s-trialing { background: #dcfce7; color: #166534; }
.status.s-past_due, .status.s-pending { background: #fef3c7; color: #92400e; }
.status.s-canceled { background: #fee2e2; color: #991b1b; }
.stat-line { font-size: 1.05rem; }
.foot { margin-top: 2rem; font-size: 0.78rem; color: var(--faint); }

/* ---------- auth ---------- */
.auth { padding-top: 6vh; }
.auth-brand { display: flex; align-items: center; gap: 0.6rem; justify-content: center; font-weight: 800; color: var(--text); text-decoration: none; margin-bottom: 1rem; font-size: 1.1rem; }
.auth-brand img { height: 44px; width: auto; }

/* ---------- reports ---------- */
.report-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.3rem; padding-bottom: 1rem; border-bottom: 2px solid rgba(194, 143, 0, 0.35); }
.report-kicker { font-weight: 800; color: var(--accent-deep); margin: 0 0 0.2rem; font-size: 0.9rem; }
.report-foot { font-size: 0.78rem; color: var(--faint); margin-top: 1rem; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  body.has-nav { padding-left: 0; }
  .side { position: sticky; top: 0; width: auto; inset: auto; padding: 0.6rem 16px; border-right: 0; border-bottom: 1px solid var(--line); max-height: 100vh; }
  .brand { border: 0; padding: 0.2rem 0; }
  .org-name { display: none; }
  .menu > summary { display: block; position: absolute; top: 0.85rem; right: 16px; list-style: none; cursor: pointer; font-weight: 700; font-size: 0.9rem; padding: 0.4rem 0.9rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
  .menu > summary::-webkit-details-marker { display: none; }
  .main { padding: 1.2rem 16px 2.5rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .form.row { grid-template-columns: 1fr; }
  .kpi-value { font-size: 1.45rem; }
}

/* ---------- print (Snapshot reports) ---------- */
@media print {
  body { background: #fff !important; padding: 0 !important; }
  .side, .no-print, .foot, .toggle-table, .viewas, .flash { display: none !important; }
  .main { max-width: none; padding: 0; }
  .card, .chart-card, .kpi { box-shadow: none; break-inside: avoid; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  a { color: inherit; text-decoration: none; border: 0; }
  @page { margin: 14mm; }
}
