/* ============================================================================
   CBF application — panel styles.
   Layered on top of the public site's style.css, which already defines the
   palette (--bg, --accent, --line, …), the type and the button shapes.  This
   file only adds what a panel needs and never redefines a token.
   ========================================================================== */

body.cbf-app { padding-top: 0; }
.appwrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.appmain.wide .appwrap { max-width: 1400px; }

/* --------------------------------------------------------------- header --- */
.apphead {
  position: sticky; top: 0; z-index: 40;
  background: rgba(2,4,11,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.apphead .appwrap { display: flex; align-items: center; gap: 26px; height: 64px; }
.apphead .brand { font-size: 22px; font-weight: 700; letter-spacing: 1px; color: var(--text-hi); }
.apphead .brand .n { color: var(--accent); }
.appnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.appnav a {
  font-size: 13px; font-weight: 500; color: var(--text-mute);
  padding: 8px 13px; border-radius: 999px; border: 1px solid transparent;
}
.appnav a:hover { color: var(--text-hi); background: var(--bg-card); }
.appnav a.on { color: var(--accent); border-color: var(--line-hi); background: var(--bg-card); }
.appuser { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.appuser .who { font-size: 13px; color: var(--text-mute); }
.appmain { padding: 34px 0 80px; min-height: 70vh; }
.appfoot { border-top: 1px solid var(--line); padding: 22px 0; color: var(--text-mute); font-size: 13px; }

/* ---------------------------------------------------------------- blocks --- */
.phead { margin: 0 0 26px; }
.phead h1 { font-size: 30px; margin: 0 0 8px; }
.phead .lead { color: var(--text-mute); margin: 0; max-width: 70ch; }
.phead .eyebrow { margin-bottom: 10px; }

.panel {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; margin: 0 0 20px;
}
.panel > h2 { font-size: 17px; margin: 0 0 4px; }
.panel > h2 + .sub { color: var(--text-mute); font-size: 14px; margin: 0 0 18px; }
.panel.tight { padding: 16px 18px; }
.panel.accent { border-color: var(--line-hi); }

.grid { display: grid; gap: 18px; }
.grid.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 22px; align-items: start; }
.sticky { position: sticky; top: 84px; }

.kpi { background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.kpi .label { font-size: 10px; letter-spacing: 2.2px; text-transform: uppercase; color: var(--text-mute); }
.kpi .value { font-size: 24px; font-weight: 600; color: var(--text-hi); margin-top: 6px; line-height: 1.15; }
.kpi .note  { font-size: 12px; color: var(--text-mute); margin-top: 5px; }

/* ----------------------------------------------------------------- pills --- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-hi); color: var(--text-mute);
}
.pill.good  { color: var(--good); border-color: rgba(124,227,164,.4); background: rgba(124,227,164,.08); }
.pill.warn  { color: var(--warn); border-color: rgba(255,195,107,.4); background: rgba(255,195,107,.08); }
.pill.bad   { color: var(--bad);  border-color: rgba(255,107,122,.4); background: rgba(255,107,122,.08); }
.pill.info  { color: var(--accent); border-color: var(--line-hi); background: rgba(198,153,251,.08); }

/* ----------------------------------------------------------------- table --- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-mute); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(255,255,255,.015); }
.tbl a { color: var(--text-hi); }
.tbl a:hover { color: var(--accent); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- forms --- */
.f { margin: 0 0 18px; }
.f label { display: block; font-size: 13px; font-weight: 600; color: var(--text-hi); margin: 0 0 7px; }
.f .hint { font-size: 12.5px; color: var(--text-mute); margin: -2px 0 8px; line-height: 1.55; }
.f input[type=text], .f input[type=email], .f input[type=password], .f input[type=url],
.f input[type=number], .f input[type=date], .f select, .f textarea {
  width: 100%; background: var(--bg-card); border: 1px solid var(--line-hi);
  border-radius: 11px; padding: 13px 15px; color: var(--text-hi);
  font: 400 15px/1.5 var(--font-body); transition: border-color .15s;
}
.f textarea { min-height: 130px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { outline: 0; border-color: var(--accent); }
.f .err { color: var(--bad); font-size: 13px; margin-top: 6px; }
.f-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.f-row.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.f-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.btn-sm { padding: 10px 16px; font-size: 11px; }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(255,107,122,.45); }
.btn-danger:hover { background: rgba(255,107,122,.1); color: var(--bad); }
.btn[disabled] { opacity: .45; pointer-events: none; }

.flash {
  border-radius: 12px; padding: 13px 17px; margin: 0 0 20px; font-size: 14px;
  border: 1px solid var(--line-hi); background: var(--bg-card); color: var(--text-hi);
}
.flash.ok   { border-color: rgba(124,227,164,.4); background: rgba(124,227,164,.08); }
.flash.err  { border-color: rgba(255,107,122,.45); background: rgba(255,107,122,.08); }
.flash.warn { border-color: rgba(255,195,107,.4); background: rgba(255,195,107,.08); }

/* -------------------------------------------------------------- progress --- */
.bar { height: 8px; border-radius: 999px; background: var(--bg-card); overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.bar.thin { height: 5px; }
.bar .ghost { position: absolute; }

/* ------------------------------------------------------------- timeline --- */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 22px 34px; }
.tl li::before {
  content: ''; position: absolute; left: 7px; top: 6px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--bg-card); border: 2px solid var(--line-hi);
}
.tl li::after { content: ''; position: absolute; left: 12px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl li.done::before { background: var(--good); border-color: var(--good); }
.tl li.now::before  { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px rgba(198,153,251,.16); }
.tl .t { font-weight: 600; color: var(--text-hi); font-size: 15px; }
.tl .d { font-size: 13.5px; color: var(--text-mute); margin-top: 3px; line-height: 1.6; }
.tl li.now .t { color: var(--accent); }

/* ------------------------------------------------------------- checklist --- */
.chk { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.chk li { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.chk li:last-child { border-bottom: 0; }
.chk .mark { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-hi); flex: 0 0 18px; margin-top: 2px; }
.chk li.ok .mark { background: var(--good); border-color: var(--good); }
.chk li.ok span { color: var(--text-mute); }
.chk .soft { font-size: 11px; color: var(--text-mute); }

/* ----------------------------------------------------------------- misc --- */
.fine { font-size: 12.5px; color: var(--text-mute); line-height: 1.6; }
.mono { font-variant-numeric: tabular-nums; }
.sep { height: 1px; background: var(--line); margin: 22px 0; border: 0; }
.tag-model { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.empty { text-align: center; padding: 50px 20px; color: var(--text-mute); }
.empty h3 { color: var(--text-hi); margin: 0 0 8px; }

.money-line { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.money-line:last-child { border-bottom: 0; }
.money-line b { color: var(--text-hi); font-variant-numeric: tabular-nums; }
.money-line.total { border-top: 1px solid var(--line-hi); margin-top: 6px; padding-top: 13px; font-size: 16px; }
.money-line.neg b { color: var(--bad); }

.authbox { max-width: 440px; margin: 40px auto; }
.authbox .panel { padding: 30px 28px; }
.or { display: flex; align-items: center; gap: 14px; color: var(--text-mute); font-size: 12px; margin: 20px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 900px) {
  .split, .grid.g3, .grid.g4, .f-row, .f-row.g3 { grid-template-columns: 1fr; }
  .grid.g2 { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .apphead .appwrap { height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .appnav { order: 3; width: 100%; }
  .tbl { font-size: 13px; }
}

/* ------------------------------------------------------------ tier editor --- */
.tier { border: 1px solid var(--line-hi); border-radius: 14px; background: var(--bg-card); margin: 0 0 14px; overflow: hidden; }
.tier-head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: var(--bg-card-2); border-bottom: 1px solid var(--line); }
.tier-price { font-weight: 600; color: var(--accent); font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tier-title { flex: 1; background: transparent !important; border: 0 !important; padding: 6px 0 !important;
  color: var(--text-hi) !important; font-size: 15px !important; font-weight: 600; }
.tier-title:focus { outline: 0; border-bottom: 1px solid var(--accent) !important; }
.tier-margin { white-space: nowrap; }
.tier-body { padding: 16px 16px 4px; }
.tier-body .f { margin-bottom: 14px; display: flex; flex-direction: column; }
.tier-body .f .hint { flex: 1; }          /* pushes every input to the same baseline */
.tier-body .f input, .tier-body .f select, .tier-body .f textarea { margin-top: auto; }
.tier-body .f label { font-size: 12px; }
.tier-del { padding: 7px 12px; font-size: 10px; }

.faqrow { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 2px; margin: 0 0 12px; background: var(--bg-card); }
.faqrow textarea { min-height: 70px; }

.saving {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  background: var(--good); color: #06210f; font-size: 12px; font-weight: 700;
  padding: 9px 16px; border-radius: 999px; letter-spacing: .05em; text-transform: uppercase;
  opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none;
}
.saving.on  { opacity: 1; transform: none; }
.saving.bad { background: var(--bad); color: #2a0308; }

/* ---- cover artwork drop zone (builder §1) -------------------------------- */
.drop { position:relative; display:flex; align-items:center; gap:16px; min-height:120px; padding:16px;
  border:1.5px dashed var(--line-hi); border-radius:14px; background:var(--bg-card); transition:.15s; }
.drop.over { border-color:var(--accent); background:rgba(198,153,251,.07); }
.drop.busy { opacity:.55; pointer-events:none; }
.drop img { width:96px; height:96px; object-fit:cover; border-radius:10px; flex:0 0 96px;
  background:var(--bg-soft); border:1px solid var(--line); }
.drop .drop-msg { font-size:13.5px; line-height:1.6; color:var(--text-mute); }
.drop .drop-msg b { display:block; color:var(--text-hi); font-size:14px; margin-bottom:3px; }
.drop .drop-msg button { background:none; border:0; padding:0; font:inherit; cursor:pointer;
  color:var(--accent); text-decoration:underline; }

/* ---- the example reward tiers (builder §4) ------------------------------- */
.egtiers { margin:0; padding-left:18px; color:var(--text-mute); font-size:13px; line-height:1.85; }
.egtiers b { color:var(--text-hi); }
