/* =============================================================
   Artemis Partners — portal base styles
   Brand mirrors artemispower.com: warm cream canvas, deep plum-black
   band, signature Artemis purple accent, Plus Jakarta Sans type.
   Light + dark aware.
   ============================================================= */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root {
  --accent: #9e57d3;        /* Artemis purple (their primary CTA) */
  --accent-ink: #6d2fa0;    /* deeper purple for text on light */
  --accent-tint: rgba(158,87,211,.12);
  --ink: #171320;           /* headings / emphasized text (goes LIGHT in dark mode) */
  --band: #171320;          /* deep plum-black band / sidebar (stays dark both modes) */
  --band2: #2c2140;         /* band gradient partner (plum) */
  --text: #333333;
  --muted: #71717a;
  --canvas: #faf6f2;        /* warm cream, the Artemis signature */
  --card: #ffffff;
  --line: #ece6dd;          /* warm hairline border */
  --good: #16a34a;
  --info: #2563eb;
  --warn: #f59e0b;
  --bad: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23,19,32,.05), 0 10px 30px rgba(23,19,32,.06);
  --maxw: 1180px;
  font-synthesis: none;
}
/* Dark theme tokens. Applied when the user picks dark (data-theme="dark"),
   OR when the OS prefers dark and the user hasn't forced light. */
:root[data-theme="dark"] {
  --ink: #f3eefb; --band: #171320; --band2: #2c2140;
  --text: #e4dcef; --muted: #9d93ad; --canvas: #0f0b16; --card: #1c1628;
  --line: #322a40; --accent-tint: rgba(158,87,211,.20); --accent-ink: #c9a9ec;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 12px 32px rgba(0,0,0,.45);
}
/* Dark mode retired — the portal is always light (see js/config.js forcing
   data-theme="light"). The [data-theme="dark"] block above is kept dormant but
   never triggered; the OS "prefers dark" media query no longer flips the theme. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--canvas);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
h1, h2, h3 { font-weight: 800; letter-spacing: -0.015em; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* --- top bar --- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
  background: var(--card);
}
/* Theme toggle retired (light-only). Hidden everywhere it still renders. */
.theme-toggle { display: none !important; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.brand .dot { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); display: inline-block; }
.brand .sub { color: var(--muted); font-weight: 500; }
/* Real Artemis wordmark used in headers/sidebars (see /assets/artemis-logo-*.svg) */
.brand-logo { height: 24px; width: auto; display: block; }
/* The topbar wordmark is the dark-fill file; flip it light on dark backgrounds
   (the sidebar uses the white file on a permanently-dark band, so it's exempt). */
:root[data-theme="dark"] .topbar .brand-logo { filter: invert(1) brightness(1.7); }
.brand .sep { width: 1px; height: 20px; background: var(--line); display: inline-block; }
.brand .tag {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--accent-ink); background: var(--accent-tint);
  padding: 4px 9px; border-radius: 999px;
}

/* --- hero / welcome band --- */
.band {
  background: linear-gradient(135deg, var(--band2) 0%, var(--band) 60%);
  color: #fff;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 26px 28px; margin: 22px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.band h1 { margin: 4px 0 0; font-size: 1.6rem; }
.band .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: #c3b6da; }
/* Promo banner — static, centered, on-brand. */
.promo-marquee {
  border-radius: var(--radius);
  border: 1px solid rgba(158,87,211,.55);
  background: linear-gradient(100deg, #2c2140 0%, #171320 45%, #3a2456 100%);
  box-shadow: 0 8px 24px rgba(158,87,211,.22);
  padding: 16px 22px;
}
.promo-item {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; font-size: 1.02rem; color: #fff; text-align: center;
}
.promo-item .spark { color: #c9a9ec; }

/* merged sign-in page: hero + form side by side, stacked on mobile */
.signin-split { display: flex; gap: 24px; align-items: stretch; }
@media (max-width: 760px) { .signin-split { flex-direction: column; } .signin-split .card { max-width: none !important; } }

/* check-marked value line, used on the dark band (sign-up / welcome) */
.joinperk { display: inline-flex; align-items: center; gap: 8px; color: #efe7fa; font-weight: 600; font-size: .9rem; }
.joinperk::before {
  content: "✓"; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: .72rem; font-weight: 800; flex: none;
}
.pill {
  background: var(--accent-tint); color: var(--accent-ink);
  border: 1px solid rgba(158,87,211,.45); border-radius: 999px;
  padding: 8px 14px; font-weight: 600; font-size: .9rem;
}

/* --- cards + grid --- */
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 820px) { .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .cols-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px;
}
.stat .label { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 2rem; font-weight: 800; color: var(--ink); margin: 6px 0 2px; }
.stat .foot { color: var(--muted); font-size: .82rem; }
.stat.accent { background: linear-gradient(180deg, rgba(158,87,211,.10), var(--card)); border-color: rgba(158,87,211,.35); }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 12px; padding: 11px 16px; font-weight: 600; cursor: pointer;
  font-size: .95rem; transition: transform .06s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fbf7ff;
  box-shadow: 0 6px 18px rgba(158,87,211,.28);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(158,87,211,.36); }
.btn-dark { background: #171320; border-color: #171320; color: #faf6f2; }
.btn-dark:hover { filter: brightness(1.25); border-color: #171320; }
.btn-lg { padding: 14px 22px; font-size: 1.02rem; border-radius: 14px; }
.btn-google { background: #fff; color: #3c4043; border: 1px solid #dadce0; font-weight: 600; gap: 10px; box-shadow: 0 1px 2px rgba(60,64,67,.1); }
.btn-google:hover { background: #f8f9fa; border-color: #c6c9cd; filter: none; box-shadow: 0 2px 6px rgba(60,64,67,.15); }
/* "or" divider between Google and the email/password form */
.or-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: .82rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* --- progress bar --- */
.progress { display: flex; gap: 4px; }
.progress .seg { height: 6px; flex: 1; border-radius: 3px; background: var(--line); }
.progress .seg.on { background: var(--good); }
.progress .seg.warn { background: var(--accent); }

/* --- status chips --- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.good { color: var(--good); background: rgba(22,163,74,.10); }
.chip.info { color: var(--info); background: rgba(37,99,235,.10); }
.chip.warn { color: var(--warn); background: rgba(245,158,11,.12); }
.chip.bad  { color: var(--bad);  background: rgba(220,38,38,.10); }
.chip.muted{ color: var(--muted);background: rgba(107,118,132,.12); }

/* --- forms --- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--text); font-size: .98rem;
}
.field input:focus, .field select:focus { outline: 2px solid rgba(158,87,211,.5); border-color: var(--accent); }

/* --- compact inline selects used in the admin tables --- */
select.adminsel {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-color: var(--card);
  color: var(--ink);
  border: 1.5px solid rgba(158,87,211,.28);
  border-radius: 10px;
  padding: 8px 32px 8px 13px;
  font-size: .86rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(23,19,32,.04);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239e57d3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
select.adminsel:hover { border-color: var(--accent); background-color: var(--accent-tint); }
select.adminsel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(158,87,211,.2); }
select.adminsel option { background: var(--card); color: var(--ink); font-weight: 500; }

.muted { color: var(--muted); }
.center { text-align: center; }

/* numbered "how it works" steps (welcome page) */
.step { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--line); }
.step:first-of-type { border-top: none; }
.stepnum {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-tint); color: var(--accent-ink);
  font-weight: 800; font-size: 1rem;
}
.step h3 { margin: 0 0 3px; font-size: 1rem; color: var(--ink); }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }

/* =============================================================
   App shell with left sidebar (Artemis-Dial style)
   ============================================================= */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 234px; flex: none; background: var(--band); color: #dfe6f2;
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px 14px; position: sticky; top: 0; height: 100vh;
}
.sidebar .side-top { display: flex; align-items: center; gap: 10px; padding: 2px 6px 12px; }
.sidebar .brand-mini { font-weight: 700; color: #fff; font-size: 1.02rem; display: flex; align-items: center; gap: 9px; }
.sidebar .brand-mini .brand-logo { height: 21px; }
.sidebar .brand-mini .dot { width: 15px; height: 15px; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: 3px; vertical-align: -2px; }
.sidebar .brand-mini .sub {
  color: #d9c2f2; font-weight: 700; font-size: .64rem; text-transform: uppercase; letter-spacing: .1em;
  background: rgba(158,87,211,.22); padding: 3px 7px; border-radius: 999px;
}
.sidebar .nav, .sidebar .side-bottom { display: flex; flex-direction: column; gap: 3px; }
.sidebar .side-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar a {
  color: #c3cede; text-decoration: none; padding: 9px 12px; border-radius: 9px;
  font-size: .92rem; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
}
.sidebar a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidebar a.active { background: var(--accent); color: #fbf7ff; font-weight: 700; box-shadow: 0 4px 14px rgba(158,87,211,.35); }

/* Static "Commission structure" panel in the sidebar (always visible). */
.side-struct { padding: 12px 6px 2px; margin-top: 6px; border-top: 1px solid rgba(255,255,255,.09); }
.side-struct-title { color: #c9b3ec; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; padding: 0 8px 5px; }
.side-struct .rate-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border-top: 1px solid rgba(255,255,255,.06); }
.side-struct .rate-row:first-child { border-top: none; }
.side-struct .rate-label { color: #a8adc2; font-size: .8rem; }
.side-struct .rate-amt { color: #fff; font-weight: 700; font-size: .82rem; white-space: nowrap; }
.sidebar .theme-toggle { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #fff; }

.content { flex: 1; min-width: 0; padding: 24px 26px; max-width: 1120px; }
.content-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.content-head h1 { margin: 2px 0 0; color: var(--ink); font-size: 1.55rem; }
.section-title { color: var(--ink); font-size: 1.2rem; margin: 0 0 14px; }

@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; }
  .sidebar .nav, .sidebar .side-bottom { flex-direction: row; flex-wrap: wrap; }
  .sidebar .side-bottom { margin-top: 6px; border-top: none; padding-top: 0; }
  .content { padding: 18px; }
}
