/* ================= AURUM CLUB — member desk layout ================= */

/* state-gated elements must hide even when a class sets display */
[hidden] { display: none !important; }

/* while checking the session, show nothing to avoid flashes */
body.booting .db-shell, body.booting .auth-wrap { display: none; }
body.unauthed .db-shell { display: none; }

/* ---------- auth screen ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.auth-card {
  width: min(420px, 100%); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow);
}
.auth-card .brand { justify-content: center; margin-bottom: 22px; font-size: 1.2rem; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--bg-tint); border-radius: 12px; padding: 6px; margin-bottom: 20px;
}
.auth-tab {
  border: 0; cursor: pointer; border-radius: 8px; padding: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.92rem;
  background: transparent; color: var(--ink-2);
}
.auth-tab.active { background: var(--surface); color: var(--emerald-deep); box-shadow: 0 1px 4px rgba(16,36,28,0.08); }
#authForm { display: grid; gap: 14px; }
#authForm label { display: grid; gap: 6px; font-size: 0.86rem; font-weight: 600; }
#authForm input {
  font-family: var(--font-body); font-size: 0.95rem;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px;
  background: var(--bg); color: var(--ink);
}
#authForm input:focus { outline: 2px solid var(--emerald); outline-offset: 1px; }
.auth-error { color: var(--red); font-size: 0.86rem; font-weight: 600; }
.auth-card .fineprint { margin-top: 18px; text-align: center; }
.auth-card .fineprint a { color: var(--emerald-deep); text-decoration: underline; }

/* ---------- status strips / notices ---------- */
.review-strip {
  margin: -10px 0 22px; padding: 12px 16px; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600;
  background: var(--gold-soft); color: #7A5A16;
}
.review-strip.rejected { background: #F7E4E1; color: #8C2B20; }
.verify-notice { background: var(--gold-soft); border-color: #E8D8AE; }
.verify-notice p { font-size: 0.92rem; color: #6B4F14; }
.verify-notice.rejected { background: #F7E4E1; border-color: #ECC8C2; }
.verify-notice.rejected p { color: #8C2B20; }

/* ---------- shell ---------- */
.db-shell {
  display: grid; grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
.db-side {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 20px 16px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.db-brand { font-size: 1.15rem; padding: 4px 8px; }
.db-main { display: flex; flex-direction: column; min-width: 0; }

/* ---------- sidebar nav ---------- */
.db-nav { display: flex; flex-direction: column; gap: 4px; }
.db-nav-label {
  display: block; font-size: 0.66rem; letter-spacing: 0.18em; font-weight: 700;
  color: var(--muted); margin: 14px 8px 6px;
}
.db-link {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; cursor: pointer; text-align: left;
  font-family: var(--font-body); font-size: 0.93rem; font-weight: 500;
  color: var(--ink-2); padding: 10px 12px; border-radius: 10px;
  transition: background 0.15s, color 0.15s;
}
.db-link:hover { background: var(--bg); color: var(--ink); }
.db-link.active { background: var(--soft); color: var(--emerald-ink); font-weight: 600; }
.lock-dot { font-size: 0.7rem; margin-left: auto; opacity: 0.7; }

/* ---------- sidebar user + demo ---------- */
.db-user {
  margin-top: auto; display: grid; grid-template-columns: auto 1fr; gap: 10px;
  align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.avatar-sm { width: 38px; height: 38px; font-size: 1rem; }
.db-user-meta { min-width: 0; }
.db-user-meta b { display: block; font-size: 0.9rem; }
.db-user-meta span { display: block; font-size: 0.74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-signout { grid-column: 1 / -1; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.demo-toggle {
  display: flex; gap: 8px; align-items: center; cursor: pointer;
  font-size: 0.76rem; color: var(--muted);
  background: var(--gold-soft); border-radius: 10px; padding: 10px 12px;
}
.demo-toggle b { color: #7A5A16; }
.demo-toggle input { accent-color: var(--gold); }

/* ---------- topbar ---------- */
.db-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); padding: 12px 28px;
}
.price-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; letter-spacing: 0.06em; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px;
}
.price-pill b { font-variant-numeric: tabular-nums; }
.price-pill b.up { color: var(--up); }
.price-pill b.down { color: var(--red); }
.session-pill {
  font-size: 0.7rem; letter-spacing: 0.14em; font-weight: 700; color: var(--emerald-ink);
  background: var(--soft); border: 1px solid var(--soft-border);
  padding: 7px 14px; border-radius: 999px;
}
.db-top-spacer { flex: 1; }
.bell {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: 50%; width: 38px; height: 38px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2);
}
.bell-dot {
  position: absolute; top: 8px; right: 9px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red); border: 2px solid var(--surface);
}

/* ---------- panels ---------- */
.db-panel { display: none; padding: 32px 28px 64px; max-width: 980px; width: 100%; }
.db-panel.active { display: block; }
.db-panel h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-top: 4px; }
.db-sub { color: var(--ink-2); margin: 8px 0 26px; max-width: 60ch; }

/* ---------- cards ---------- */
.db-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
}
.db-card-title { margin-bottom: 14px; }
.badge-live { background: var(--soft); color: var(--emerald-deep); }

/* status / onboarding */
.status-card { padding: 26px; }
.status-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.status-head h2 { font-size: 1.3rem; margin: 10px 0 8px; }
.status-head p { color: var(--ink-2); font-size: 0.93rem; max-width: 48ch; }
.stepper {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line);
}
.stepper li { display: flex; align-items: center; gap: 10px; font-size: 0.84rem; color: var(--muted); }
.step-dot {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700;
  background: var(--bg-tint); color: var(--muted); border: 1px solid var(--line);
}
.stepper li.done { color: var(--ink); }
.stepper li.done .step-dot { background: var(--up); border-color: var(--up); color: #fff; }
.stepper li.next { color: var(--emerald-ink); font-weight: 600; }
.stepper li.next .step-dot { background: var(--soft); border-color: var(--emerald); color: var(--emerald-deep); }

/* explore grid */
.explore-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 10px; }
.explore-card {
  cursor: pointer; text-align: left; font-family: var(--font-body);
  transition: transform 0.15s, box-shadow 0.2s; margin-bottom: 0;
}
.explore-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.explore-card h3 { margin: 12px 0 6px; }
.explore-card p { font-size: 0.88rem; color: var(--ink-2); }

/* lock cards */
.lock-card { text-align: center; padding: 48px 24px; }
.lock-icon { font-size: 1.6rem; margin-bottom: 12px; }
.lock-card h2 { font-size: 1.25rem; margin-bottom: 10px; }
.lock-card p { color: var(--ink-2); max-width: 46ch; margin: 0 auto 20px; font-size: 0.94rem; }

/* ---------- console ---------- */
.console-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 20px; align-items: start; }
.console-card { margin-bottom: 0; }
.console-controls { display: flex; gap: 10px; margin-top: 18px; }
.btn-danger { background: #C0392B; color: #fff; }
.btn-danger:hover { background: #A03024; }
.bot-grid dd.warn { color: #F2C063; }
.bot-grid dd.stopped { color: #FF9B8F; }

/* ---------- ledger ---------- */
.ledger-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }

/* ---------- broker / verify ---------- */
.broker-pane-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.broker-pane p { font-size: 0.9rem; color: var(--ink-2); margin-bottom: 16px; }
.ref-rows { margin-top: 16px; display: grid; gap: 8px; }
.ref-rows div {
  display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
.ref-rows dt { font-size: 0.64rem; letter-spacing: 0.14em; font-weight: 700; color: var(--muted); }
.ref-rows dd { font-size: 0.88rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-rows dd a { color: var(--emerald-deep); text-decoration: underline; text-underline-offset: 3px; }
.ref-rows dd a:hover { color: var(--emerald); }
.copy-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  padding: 6px 12px; font-size: 0.78rem; font-weight: 600; cursor: pointer; color: var(--ink-2);
}
.copy-btn:hover { color: var(--emerald-deep); border-color: var(--soft-border); }

.verify-form { display: grid; gap: 16px; max-width: 520px; }
.verify-form label { display: grid; gap: 6px; font-size: 0.86rem; font-weight: 600; }
.verify-form input {
  font-family: var(--font-body); font-size: 0.95rem;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px;
  background: var(--bg); color: var(--ink);
}
.verify-form input:focus { outline: 2px solid var(--emerald); outline-offset: 1px; }
.input-hint { font-size: 0.76rem; color: var(--muted); font-weight: 400; }
.verify-form .btn { justify-self: start; }
.verify-status { font-size: 0.86rem; color: var(--emerald-deep); font-weight: 600; }
.keep-card { background: var(--bg-tint); }

/* ---------- calls feed ---------- */
.call-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 20px; margin-bottom: 12px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 6px 18px; align-items: center;
}
.call-dir { font-family: var(--font-display); font-weight: 700; }
.call-dir.long { color: var(--up); }
.call-dir.short { color: var(--red); }
.call-levels { font-size: 0.88rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.call-levels b { color: var(--ink); }
.call-status {
  font-size: 0.68rem; letter-spacing: 0.12em; font-weight: 700;
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.call-status.working { background: var(--soft); color: var(--emerald-deep); }
.call-status.won { background: #E1F3E8; color: #0A5A42; }
.call-status.lost { background: #F7E4E1; color: #8C2B20; }
.call-time { font-size: 0.74rem; color: var(--muted); grid-column: 1 / -1; }

/* ---------- updates feed ---------- */
.update-post {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 20px 22px; margin-bottom: 14px;
}
.update-post h3 { margin-bottom: 6px; }
.update-post time { font-size: 0.74rem; color: var(--muted); letter-spacing: 0.06em; }
.update-post p { font-size: 0.9rem; color: var(--ink-2); margin-top: 10px; }

/* ---------- account ---------- */
.profile-rows { display: grid; gap: 0; }
.profile-rows div {
  display: grid; grid-template-columns: 160px 1fr; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem;
}
.profile-rows div:last-child { border-bottom: 0; }
.profile-rows dt { color: var(--muted); }
.profile-rows dd { font-weight: 600; }
.pos-text { color: var(--up-deep); }
.text-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--emerald-deep); font-weight: 600; text-decoration: underline;
}
.db-disclaimer { max-width: 70ch; margin-top: 24px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .db-shell { grid-template-columns: 1fr; }
  .db-side {
    position: static; height: auto; flex-direction: column;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .db-nav { flex-direction: row; flex-wrap: wrap; }
  .db-nav-label { display: none; }
  .db-user { margin-top: 0; }
  .console-grid { grid-template-columns: 1fr; }
  .explore-grid { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: 1fr 1fr; gap: 14px; }
  .ledger-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .db-panel { padding: 24px 16px 48px; }
  .db-top { padding: 10px 16px; }
  .session-pill { display: none; }
  .ref-rows div { grid-template-columns: 1fr auto; }
  .ref-rows dt { grid-column: 1 / -1; }
}
