/* ĀVĀ Club founder dashboard.
   Official ĀVĀ Movement signature palette and Poppins typography (self-hosted).
   Functional first; the premium visual design will be refined later. */
@font-face { font-family: "Poppins"; src: url("assets/fonts/Poppins-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("assets/fonts/Poppins-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("assets/fonts/Poppins-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("assets/fonts/Poppins-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  /* ĀVĀ Movement signature palette */
  --taupe: #B8A592;      /* Mushroom Taupe */
  --bone: #F4F0EA;       /* Bone */
  --sand: #DCCFC0;       /* Soft Sand */
  --walnut: #7A5F4D;     /* Walnut */
  --espresso: #3A312C;   /* Espresso */

  --ink: var(--espresso);
  --muted: #6e6259;
  --line: #e4dacd;
  --card: #ffffff;
  --ok: #3f6a50;
  --warn: #8a5a1c;
  --bad: #9b2c2c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(58, 49, 44, .06), 0 4px 16px rgba(58, 49, 44, .05);
  font-family: "Poppins", "Helvetica Neue", Arial, system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--bone);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* the hidden attribute must win over display rules (sign-in hides the menu) */
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; }
a { color: var(--walnut); }
h1 { font-size: 1.5rem; font-weight: 500; margin: 0 0 .25rem; }
h2 { font-size: .85rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .75rem; color: var(--muted); }
h3 { font-size: 1rem; font-weight: 500; margin: 0 0 .5rem; }
p { line-height: 1.55; }
td, .note, .who, .muted { overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.card-gap { margin-bottom: 1rem; }
.mt { margin-top: .75rem; }

.demo-banner { background: var(--walnut); color: #fff; text-align: center; padding: .4rem .75rem; font-size: .8rem; letter-spacing: .02em; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: 0 0 232px; background: var(--espresso); color: var(--bone); padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.logo { display: block; width: 120px; height: auto; filter: invert(1) brightness(2); mix-blend-mode: screen; }   /* your logo, shown white: background drops out on the dark sidebar */
.logo.on-light { filter: none; mix-blend-mode: multiply; width: 150px; margin: 0 auto 1.5rem; }   /* original dark logo on the light sign-in page */
.menu-toggle { display: none; }
.nav { display: flex; flex-direction: column; gap: .15rem; margin-top: .5rem; }
.nav a { text-decoration: none; padding: .55rem .7rem; border-radius: 8px; color: var(--sand); font-size: .92rem; }
.nav a:hover { background: rgba(255, 255, 255, .06); }
.nav a.active { background: var(--taupe); color: var(--espresso); font-weight: 500; }
.who { margin-top: auto; font-size: .8rem; color: var(--sand); line-height: 1.4; }
.main { flex: 1; min-width: 0; padding: 2rem 2.5rem; max-width: 1280px; }

.header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; }
.grid.kpis { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); margin-bottom: 1.5rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; min-width: 0; }
.kpi .value { font-size: 1.9rem; font-weight: 300; }
.kpi .label { font-size: .78rem; color: var(--muted); }
.kpi.alert .value { color: var(--walnut); font-weight: 400; }
.kpi.link { cursor: pointer; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: .5rem; border-bottom: 1px solid var(--line); }
td { padding: .55rem .5rem; border-bottom: 1px solid #efe8de; vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #faf7f2; }

/* Badges and buttons */
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .72rem; border: 1px solid var(--line); background: #fff; white-space: nowrap; }
.badge.prive { background: var(--espresso); color: var(--bone); border-color: var(--espresso); }
.badge.insider { background: var(--walnut); color: #fff; border-color: var(--walnut); }
.badge.discover { background: var(--sand); border-color: var(--sand); }
.badge.ok { color: var(--ok); border-color: #bcd5c4; background: #eef5f0; }
.badge.warn { color: var(--warn); border-color: #e3cfa8; background: #fbf4e6; }
.badge.bad { color: var(--bad); border-color: #e3b9b9; background: #fbeeee; }

.btn { font: inherit; font-weight: 500; border: 1px solid var(--espresso); background: var(--espresso); color: var(--bone); padding: .5rem .9rem; border-radius: 8px; cursor: pointer; font-size: .88rem; }
.btn:hover { opacity: .9; }
.btn.accent { background: var(--walnut); border-color: var(--walnut); color: #fff; }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn.small { padding: .3rem .6rem; font-size: .78rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.sidebar .btn.ghost { color: var(--sand); }

input, select, textarea { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); max-width: 100%; }
textarea { width: 100%; min-height: 70px; }
label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: .25rem; }
.field { margin-bottom: .8rem; }
.field input, .field select { width: 100%; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .3rem .75rem; font-size: .8rem; cursor: pointer; color: var(--ink); }
.chip.active { background: var(--espresso); color: var(--bone); border-color: var(--espresso); }

.progress { height: 8px; background: var(--sand); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--walnut); }
.occ { height: 6px; background: #efe8de; border-radius: 999px; overflow: hidden; min-width: 70px; }
.occ > span { display: block; height: 100%; width: 0; background: var(--taupe); }
.occ.quiet > span { background: var(--walnut); }

.profile-head { display: flex; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; }
.stat { min-width: 110px; }
.stat .v { font-size: 1.5rem; font-weight: 300; }
.stat .l { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.note { border-left: 3px solid var(--taupe); padding: .3rem .8rem; margin-bottom: .6rem; }
.notice { background: #fbf4e6; border: 1px solid #e3cfa8; border-radius: 8px; padding: .7rem .9rem; font-size: .86rem; margin-bottom: 1rem; }
.notice.info { background: #f6f1ea; border-color: var(--line); }
.notice.bad { background: #fbeeee; border-color: #e3b9b9; color: var(--bad); }
.notice.verify { border-left: 4px solid var(--walnut); }
.notice.verify.bad { border-left-color: var(--bad); }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85em; background: #f6f1ea; padding: .05rem .3rem; border-radius: 4px; overflow-wrap: anywhere; }
code.secret { display: block; margin-top: .5rem; padding: .5rem; letter-spacing: .08em; user-select: all; }
details summary { cursor: pointer; color: var(--walnut); }
h2.mt { margin-top: 1.25rem; }
.empty { color: var(--muted); font-style: italic; padding: .5rem 0; }

.login { max-width: 400px; margin: 10vh auto; }
.login input { width: 100%; }
.login .tagline { text-align: center; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: -1rem 0 2rem; }
.qr { display: flex; justify-content: center; margin: 1rem 0; }
.qr img { width: 180px; height: 180px; }

.toast { position: fixed; bottom: 1rem; right: 1rem; left: auto; background: var(--espresso); color: var(--bone); padding: .75rem 1rem; border-radius: 8px; box-shadow: var(--shadow); max-width: min(420px, calc(100vw - 2rem)); font-size: .88rem; }
.toast.error { background: var(--bad); }

dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; max-width: 520px; width: calc(100vw - 2rem); max-height: calc(100vh - 2rem); overflow-y: auto; box-shadow: var(--shadow); font-family: inherit; color: var(--ink); }
dialog::backdrop { background: rgba(58, 49, 44, .4); }
dialog h3 { margin-bottom: 1rem; }
dialog .actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }

/* ---- Mobile: no horizontal scrolling --------------------------------------------- */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: sticky; top: 0; z-index: 10; padding: .75rem 1rem; gap: .5rem; }
  .logo { width: 84px; }
  .menu-toggle { display: inline-block; }
  .nav, .who, #signout { display: none; }
  .sidebar.open .nav { display: flex; }
  .sidebar.open .who, .sidebar.open #signout { display: block; }
  .main { padding: 1rem; }
  h1 { font-size: 1.25rem; }
  .header { align-items: stretch; }
  .header form, .header form input { width: 100%; }
  .header form input { flex: 1; }
  .kpi .value { font-size: 1.5rem; }

  /* Tables become stacked cards: each cell shows its column name. */
  table, thead, tbody, tr, td { display: block; width: 100%; }
  tr:has(> th) { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  td { border: 0; padding: .2rem 0; display: flex; gap: .75rem; justify-content: space-between; align-items: flex-start; }
  td[data-label]::before { content: attr(data-label); flex: 0 0 38%; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: .15rem; }
  td > * { min-width: 0; }
  td.nowrap { white-space: normal; }
  .occ { flex: 1; margin-top: .4rem; }
  .stat { min-width: 45%; }
}

/* Key / value tables (no column headings) stay side by side on phones. */
@media (max-width: 760px) {
  table.kv tr { display: flex; justify-content: space-between; gap: .75rem; }
  table.kv td { width: auto; padding: .15rem 0; }
  table.kv td:last-child { text-align: right; flex: 0 0 auto; }
}
