/* WavvyBaby Creator Portal — portal layer on top of brand/wavvybaby-tokens.css.
   Spec: WAVVYBABY-DESIGN-SYSTEM.md v1.0. Every value below is a token or an
   exact spec value; no invented colors, radii, or shadows.
   Key rules honoured here:
   - One text color (#102463). Hierarchy = size + weight, never grey.
   - Headings Athletics 700 blue, negative tracking. Body Lato.
   - Pill radius ONLY on buttons and inputs. Badges are 8px. Cards 16px,
     panels/tables 22px.
   - Navy-tinted layered shadows. House hover = translateY(-1px). */

/* --- Header ------------------------------------------------------------- */
.site-header { background: var(--wavvy-canvas); border-bottom: 1px solid var(--wavvy-hairline); }
.logo-link { display: flex; align-items: baseline; gap: .6rem; text-decoration: none; }
.logo-sub {
  font: 600 .78rem/1 var(--wb-font-display);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--wavvy-blue); white-space: nowrap;
}
/* Portal nav: same look as .wb-nav, but it must survive phones without a
   drawer — few links, so it wraps instead of hiding. */
.portal-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: clamp(.9rem, 2.2vw, 2.2rem) }
.portal-nav a:not(.wb-nav-cta) {
  font: 500 .9rem/1 var(--wb-font-display);
  letter-spacing: .01em; color: var(--wavvy-ink);
  text-decoration: none; position: relative; padding: .25rem 0;
  transition: color var(--wb-t-base) ease;
}
.portal-nav a:not(.wb-nav-cta):hover { color: var(--wavvy-blue); }
.portal-nav a:not(.wb-nav-cta)::after {
  content: ""; position: absolute; left: 50%; bottom: -.2rem;
  width: 0; height: 1.5px; background: var(--wavvy-blue); border-radius: 2px;
  transition: width var(--wb-t-slow) ease, left var(--wb-t-slow) ease;
}
.portal-nav a:not(.wb-nav-cta):hover::after { width: 100%; left: 0; }

/* --- Page scaffold -------------------------------------------------------- */
.portal-main { padding-top: clamp(1.8rem, 3.5vw, 2.6rem); padding-bottom: var(--wb-sec-y); }
.wrap { max-width: var(--wb-max); margin: 0 auto; padding: 0 var(--wb-gutter); }

/* Headings: element-level so existing templates inherit the brand scale. */
h1 { font: 700 clamp(2.3rem, 4.9vw, 3.8rem)/1.06 var(--wb-font-display); letter-spacing: -.018em; color: var(--wavvy-blue); margin: 0 0 .65rem; }
h2 { font: 700 clamp(1.7rem, 3vw, 2.4rem)/1.1 var(--wb-font-display); letter-spacing: -.022em; color: var(--wavvy-blue); margin: 0 0 .65rem; }
h3 { font: 700 clamp(1.05rem, 1.4vw, 1.2rem)/1.3 var(--wb-font-display); letter-spacing: -.005em; color: var(--wavvy-blue); margin: 1.8rem 0 .6rem; }

/* One ink. "Muted" = smaller, not grey (spec §2 rule 2). */
.muted { color: var(--wavvy-ink); font-weight: 400; }
.small, .muted.small { font: 500 .85rem/1.4 var(--wb-font-body); color: var(--wavvy-ink); }

a { color: var(--wavvy-blue); }

/* --- Hero (landing) ------------------------------------------------------- */
.hero {
  background: var(--wavvy-tint);
  border-radius: var(--wb-r-panel);
  padding: clamp(3rem, 5.5vw, 5rem) clamp(1.5rem, 4vw, 3rem);
  text-align: center;
}
.hero h1 { margin-top: 0; }
.hero p { max-width: 32rem; margin-left: auto; margin-right: auto; }

/* --- Cards & stats ---------------------------------------------------------- */
.card {
  background: var(--wavvy-canvas);
  border-radius: var(--wb-r-card);
  padding: 1.5rem 1.35rem;
  margin: 1.25rem 0;
  box-shadow: var(--wb-shadow-card);
}
.card.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: clamp(.9rem, 1.8vw, 1.25rem); margin: 1.5rem 0;
}
.stat {
  background: var(--wavvy-canvas);
  border-radius: var(--wb-r-card);
  padding: 1.25rem 1.2rem;
  box-shadow: var(--wb-shadow-card);
}
.stat.highlight { background: var(--wavvy-tint); }
.stat-num {
  font: 700 1.7rem/1.2 var(--wb-font-display);
  letter-spacing: -.018em; color: var(--wavvy-blue);
}
.stat-label { font: 500 .85rem/1.4 var(--wb-font-body); color: var(--wavvy-ink); margin-top: .25rem; }

/* --- Link box (creator's share link) ------------------------------------- */
.linkbox {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.25rem; flex-wrap: wrap;
  background: var(--wavvy-tint-deep);
  border-radius: var(--wb-r-img);
  padding: 1.25rem 1.35rem; margin: 1.5rem 0;
}
.label {
  font: 600 .78rem/1 var(--wb-font-display);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--wavvy-blue); margin-bottom: .5rem;
}
code.link {
  display: block; word-break: break-all;
  background: var(--wavvy-canvas);
  border-radius: var(--wb-r-tile);
  padding: .65rem .8rem;
  font: 500 .9rem/1.45 var(--wb-font-body);
  color: var(--wavvy-ink);
  box-shadow: inset 0 0 0 1px rgba(164, 182, 224, .3);
}
code.link.small { font-size: .78rem; }

/* --- Tables ----------------------------------------------------------------- */
table {
  width: 100%; border-collapse: collapse;
  background: var(--wavvy-canvas);
  border-radius: var(--wb-r-panel); overflow: hidden;
  box-shadow: var(--wb-shadow-panel);
  font: 400 .94rem/1.5 var(--wb-font-body);
}
th, td { text-align: left; padding: 1rem; }
thead th { font: 700 .95rem/1.2 var(--wb-font-display); color: var(--wavvy-blue); }
tbody td { color: var(--wavvy-ink); border-bottom: 1px solid var(--wavvy-hairline-row); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(15, 44, 73, .015); }

/* --- Forms: pill inputs, 1.5px border, blue on focus (spec §7 Forms) ------ */
label {
  display: block; margin: .9rem 0;
  font: 600 .88rem/1.3 var(--wb-font-display);
  color: var(--wavvy-ink);
}
label.wide { grid-column: 1 / -1; }
label.check-row { display: flex; align-items: center; gap: .55rem; font: 500 .9rem/1.4 var(--wb-font-body); }
label.check-row input { width: auto; margin: 0; accent-color: var(--wavvy-blue); }
input, select {
  display: block; width: 100%; margin-top: .4rem;
  padding: .75rem 1.1rem;
  border: 1.5px solid rgba(15, 44, 73, .15);
  border-radius: var(--wb-r-pill);
  font: 500 .9rem/1.4 var(--wb-font-body);
  color: var(--wavvy-ink); background: var(--wavvy-canvas);
  transition: border-color var(--wb-t-base) ease;
}
input:focus, select:focus { outline: none; border-color: var(--wavvy-blue); }
input::placeholder { color: rgba(16, 36, 99, .45); }
input[type="file"] { border-radius: var(--wb-r-card); padding: .6rem .8rem; }
input[type="month"] { width: auto; display: inline-block; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
@media (max-width: 749px) { .grid2 { grid-template-columns: 1fr; } }

/* --- Buttons: three variants, pills (spec §7). Outline is the workhorse;
   .primary is the ONE solid per view. ---------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: var(--wb-r-pill); border: 0; cursor: pointer;
  font: 600 .95rem/1 var(--wb-font-display);
  padding: .95rem 1.7rem; margin-top: .5rem;
  text-decoration: none;
  background: #fff; color: var(--wavvy-blue);
  box-shadow: inset 0 0 0 1.5px var(--wavvy-blue);
  outline: 2px solid transparent; outline-offset: 3px;
  transition: transform var(--wb-t-slow) var(--wb-ease),
              background-color var(--wb-t-slow),
              box-shadow var(--wb-t-slow),
              outline-color var(--wb-t-fast);
}
.btn:hover {
  background: #F2F4FA; color: var(--wavvy-blue);
  box-shadow: inset 0 0 0 1.5px var(--wavvy-blue-deep);
  transform: translateY(-1px);
}
.btn:focus-visible { outline-color: var(--wavvy-blue); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--wavvy-blue); color: #fff;
  box-shadow: var(--wb-shadow-cta);
}
.btn.primary:hover {
  background: var(--wavvy-blue-deep); color: #fff;
  box-shadow: var(--wb-shadow-cta-h);
}
.btn.small { padding: .65rem 1.2rem; font-size: .88rem; }
/* Legacy alias from earlier templates — same as the outline base. */
.btn.ghost { margin-left: .5rem; }

/* --- Badges (status "pills" are NOT pills — 8px chips, spec §4) ------------ */
.pill {
  display: inline-block;
  border-radius: var(--wb-r-chip);
  padding: .3rem .6rem;
  font: 600 .7rem/1 var(--wb-font-display);
  letter-spacing: .06em; text-transform: uppercase;
}
.pill.paid, .pill.active { background: var(--wavvy-green-soft); color: var(--wavvy-green-deep); }
.pill.pending { background: var(--wavvy-tint-deep); color: var(--wavvy-ink); }
.pill.paused, .pill.archived, .pill.error { background: var(--wavvy-oat); color: var(--wavvy-ink); }

/* --- Flash messages --------------------------------------------------------- */
.flashes { margin-bottom: 1.25rem; }
.flash {
  border-radius: var(--wb-r-tile);
  padding: .8rem 1.1rem; margin-bottom: .5rem;
  font: 500 .95rem/1.5 var(--wb-font-body);
  color: var(--wavvy-ink);
}
.flash.success { background: var(--wavvy-green-soft); color: var(--wavvy-green-deep); }
.flash.error {
  background: #fff; color: var(--wavvy-coral-text);
  box-shadow: inset 0 0 0 1.5px var(--wavvy-coral);
}
.flash.error::before { content: "⚠ "; }
.flash.info { background: var(--wavvy-tint-deep); }

/* --- Misc ------------------------------------------------------------------- */
.inline-form { display: inline-block; margin: 0 .25rem .25rem 0; }
.inline-form .btn { margin-top: 0; }
details summary {
  cursor: pointer;
  font: 500 .85rem/1.6 var(--wb-font-body); color: var(--wavvy-ink);
}
details summary:hover { color: var(--wavvy-blue); }
canvas { max-width: 100%; }

/* Tables are the only permitted horizontal scroller (spec §8). */
@media (max-width: 749px) {
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .logo-sub { display: none; }
}
