/* ============================================================
   TipLink Design System
   Direction: modern fintech x creator economy, built on the
   TipLink wordmark palette - deep navy + teal, with the logo's
   green and orange dot accents used sparingly for highlights.
   Dark navy sidebar, teal->green->orange signal gradient,
   bento-style stat cards, generous whitespace.
   ============================================================ */

:root {
  --ink-900: #0a1836;
  --ink-800: #11234f;
  --ink-700: #1a3363;
  --ink-600: #244577;
  --surface: #ffffff;
  --surface-soft: #faf9f7;
  --surface-muted: #eaf3f4;
  --border: #dde6e8;
  --text-900: #11234f;
  --text-600: #4c5b73;
  --text-400: #8893a6;

  /* Exact TipLink wordmark palette. */
  --navy: #11234f;
  --navy-dark: #0a1836;
  --teal: #23899e;
  --teal-dark: #1b6c7d;
  --brand-green: #27b27c;
  --brand-orange: #f08e32;
  --brand-lime: #b1dd68;
  --brand-yellow-green: #d7e663;
  --amber: #f5a623;
  --green: #1fb178;
  --red: #e4483f;

  /* Aliases so any remaining var(--violet*) reference keeps working. */
  --violet: var(--teal);
  --violet-dark: var(--teal-dark);
  --pink: var(--brand-orange);

  --gradient-signal: linear-gradient(120deg, #23899e 0%, #27b27c 55%, #f08e32 100%);
  --gradient-ink: linear-gradient(180deg, #1a3363 0%, #0a1836 100%);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 1px 2px rgba(17, 35, 79, 0.05), 0 8px 24px -8px rgba(17, 35, 79, 0.12);
  --shadow-pop: 0 12px 32px -8px rgba(35, 137, 158, 0.35);

  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  /* "Glass" nav/topbar backgrounds - separate tokens since their light
     values are two different near-white tints, not the plain --surface. */
  --nav-glass: rgba(255,255,255,.85);
  --topbar-glass: rgba(246,245,251,.9);

  color-scheme: light;
}

/* ============================================================
   Dark mode
   Sidebars and hero sections stay on var(--gradient-ink) in BOTH modes -
   that's brand identity, not a light/dark surface, so it's untouched here.
   This retheme's the light surfaces instead: cards, page background,
   borders, and body text. Toggled via data-theme on <html> (see
   assets/js/theme.js + the inline snippet in includes/head.php that sets
   it before first paint, avoiding a flash of the wrong theme); falls back
   to the OS-level preference when no explicit choice has been made yet.
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #141b2e;
    --surface-soft: #0b0f1a;
    --surface-muted: #1b2338;
    --border: #2b3552;
    --text-900: #eef1f7;
    --text-600: #a9b2c7;
    --text-400: #78829c;
    --shadow-card: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px -8px rgba(0,0,0,.6);
    --nav-glass: rgba(11,15,26,.85);
    --topbar-glass: rgba(11,15,26,.9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #141b2e;
  --surface-soft: #0b0f1a;
  --surface-muted: #1b2338;
  --border: #2b3552;
  --text-900: #eef1f7;
  --text-600: #a9b2c7;
  --text-400: #78829c;
  --shadow-card: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px -8px rgba(0,0,0,.6);
  --nav-glass: rgba(11,15,26,.85);
  --topbar-glass: rgba(11,15,26,.9);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--surface-soft);
  color: var(--text-900);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}
p { margin: 0 0 0.75em; color: var(--text-600); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--gradient-signal); color: #fff; box-shadow: var(--shadow-pop); }
.btn-primary:hover { box-shadow: 0 16px 36px -8px rgba(35,137,158,.45); }
.btn-dark { background: var(--ink-900); color: #fff; }
.btn-dark:hover { background: var(--ink-700); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-900); }
.btn-outline:hover { border-color: var(--violet); color: var(--violet); }
.btn-ghost { background: var(--surface-muted); color: var(--text-900); }
.btn-ghost:hover { background: var(--border); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 16px; height: 16px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.card-pad { padding: 24px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-900); margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--text-400); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  font-size: 14.5px; font-family: inherit; background: var(--surface); color: var(--text-900);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, select.input:focus, textarea.input:focus {
  outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(35,137,158,.12);
}
.input-group { display: flex; gap: 10px; }
.input-prefix {
  display: flex; align-items: center; padding: 0 14px; border-radius: var(--radius-sm);
  background: var(--surface-muted); color: var(--text-600); font-weight: 600; font-size: 14px; border: 1.5px solid var(--border);
}
.checkbox-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-600); }

.password-field { position: relative; }
.password-field .input { padding-right: 42px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 6px; color: var(--text-400);
  display: flex; align-items: center; justify-content: center; border-radius: 6px;
}
.password-toggle:hover { color: var(--teal); background: var(--surface-muted); }
.password-toggle svg { width: 18px; height: 18px; }
.password-toggle svg[hidden] { display: none; }

/* ---------- Alerts ---------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; display: flex; gap: 10px; align-items: flex-start; }
.alert-error { background: #fdecec; color: #9a231d; border: 1px solid #f6c7c4; }
.alert-success { background: #e9f9f1; color: #106b48; border: 1px solid #bfeed8; }
.alert-info { background: #eef0ff; color: #3b3aa8; border: 1px solid #d6d8ff; }
.alert-sandbox { background: #fff7e6; color: #8a5a00; border: 1px solid #ffe4a3; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .01em; }
.badge-green { background: #e6f8f0; color: var(--green); }
.badge-amber { background: #fef3e0; color: #b3720a; }
.badge-red { background: #fdecec; color: var(--red); }
.badge-gray { background: var(--surface-muted); color: var(--text-600); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============================================================
   Marketing site
   ============================================================ */
.mkt-nav { position: sticky; top: 0; z-index: 20; background: var(--nav-glass); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.mkt-nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--gradient-signal); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; font-weight: 800; box-shadow: var(--shadow-pop); }
.logo-img { height: 26px; width: auto; display: block; }
/* The real logo's navy half is naturally low-contrast on a navy sidebar
   (two-tone artwork, not a rendering bug) - a soft light glow lifts it
   slightly without altering the source colors. */
.mkt-links { display: flex; align-items: center; gap: 28px; font-size: 14.5px; font-weight: 600; color: var(--text-600); }
.mkt-links a:hover { color: var(--text-900); }

.hero { padding: 96px 24px 60px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -20% -10% auto -10%; height: 520px;
  background: radial-gradient(60% 60% at 50% 30%, rgba(35,137,158,.18), transparent 70%);
  z-index: -1;
}
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--surface-muted); font-size: 13px; font-weight: 700; color: var(--violet-dark); margin-bottom: 22px; }
.hero h1 { font-size: clamp(2.4rem, 2rem + 2.4vw, 4.2rem); max-width: 820px; margin: 0 auto 20px; }
.hero .lead { font-size: 18.5px; max-width: 560px; margin: 0 auto 34px; color: var(--text-600); }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-mock { max-width: 940px; margin: 64px auto 0; border-radius: 28px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(20,19,31,.35); border: 1px solid var(--border); }

.pain-grid, .feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.section { padding: 88px 24px; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 52px; }
.section-head h2 { font-size: clamp(1.9rem, 1.6rem + 1vw, 2.6rem); margin-bottom: 14px; }
.pain-card, .feat-card { padding: 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.pain-card .icon, .feat-card .icon {
  width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-muted); margin-bottom: 18px; font-size: 20px;
}
.pain-card h3, .feat-card h3 { font-size: 17px; margin-bottom: 8px; }
.pain-card p, .feat-card p { font-size: 14.5px; }
.pain-card.negative .icon { background: #fdecec; }

.dark-section { background: var(--gradient-ink); color: #fff; border-radius: 32px; margin: 0 24px; padding: 72px 40px; }
.dark-section p { color: #b7b5c9; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 40px; }
.step-card { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-md); padding: 22px; }
.step-num { font-family: var(--font-display); font-size: 30px; font-weight: 700; background: var(--gradient-signal); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 10px; }
.step-card h4 { font-size: 15px; margin-bottom: 6px; color: #fff; }
.step-card p { font-size: 13.5px; margin: 0; }

.cta-band { text-align: center; padding: 90px 24px; }
.cta-band h2 { font-size: clamp(1.9rem, 1.6rem + 1vw, 2.7rem); margin-bottom: 16px; }

.site-footer { border-top: 1px solid var(--border); padding: 40px 24px; font-size: 13.5px; color: var(--text-400); }
.footer-inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }

@media (max-width: 860px) {
  .pain-grid, .feature-grid, .steps { grid-template-columns: 1fr 1fr; }
  .mkt-links { display: none; }
}
@media (max-width: 560px) {
  .pain-grid, .feature-grid, .steps { grid-template-columns: 1fr; }
  .dark-section { margin: 0 12px; padding: 48px 22px; border-radius: 22px; }
}

/* ============================================================
   Auth pages (signup / login)
   ============================================================ */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  /* Uses the real logo asset's own off-white paper background, so the
     logo here is pixel-identical to the source artwork - no recreated
     variant, no color mismatch. */
  background: var(--surface-soft); color: var(--text-900); padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; border-right: 1px solid var(--border);
}
.auth-side::after {
  content: ''; position: absolute; width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(35,137,158,.14), transparent 70%); right: -160px; bottom: -160px; z-index: 0;
}
.auth-side > * { position: relative; z-index: 1; }
.auth-side h2 { font-size: 28px; max-width: 380px; margin-bottom: 14px; color: var(--text-900); }
.auth-side p { color: var(--text-600); max-width: 360px; }
.auth-quote { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; font-size: 14px; box-shadow: var(--shadow-card); }
.auth-form-col { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box .brand { margin-bottom: 30px; }
.auth-steps { display: flex; gap: 6px; margin-bottom: 26px; }
.auth-steps span { height: 4px; flex: 1; border-radius: 999px; background: var(--surface-muted); }
.auth-steps span.done { background: var(--gradient-signal); }
.auth-foot { text-align: center; margin-top: 22px; font-size: 14px; color: var(--text-600); }
.back-home { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-600); }
.back-home:hover { color: var(--teal); }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ============================================================
   Dashboard shell (sidebar layout)
   ============================================================ */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; flex-shrink: 0; background: var(--gradient-ink); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30;
}
.sidebar .brand { padding: 22px 22px 18px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 14px; }
.nav-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f6d85; padding: 16px 12px 8px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10.5px 12px; border-radius: 12px; font-size: 14px; font-weight: 600;
  color: #c6c4d8; margin-bottom: 2px; transition: background .15s ease, color .15s ease;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(35,137,158,.2); color: #fff; box-shadow: inset 0 0 0 1px rgba(35,137,158,.4); }
.nav-item .count { margin-left: auto; background: rgba(255,255,255,.1); font-size: 11px; padding: 2px 7px; border-radius: 999px; }
.sidebar-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.mini-profile { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.mini-profile:hover { background: rgba(255,255,255,.06); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--gradient-signal); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; object-fit: cover;
}
.mini-profile .who { min-width: 0; }
.mini-profile .who strong { display: block; font-size: 13.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-profile .who span { font-size: 12px; color: #8f8da3; }

.main { flex: 1; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--topbar-glass); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h1 { font-size: 21px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.content { padding: 28px 32px 60px; max-width: 1180px; }

.mobile-topbar { display: none; }
.menu-toggle { background: none; border: none; cursor: pointer; padding: 4px; }
@media (max-width: 980px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(11,12,16,.5); z-index: 25; }
  .sidebar-backdrop.open { display: block; }
  .mobile-topbar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 15; }
  .content, .topbar { padding-left: 18px; padding-right: 18px; }
}

/* Compact mode: tighten overall dashboard density on phones so cards read
   as a scannable grid rather than a long single-column scroll. */
@media (max-width: 560px) {
  .content { padding-top: 18px; padding-bottom: 40px; }
  .topbar { padding-top: 12px; padding-bottom: 12px; }
  .topbar h1 { font-size: 18px; }
  .card-pad { padding: 16px; }
  .section-title { margin-bottom: 10px; }
  .section-title h3 { font-size: 14.5px; }
  .two-col { gap: 14px; }
  .share-card { padding: 22px 16px; }
  .qr-frame { width: 168px; height: 168px; padding: 10px; }
  table.data th, table.data td { padding: 9px 10px; font-size: 13px; line-height: 1.45; }
  .empty-state { padding: 36px 16px; }

  /* The display font's negative tracking (-0.02em) is tuned for large
     headings; at small mobile sizes it reads as characters crowding into
     each other, especially in numerals. Relax it and give wrapped text
     more breathing room. */
  h1, h2, h3, h4, .display { letter-spacing: -0.005em; line-height: 1.3; }
  .kv-row .v { line-height: 1.4; }
}

/* ---------- Stat cards / bento ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); position: relative; overflow: hidden; }
.stat-card .label { font-size: 12.5px; font-weight: 700; color: var(--text-400); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.stat-card .value { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.stat-card .delta { font-size: 12.5px; margin-top: 8px; font-weight: 600; }
.stat-card.accent { background: var(--gradient-signal); border: none; color: #fff; }
.stat-card.accent .label { color: rgba(255,255,255,.75); }
.stat-card.accent .delta { color: rgba(255,255,255,.85); }
@media (max-width: 980px) { .stat-grid { grid-template-columns: 1fr 1fr; } }

/* Compact mode: below 560px, stat cards stay 2-up (never collapse to one
   tall column) with tighter padding/type so four cards read as a dense
   grid instead of a long scroll. */
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
  .stat-card { padding: 14px; border-radius: var(--radius-sm); }
  .stat-card .label { font-size: 10.5px; margin-bottom: 6px; letter-spacing: .02em; }
  .stat-card .value { font-size: 17px; line-height: 1.3; letter-spacing: -0.005em; word-spacing: 1px; }
  .stat-card .delta { font-size: 11px; margin-top: 5px; line-height: 1.35; }
}
@media (max-width: 380px) {
  .stat-grid { gap: 8px; }
  .stat-card { padding: 11px; }
  .stat-card .value { font-size: 15.5px; }
}

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.two-col > * { min-width: 0; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }

.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title h3 { font-size: 16px; }
.section-title a, .section-title button.link { font-size: 13px; font-weight: 700; color: var(--violet); background: none; border: none; cursor: pointer; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-400); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface-soft); }
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-400); }
.empty-state .icon { font-size: 34px; margin-bottom: 12px; }

/* ---------- Link/QR share card ---------- */
.share-card { text-align: center; padding: 36px; }
.qr-frame { width: 220px; height: 220px; margin: 0 auto 20px; padding: 14px; background: var(--surface); border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.qr-frame img { width: 100%; height: 100%; }
.link-pill { display: flex; align-items: center; gap: 10px; background: var(--surface-muted); border-radius: 999px; padding: 6px 6px 6px 18px; max-width: 380px; margin: 0 auto 20px; }
.link-pill span { font-size: 14px; font-weight: 600; color: var(--text-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: left; }
.share-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-muted); border: 1px solid var(--border); cursor: pointer; font-size: 16px; }
.icon-btn:hover { background: var(--border); }

/* ---------- Modal / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11,12,16,.5); display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); max-width: 460px; width: 100%; padding: 28px; box-shadow: 0 40px 90px -20px rgba(0,0,0,.4); }
.modal h3 { margin-bottom: 10px; }
.modal .actions { display: flex; gap: 10px; margin-top: 22px; justify-content: flex-end; }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink-900); color: #fff; padding: 13px 20px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 20px 40px rgba(0,0,0,.3); z-index: 70; opacity: 0; transform: translateY(10px); transition: all .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- Public contributor page (pay/<handle>) ---------- */
.pay-page { min-height: 100vh; background: var(--surface-soft); }
.pay-hero { background: var(--gradient-ink); color: #fff; padding: 46px 20px 90px; text-align: center; position: relative; }
.pay-hero .avatar { width: 84px; height: 84px; font-size: 30px; margin: 0 auto 14px; border: 3px solid rgba(255,255,255,.2); }
.pay-hero h1 { font-size: 22px; margin-bottom: 6px; }
.pay-hero p { color: #b7b5c9; max-width: 420px; margin: 0 auto; font-size: 14px; }
.pay-hero .socials { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.pay-body { max-width: 460px; margin: -56px auto 0; padding: 0 18px 60px; }
.pay-card { background: var(--surface); border-radius: 24px; box-shadow: 0 30px 70px -20px rgba(20,19,31,.25); padding: 26px; margin-bottom: 16px; }
.amount-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.amount-chip { padding: 12px; border-radius: 12px; border: 1.5px solid var(--border); text-align: center; font-weight: 700; cursor: pointer; background: var(--surface); font-size: 14.5px; }
.amount-chip.selected { border-color: var(--violet); background: #e8f5f7; color: var(--violet-dark); }
.item-row { display: flex; align-items: center; justify-content: space-between; padding: 14px; border: 1.5px solid var(--border); border-radius: 14px; margin-bottom: 10px; cursor: pointer; }
.item-row.selected { border-color: var(--violet); background: #e8f5f7; }
.item-row .name { font-weight: 700; font-size: 14.5px; }
.item-row .price { font-weight: 700; color: var(--violet-dark); }
.fee-line { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-600); padding: 4px 0; }
.fee-line.total { font-weight: 800; color: var(--text-900); font-size: 15px; padding-top: 10px; border-top: 1px dashed var(--border); margin-top: 6px; }
.method-row { display: flex; gap: 10px; margin-bottom: 14px; }
.method-chip { flex: 1; border: 1.5px solid var(--border); border-radius: 12px; padding: 10px; text-align: center; font-size: 13px; font-weight: 700; cursor: pointer; }
.method-chip.selected { border-color: var(--violet); background: #e8f5f7; }
.pay-footer-note { text-align: center; font-size: 12px; color: var(--text-400); margin-top: 16px; }
.status-anim { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; font-size: 32px; }
.status-anim.pending { background: #fef3e0; animation: pulse 1.4s ease-in-out infinite; }
.status-anim.success { background: #e6f8f0; }
.status-anim.failed { background: #fdecec; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(35,137,158,.2); border-top-color: var(--violet); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Admin ---------- */
.admin-badge { display:inline-flex; align-items:center; gap:6px; background:rgba(245,166,35,.15); color:#f5a623; border:1px solid rgba(245,166,35,.3); padding:3px 10px; border-radius:999px; font-size:11px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.sidebar.admin-sidebar { background: linear-gradient(180deg, #1a1408 0%, #0b0c10 100%); }
.kv-row { display:flex; justify-content:space-between; padding:11px 0; border-bottom:1px solid var(--border); font-size:14px; }
.kv-row:last-child { border-bottom:none; }
.kv-row .k { color: var(--text-400); }
.kv-row .v { font-weight:600; text-align:right; }

/* ---------- Printable statements ---------- */
.statement-head { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:24px; padding-bottom:20px; border-bottom:2px solid var(--ink-900); }
.statement-head h1 { font-size:20px; margin-bottom:4px; }
.statement-meta { text-align:right; font-size:13px; color:var(--text-600); }
.statement-summary { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:28px; }
.statement-summary .box { border:1px solid var(--border); border-radius:var(--radius-sm); padding:14px; }
.statement-summary .box .label { font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--text-400); margin-bottom:6px; }
.statement-summary .box .value { font-family:var(--font-display); font-weight:700; font-size:18px; }
.statement-actions { display:flex; gap:10px; margin-bottom:24px; }
@media print {
  .sidebar, .mobile-topbar, .topbar, .chatbot-bubble, .chatbot-panel, .statement-actions, .toast { display:none !important; }
  .shell, .main, .content { display:block !important; margin:0 !important; padding:0 !important; width:100% !important; }
  body { background:#fff !important; }
  .statement-summary { grid-template-columns:repeat(4,1fr); }
  table.data { font-size:12px; }
}

/* ---------- Chatbot widget ---------- */
.chatbot-bubble {
  position: fixed; bottom: 22px; right: 22px; width: 56px; height: 56px; border-radius: 50%;
  background: var(--gradient-signal); color: #fff; border: none; cursor: pointer; box-shadow: var(--shadow-pop);
  display: flex; align-items: center; justify-content: center; z-index: 80; transition: transform .15s ease;
}
.chatbot-bubble:hover { transform: scale(1.06); }
.chatbot-bubble svg { width: 26px; height: 26px; }
.chatbot-panel {
  position: fixed; bottom: 90px; right: 22px; width: 340px; max-width: calc(100vw - 32px); height: 460px; max-height: calc(100vh - 130px);
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 30px 70px -20px rgba(14,42,71,.35); border: 1px solid var(--border);
  display: none; flex-direction: column; overflow: hidden; z-index: 80;
}
.chatbot-panel.open { display: flex; }
.chatbot-header { background: var(--gradient-ink); color: #fff; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; }
.chatbot-header strong { font-size: 14.5px; }
.chatbot-header span { display: block; font-size: 11.5px; color: #b9c6cf; }
.chatbot-close { background: rgba(255,255,255,.12); border: none; color: #fff; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.chatbot-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-soft); }
.chatbot-msg { max-width: 85%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.chatbot-msg.bot { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.chatbot-msg.user { background: var(--teal); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chatbot-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; background: var(--surface-soft); }
.chatbot-chip { font-size: 12px; padding: 6px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; color: var(--text-600); }
.chatbot-chip:hover { border-color: var(--teal); color: var(--teal); }
.chatbot-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chatbot-input-row input { flex: 1; border: 1.5px solid var(--border); border-radius: 999px; padding: 9px 14px; font-size: 13.5px; font-family: inherit; }
.chatbot-input-row input:focus { outline: none; border-color: var(--teal); }
.chatbot-send { background: var(--teal); border: none; color: #fff; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chatbot-send svg { width: 16px; height: 16px; }
@media (max-width: 480px) { .chatbot-panel { right: 16px; bottom: 82px; } .chatbot-bubble { right: 16px; bottom: 16px; } }

/* utility */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mb-0 { margin-bottom: 0; }
.text-sm { font-size: 13px; } .text-muted { color: var(--text-400); } .w-full { width: 100%; }
