/* Checkered Futures — admin / portal styles.
   Layers on top of site.css, which holds the brand tokens and button rules. */

.whoami {
  font-weight: 700; color: var(--ink-soft); font-size: .95rem;
  padding: 0 10px; white-space: nowrap;
}

/* ---------- flashes ---------- */
.flash {
  padding: 14px 18px; border-radius: var(--radius); margin: 0 0 1.3rem;
  border-left: 5px solid; line-height: 1.5;
}
.flash-ok  { background: #ecfdf3; border-color: #12824a; color: #04301b; }
.flash-bad { background: #fef2f2; border-color: #b42318; color: #450f0b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .flash-ok  { background: #0a2318; color: #c5f3dc; }
  :root:not([data-theme="light"]) .flash-bad { background: #2a100e; color: #ffd9d5; }
}

/* ---------- sub-tabs ---------- */
.subtabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  border-bottom: 2px solid var(--line); margin: 1.1rem 0 1.6rem;
}
.subtab {
  padding: 11px 16px; min-height: 44px; display: inline-flex; align-items: center;
  text-decoration: none; color: var(--ink-soft); font-weight: 700;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.subtab:hover { color: var(--ink); background: var(--surface); }
.subtab.is-current { color: var(--navy); border-bottom-color: var(--orange); }
.subtab-locked { margin-left: auto; color: var(--orange-text); }

/* ---------- chips / pills ---------- */
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 15px;
  border: 2px solid var(--line); border-radius: 999px;
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: .92rem;
}
.chip.is-current { background: var(--navy); border-color: var(--navy); color: #fff; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  vertical-align: middle; margin-left: 5px;
}
.pill-on   { background: #12824a; border-color: #12824a; color: #fff; }
.pill-off  { background: var(--surface); color: var(--ink-soft); }
.pill-lock { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }

/* ---------- stats ---------- */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-n { font-size: 2.3rem; font-weight: 800; line-height: 1; color: var(--navy); }
.stat-l { color: var(--ink-soft); font-size: .93rem; }

/* ---------- key/value + feed ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { font-weight: 700; color: var(--ink-soft); }
.kv dd { margin: 0; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.feed li:last-child { border-bottom: 0; }
.feed .when { display: block; color: var(--ink-soft); font-size: .85rem; }

.hint { display: block; color: var(--ink-soft); font-size: .88rem; margin-top: 4px; font-weight: 400; }

.varlist { list-style: none; margin: 0; padding: 0; }
.varlist li { padding: 3px 0; }
.varlist code,
code {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 6px; font-size: .88rem;
}

.btn-sm { min-height: 38px; padding: 7px 14px; font-size: .9rem; }
.row-off { opacity: .55; }

/* ---------- Quill: make the editor match the form fields ---------- */
.ql-toolbar.ql-snow {
  border: 2px solid var(--line); border-bottom: 0;
  border-radius: 10px 10px 0 0; background: var(--surface);
}
.ql-container.ql-snow {
  border: 2px solid var(--line); border-radius: 0 0 10px 10px;
  font-family: var(--font); font-size: 1rem; background: var(--paper);
}
.ql-editor { min-height: 230px; color: var(--ink); }
.ql-editor.ql-blank::before { color: var(--ink-soft); font-style: normal; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ql-snow .ql-stroke { stroke: var(--ink); }
  :root:not([data-theme="light"]) .ql-snow .ql-fill   { fill: var(--ink); }
  :root:not([data-theme="light"]) .ql-snow .ql-picker-label { color: var(--ink); }
}

/* ---------- pagination ---------- */
nav[role="navigation"] svg { width: 18px; height: 18px; }
.pagination, nav[role="navigation"] { font-size: .95rem; }

/* ---------- mobile nav in the app layout ----------
   The admin header carries more items than the public one (Dashboard, Members,
   Settings, System, the user's name and Sign out), so it runs out of room sooner.
   Collapse it at a wider breakpoint than the marketing site and make sure the
   signed-in name never squeezes the buttons out. */
@media (max-width: 1100px) {
  .nav a.navlink { display: none; }
  .whoami { display: none; }
  .navtoggle {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 48px; min-width: 48px; border: 2px solid var(--line);
    background: transparent; color: var(--ink); border-radius: 10px;
    font-size: 1.4rem; cursor: pointer; margin-left: 6px;
  }
  #menu[hidden] { display: none; }
  #menu {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 90;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px 20px 18px; display: grid; gap: 2px;
    box-shadow: 0 10px 24px rgba(0,0,0,.10);
  }
  #menu a {
    color: var(--ink); text-decoration: none; font-weight: 700;
    padding: 14px 10px; border-radius: 8px; display: block; min-height: 44px;
  }
  #menu a:hover { background: var(--surface); }
  /* .whoami is hidden at this width, so the collapsed menu says who you are. */
  .whoami-menu {
    display: block; padding: 12px 10px 2px; margin-top: 4px;
    border-top: 1px solid var(--line); color: var(--ink-soft);
    font-size: .92rem; font-weight: 700;
  }
}
@media (min-width: 1101px) { #menu { display: none !important; } }

/* ---------- bulk selection bar ---------- */
.bulkbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-top: 1.2rem; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.bulkbar .hint { display: inline; }
.pickbox { accent-color: var(--navy); cursor: pointer; }
.pickbox[disabled] { cursor: not-allowed; opacity: .4; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- consent explanation ----------
   This wording is a safeguarding commitment, so it gets room to breathe rather
   than being squeezed into a hint line. */
.consent-block {
  border: 2px solid var(--line); border-left: 5px solid var(--orange);
  border-radius: var(--radius); padding: 16px 18px; margin: 0 0 1.2rem;
  background: var(--surface);
}
.consent-detail { font-size: .93rem; color: var(--ink-soft); }
.consent-detail p { margin: .9rem 0 .35rem; }
.consent-detail p:first-child { margin-top: .2rem; }
.consent-detail strong { color: var(--ink); }
.consent-detail ul { margin: 0 0 .2rem; padding-left: 1.15rem; }
.consent-detail li { margin-bottom: .35rem; }
.consent-detail a { font-weight: 700; }
