/* ==========================================================================
   WolfPack Global Health — "Health in the Light" dashboard mockup
   Design tokens (plan §5). These variables are the contract for the real
   implementation: change them here first, then mirror in apps/globalhealth.
   ========================================================================== */
:root {
  --gh-bg:            #F7F4EE;   /* warm ivory / off-white, page ground */
  --gh-surface:       #FFFFFF;   /* cards */
  --gh-sand:          #EDE6DA;   /* sand / earth: hero grounds, dividers */
  --gh-sage:          #DCE7DF;   /* sage / eucalyptus: soft fills, hover, active */
  --gh-sage-deep:     #7FA08C;   /* illustration tone, wolf */
  --gh-text:          #2B2F2C;   /* warm anthracite */
  --gh-text-muted:    #6A716C;
  --gh-border:        #E9E5DD;
  --gh-green:         #01FF9F;   /* WolfPack green: emblem + signature accents only */
  --gh-green-action:  #0E8F5E;   /* buttons, links, active states (AA on white) */
  --gh-green-action-hover: #0B7A50;
  --gh-gold:          #C9A96A;   /* accent: founding badges, premium hints */
  --gh-gold-soft:     #F4EBD9;
  --gh-rose:          #E8C4C0;   /* accent: very sparing */
  --gh-rose-soft:     #F8ECEA;
  --gh-radius:        18px;
  --gh-radius-sm:     12px;
  --gh-shadow:        0 6px 28px rgba(43, 47, 44, .06);
  --gh-shadow-hover:  0 10px 34px rgba(43, 47, 44, .10);
  --gh-font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --sidebar-w:        272px;
  --mockbar-h:        44px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--gh-font);
  background: var(--gh-bg);
  color: var(--gh-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gh-green-action); text-decoration: none; }
a:hover { color: var(--gh-green-action-hover); }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
.muted { color: var(--gh-text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------------------------
   Reviewer bar — NOT part of the product. Switches the three role views.
   -------------------------------------------------------------------------- */
.mockbar {
  position: fixed; inset: 0 0 auto 0; height: var(--mockbar-h); z-index: 50;
  background: #2B2F2C; color: #F7F4EE; display: flex; align-items: center; gap: 14px;
  padding: 0 16px; font-size: 13px;
}
.mockbar__label { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; opacity: .7; }
.mockbar__group { display: flex; gap: 4px; background: rgba(255,255,255,.08); border-radius: 999px; padding: 3px; }
.mockbar__group button {
  border: 0; background: transparent; color: inherit; border-radius: 999px; padding: 4px 12px; font-size: 13px;
}
.mockbar__group button[aria-pressed="true"] { background: var(--gh-green); color: #1a2b22; font-weight: 600; }
.mockbar__spacer { flex: 1; }
.mockbar__hint { opacity: .6; }
@media (max-width: 720px) { .mockbar__hint { display: none; } }

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; padding-top: var(--mockbar-h); }

.sidebar {
  background: var(--gh-surface); border-right: 1px solid var(--gh-border);
  position: sticky; top: var(--mockbar-h); height: calc(100vh - var(--mockbar-h));
  display: flex; flex-direction: column; padding: 22px 16px 16px;
}
.brand { display: flex; align-items: center; justify-content: center; padding: 8px 8px 22px; }
.brand img { width: 128px; height: auto; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__title {
  margin: 18px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gh-text-muted);
}
.nav__link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--gh-radius-sm);
  color: var(--gh-text); font-weight: 500; border: 0; background: transparent; width: 100%; text-align: left; font-size: 15px;
}
.nav__link:hover { background: var(--gh-bg); color: var(--gh-text); }
.nav__link.is-active { background: var(--gh-sage); color: #1f3a2c; font-weight: 600; }
.nav__link .icon { color: var(--gh-green-action); }
.nav__link.is-active .icon { color: #1f3a2c; }
.nav__badge { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--gh-sage); color: #1f3a2c; border-radius: 999px; padding: 2px 8px; }
.nav__link--support { margin-top: 6px; color: var(--gh-green-action); }

/* Role-driven blocks: hidden unless the view has the role. "No role = not rendered".
   The hide rule is !important so it beats every component display rule below. */
body:not([data-view="practitioner"]) [data-role="practitioner"] { display: none !important; }
body:not([data-view="admin"]) [data-role="admin"] { display: none !important; }
.nav__group[data-role="admin"] { display: block; }

/* Collapsible admin group — closed by default (customer answer 11). */
.nav__group summary {
  list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--gh-radius-sm);
  color: var(--gh-text-muted); font-weight: 500; cursor: pointer; font-size: 15px;
}
.nav__group summary::-webkit-details-marker { display: none; }
.nav__group summary:hover { background: var(--gh-bg); }
.nav__group summary .chev { margin-left: auto; transition: transform .2s; }
.nav__group[open] summary .chev { transform: rotate(90deg); }
.nav__group .nav__link { padding-left: 44px; font-size: 14px; color: var(--gh-text-muted); }
.nav__group .nav__link .icon { display: none; }

.sidebar__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--gh-border); }
.userchip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--gh-radius-sm); }
.userchip:hover { background: var(--gh-bg); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--gh-sage), var(--gh-sand)); display: grid; place-items: center; font-weight: 600; color: #1f3a2c; font-size: 14px; }
.userchip__name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.userchip__sub { font-size: 12px; color: var(--gh-text-muted); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.main { min-width: 0; }
.header {
  position: sticky; top: var(--mockbar-h); z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 14px 32px; background: rgba(247, 244, 238, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--gh-border);
}
.header__burger { display: none; }
.header__title { font-size: 15px; font-weight: 600; color: var(--gh-text-muted); }
.header__spacer { flex: 1; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gh-border); background: var(--gh-surface); display: grid; place-items: center; color: var(--gh-text); position: relative; }
.iconbtn:hover { background: var(--gh-sage); }
.iconbtn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--gh-green-action); border: 2px solid var(--gh-surface); }

/* The always-visible support entry (customer principle 5). */
.btn-support {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; border: 0;
  background: var(--gh-green-action); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(14, 143, 94, .25);
}
.btn-support:hover { background: var(--gh-green-action-hover); }
.btn-support .icon { stroke: #fff; }
.btn-support--fab { display: none; }

/* --------------------------------------------------------------------------
   Content
   -------------------------------------------------------------------------- */
.content { padding: 28px 32px 48px; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

.card {
  background: var(--gh-surface); border-radius: var(--gh-radius); box-shadow: var(--gh-shadow); padding: 24px 26px;
  border: 1px solid rgba(233, 229, 221, .6);
}
.card--flat { box-shadow: none; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 14px; }
.btn-primary { background: var(--gh-green-action); color: #fff; }
.btn-primary:hover { background: var(--gh-green-action-hover); }
.btn-primary .icon { stroke: #fff; }
.btn-outline { background: transparent; border-color: var(--gh-border); color: var(--gh-text); }
.btn-outline:hover { background: var(--gh-bg); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill--active { background: var(--gh-sage); color: #1f3a2c; }
.pill--active::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gh-green-action); }
.pill--soon { background: var(--gh-sand); color: var(--gh-text-muted); }
.pill--gold { background: var(--gh-gold-soft); color: #6f5624; }
.pill--rose { background: var(--gh-rose-soft); color: #7a4a45; }

/* Founding badges: gold accent, two independent honours. */
.badge-founding { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--gh-gold-soft); color: #6f5624; font-size: 12px; font-weight: 700; letter-spacing: .02em; border: 1px solid rgba(201, 169, 106, .35); }
.badge-founding .icon { width: 14px; height: 14px; stroke: #6f5624; }

/* 1 — Welcome: the wolf sits at the right edge, looking INTO the content. */
.welcome {
  position: relative; overflow: hidden; padding: 34px 38px 30px; border-radius: var(--gh-radius);
  background: linear-gradient(135deg, #FBF9F4 0%, var(--gh-sand) 100%); border: 1px solid rgba(233, 229, 221, .8);
}
.welcome h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.welcome__q { font-size: 20px; color: var(--gh-text-muted); margin-top: 6px; font-weight: 400; }
.welcome__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.welcome__claim { margin-top: 26px; font-size: 12px; font-weight: 800; letter-spacing: .22em; color: var(--gh-green-action); }
.welcome__claim span { color: var(--gh-text-muted); font-weight: 600; letter-spacing: .12em; margin-left: 12px; text-transform: none; }
.wolf {
  position: absolute; right: -10px; bottom: -18px; width: 330px; height: auto; color: var(--gh-sage-deep); opacity: .16; pointer-events: none;
}
[dir="rtl"] .wolf { right: auto; left: -10px; transform: scaleX(-1); }

/* 2 — Dr. Future hero: the one thing that explains the membership in three seconds. */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; padding: 30px 34px; }
.hero__kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gh-green-action); }
.hero h2 { font-size: 28px; margin-top: 8px; }
.hero__sub { color: var(--gh-text-muted); margin-top: 6px; font-size: 16px; }
.hero__ask {
  margin-top: 18px; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 20px; border-radius: 999px;
  background: var(--gh-bg); border: 1px solid var(--gh-border); max-width: 560px;
}
.hero__ask input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--gh-text); outline: none; }
.hero__ask input::placeholder { color: var(--gh-text-muted); }
.hero__note { margin-top: 12px; font-size: 13px; color: var(--gh-text-muted); }
.hero__side { display: grid; gap: 12px; }
.hero__fact { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--gh-radius-sm); background: var(--gh-sage); color: #1f3a2c; }
.hero__fact .icon { color: var(--gh-green-action); margin-top: 2px; }
.hero__fact strong { display: block; font-size: 14px; }
.hero__fact span { font-size: 13px; color: #3f5a4a; }

/* 3 — Health cards */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-top: 4px; }
.section-title h3 { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gh-text-muted); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hcard {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: var(--gh-radius);
  background: var(--gh-surface); box-shadow: var(--gh-shadow); border: 1px solid rgba(233, 229, 221, .6);
  color: var(--gh-text); text-align: left; transition: transform .18s ease, box-shadow .18s ease;
}
a.hcard:hover { transform: translateY(-3px); box-shadow: var(--gh-shadow-hover); color: var(--gh-text); }
.hcard__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--gh-sage); color: var(--gh-green-action); }
.hcard__icon .icon { width: 24px; height: 24px; }
.hcard h4 { font-size: 17px; }
.hcard p { color: var(--gh-text-muted); font-size: 14px; }
.hcard__go { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--gh-green-action); display: flex; align-items: center; gap: 6px; }
/* Coming soon (customer answers 5/6): clearly a future function, not a dead link, not greyed into invisibility. */
.hcard--soon { box-shadow: none; background: rgba(255, 255, 255, .6); border-style: dashed; cursor: default; }
.hcard--soon .hcard__icon { background: var(--gh-sand); color: var(--gh-text-muted); }
.hcard--soon .pill { position: absolute; top: 16px; right: 16px; }
.hcard--soon h4 { color: var(--gh-text-muted); }

/* 4–6 — Membership, points, appointments */
.grid-3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; align-items: start; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__head h3 { font-size: 16px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 14px 0; }
.kv dt { font-size: 12px; color: var(--gh-text-muted); margin: 0; }
.kv dd { margin: 0; font-weight: 600; font-size: 14px; }
.membership__plan { font-size: 20px; font-weight: 700; }
.membership__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.upgrade { margin-top: 14px; padding: 14px; border-radius: var(--gh-radius-sm); background: var(--gh-gold-soft); font-size: 13px; }
.upgrade strong { display: block; margin-bottom: 4px; color: #6f5624; }

.stat { display: flex; align-items: baseline; gap: 8px; }
.stat__num { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.stat__lbl { font-size: 13px; color: var(--gh-text-muted); }
.bar { height: 8px; border-radius: 999px; background: var(--gh-sand); overflow: hidden; margin: 10px 0 6px; }
.bar > i { display: block; height: 100%; width: 62%; background: linear-gradient(90deg, var(--gh-green-action), var(--gh-green)); border-radius: 999px; }
.small { font-size: 13px; }

.appt { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--gh-border); }
.appt:first-of-type { border-top: 0; padding-top: 0; }
.appt__date { width: 46px; text-align: center; border-radius: 10px; background: var(--gh-sage); color: #1f3a2c; padding: 6px 0; line-height: 1.1; flex: 0 0 auto; }
.appt__date b { display: block; font-size: 18px; }
.appt__date span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.appt__title { font-weight: 600; font-size: 14px; }
.appt__meta { font-size: 12px; color: var(--gh-text-muted); }

/* Practitioner-only area (role: practitioner) */
.area { display: flex; align-items: center; gap: 18px; padding: 20px 24px; background: linear-gradient(135deg, #FFFFFF, var(--gh-sage)); }
.area__icon { width: 52px; height: 52px; border-radius: 16px; background: var(--gh-surface); display: grid; place-items: center; color: var(--gh-green-action); box-shadow: var(--gh-shadow); }
.area h3 { font-size: 17px; }
.area p { color: var(--gh-text-muted); font-size: 14px; }
.area .btn { margin-left: auto; }

/* 7 — Newsletter: deliberately quiet, last. */
.quiet { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-radius: var(--gh-radius-sm); border: 1px dashed var(--gh-border); color: var(--gh-text-muted); font-size: 13px; }

/* --------------------------------------------------------------------------
   Support overlay — three ways, the system routes.
   -------------------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(43, 47, 44, .38); display: none; align-items: center; justify-content: center; padding: 20px; }
.overlay.is-open { display: flex; }
.modal { width: min(720px, 100%); background: var(--gh-surface); border-radius: 22px; padding: 30px; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); position: relative; }
.modal__close { position: absolute; top: 14px; right: 14px; }
.modal h2 { font-size: 24px; }
.modal__sub { color: var(--gh-text-muted); margin-top: 4px; }
.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.way { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--gh-radius); border: 1px solid var(--gh-border); background: var(--gh-bg); text-align: left; color: var(--gh-text); }
.way:hover { background: var(--gh-sage); border-color: transparent; }
.way .hcard__icon { width: 40px; height: 40px; border-radius: 12px; }
.way strong { font-size: 15px; }
.way span { font-size: 13px; color: var(--gh-text-muted); }
.modal__route { margin-top: 18px; padding: 12px 16px; border-radius: var(--gh-radius-sm); background: var(--gh-sage); color: #1f3a2c; font-size: 14px; display: none; }
.modal__route.is-visible { display: block; }
.modal__foot { margin-top: 16px; font-size: 12px; color: var(--gh-text-muted); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; }
  .wolf { width: 260px; opacity: .12; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: var(--mockbar-h); width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s ease; z-index: 40; box-shadow: none; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
  .header { padding: 12px 16px; }
  .header__burger { display: grid; }
  .btn-support--header { display: none; }
  .btn-support--fab { display: inline-flex; position: fixed; right: 16px; bottom: 16px; z-index: 30; }
  .content { padding: 18px 16px 90px; gap: 16px; }
  .welcome { padding: 24px 20px; }
  .welcome h1 { font-size: 26px; }
  .welcome__q { font-size: 17px; }
  .wolf { display: none; }
  .hero { padding: 22px 20px; }
  .hero h2 { font-size: 22px; }
  .hero__ask { flex-direction: column; align-items: stretch; border-radius: var(--gh-radius); padding: 14px; }
  .hero__ask input { padding: 6px 4px; }
  .hero__ask .btn { justify-content: center; }
  .welcome__claim span { display: block; margin: 6px 0 0; }
  .btn-support--fab { padding: 12px 18px; }
  .grid-3 { grid-template-columns: 1fr; }
  .ways { grid-template-columns: 1fr; }
  .area { flex-wrap: wrap; }
  .area .btn { margin-left: 0; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}
