/* ══════════════════════════════════════════════════════════════
   Buildrr℠ — DIY Business Credit Builder
   App shell styles. Loaded only on /Buildrr/ pages.
   ══════════════════════════════════════════════════════════════ */

:root {
  --br-teal:        #aecd32;
  --br-teal-dark:   #889f27;
  --br-teal-dim:    rgba(174,205,50,.12);
  --br-teal-soft:   rgba(174,205,50,.06);
  --br-purple:      #9c6bff;
  --br-blue:        #60a5fa;
  --br-red:         #f87171;
  --br-bottom-nav-h: 64px;
}

/* ── SHELL LAYOUT ─────────────────────────────────────────────── */
.br-app { background: var(--black); min-height: 100vh; }
.br-main { max-width: 1080px; margin: 0 auto; padding: 32px 24px 48px; }
@media (max-width: 640px) { .br-main { padding: 20px 16px calc(48px + var(--br-bottom-nav-h)); } }

/* ── TOP BAR (desktop >=900px) ─────────────────────────────────── */
.br-topbar {
  border-bottom: 1px solid var(--border);
  background: var(--dark);
  position: sticky; top: 0; z-index: 100;
}
.br-topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; gap: 32px;
}
.br-logo-link { text-decoration: none; flex-shrink: 0; }
.br-nav-links { display: none; flex: 1; gap: 4px; }
.br-nav-link {
  font-size: .85rem; font-weight: 600; color: var(--muted);
  text-decoration: none; padding: 8px 14px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.br-nav-link:hover { color: var(--white); background: rgba(255,255,255,.04); }
.br-nav-link.is-active { color: var(--br-teal); background: var(--br-teal-dim); }
.br-exit-link {
  display: none; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--muted); text-decoration: none; margin-left: auto;
}
.br-exit-link:hover { color: var(--white); }
.br-topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--br-teal-dim); color: var(--br-teal);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; text-decoration: none;
  flex-shrink: 0; margin-left: 12px;
}
@media (min-width: 900px) {
  .br-nav-links { display: flex; }
  .br-exit-link { display: flex; }
}

/* ── BOTTOM TAB BAR (mobile <900px) ───────────────────────────── */
.br-bottombar {
  display: flex;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--dark); border-top: 1px solid var(--border);
  height: var(--br-bottom-nav-h);
}
.br-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none; color: var(--muted); font-size: .64rem; font-weight: 600;
}
.br-tab svg { width: 20px; height: 20px; }
.br-tab.is-active { color: var(--br-teal); }
@media (min-width: 900px) { .br-bottombar { display: none; } }

/* ── PAGE HEADER ──────────────────────────────────────────────── */
.br-page-head { margin-bottom: 28px; }
.br-page-head h1 {
  font-family: var(--font-display); font-weight: 400; color: var(--white);
  font-size: 1.7rem; margin-bottom: 6px;
}
.br-page-head p { color: var(--muted); font-size: .9rem; max-width: 560px; line-height: 1.6; }

/* ── STAGE PROGRESS BAR ───────────────────────────────────────── */
.br-stage-bar {
  display: flex; gap: 2px; margin: 20px 0 28px;
  border-radius: 8px; overflow: hidden;
}
.br-stage-seg { flex: 1; height: 8px; background: rgba(255,255,255,.06); }
.br-stage-seg.is-done { background: var(--br-teal); }
.br-stage-seg.is-current { background: var(--br-teal); opacity: .5; }
.br-stage-label-row {
  display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted);
  margin-top: 8px;
}

/* ── STAT CARDS ───────────────────────────────────────────────── */
.br-stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.br-stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px;
}
.br-stat-label {
  font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.br-stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.br-stat-sub { font-size: .76rem; color: var(--muted); }

/* ── SECTION ──────────────────────────────────────────────────── */
.br-section {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px 26px; margin-bottom: 20px;
}
.br-section h2 { font-family: var(--font-display); font-weight: 400; color: var(--white); font-size: 1.2rem; margin-bottom: 6px; }
.br-section-sub { font-size: .84rem; color: var(--muted); margin-bottom: 18px; line-height: 1.6; }
@media (max-width: 640px) { .br-section { padding: 18px 18px; border-radius: 12px; } }

/* ── CHECKLIST ITEM ───────────────────────────────────────────── */
.br-check-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.br-check-item:last-child { border-bottom: none; }
.br-check-box {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border);
  flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center;
  background: transparent; cursor: pointer; transition: border-color .15s, background .15s;
}
.br-check-box.is-done { background: var(--br-teal); border-color: var(--br-teal); }
.br-check-box svg { width: 13px; height: 13px; color: #0a0a0a; opacity: 0; transition: opacity .1s; }
.br-check-box.is-done svg { opacity: 1; }
.br-check-body { flex: 1; min-width: 0; }
.br-check-title { font-size: .92rem; font-weight: 700; color: var(--white); margin-bottom: 3px; }
.br-check-title.is-done { color: var(--muted); text-decoration: line-through; }
.br-check-desc { font-size: .8rem; color: var(--muted); line-height: 1.55; }

/* ── FORM FIELDS ──────────────────────────────────────────────── */
.br-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.br-field label { font-size: .74rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.br-field input, .br-field select, .br-field textarea {
  background: var(--dark); border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 14px; color: var(--white); font-size: .88rem; font-family: var(--font-body);
}
.br-field input:focus, .br-field select:focus, .br-field textarea:focus {
  outline: none; border-color: var(--br-teal);
}
.br-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .br-field-row { grid-template-columns: 1fr; } }
.br-checkbox-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.br-checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--br-teal); }
.br-checkbox-row label { font-size: .85rem; color: var(--white); }

/* ── BUTTONS ──────────────────────────────────────────────────── */
.br-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--br-teal); color: #0a0a0a; font-weight: 700; font-size: .88rem;
  padding: 12px 24px; border-radius: 8px; border: none; cursor: pointer;
  text-decoration: none; transition: background .15s;
}
.br-btn:hover { background: var(--br-teal-dark); }
.br-btn-outline {
  background: transparent; color: var(--white); border: 1px solid var(--border);
}
.br-btn-outline:hover { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.03); }
.br-btn-sm { padding: 8px 16px; font-size: .8rem; }
.br-btn-full { width: 100%; }

/* ── TIER PILLS / BADGES ──────────────────────────────────────── */
.br-tier-pill {
  display: inline-flex; align-items: center; font-size: .68rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; border-radius: 4px; padding: 4px 10px;
}
.br-tier-1 { color: var(--br-teal); background: var(--br-teal-dim); }
.br-tier-2 { color: var(--br-purple); background: rgba(156,107,255,.12); }
.br-tier-3 { color: var(--br-blue); background: rgba(96,165,250,.12); }
.br-tier-4 { color: #f0b429; background: rgba(240,180,41,.12); }

.br-status-pill {
  display: inline-flex; align-items: center; font-size: .68rem; font-weight: 700;
  border-radius: 4px; padding: 3px 9px;
}
.br-status-applied { color: var(--muted); background: rgba(255,255,255,.06); }
.br-status-approved { color: var(--br-blue); background: rgba(96,165,250,.1); }
.br-status-active { color: var(--br-teal); background: var(--br-teal-dim); }
.br-status-closed { color: var(--muted); background: rgba(255,255,255,.04); }

/* ── TABLE ────────────────────────────────────────────────────── */
.br-table-wrap { overflow-x: auto; }
.br-table { width: 100%; border-collapse: collapse; font-size: .84rem; table-layout: fixed; }
.br-table th {
  text-align: left; color: var(--muted); font-size: .68rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; padding: 10px 12px;
  border-bottom: 1px solid var(--border); word-wrap: break-word;
}
.br-table td {
  padding: 12px; border-bottom: 1px solid rgba(255,255,255,.04); color: #b0b0b8;
  vertical-align: top; word-wrap: break-word; overflow-wrap: break-word;
}
.br-table tr:last-child td { border-bottom: none; }

/* ── EMPTY STATE ──────────────────────────────────────────────── */
.br-empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: .88rem; }
.br-empty svg { width: 36px; height: 36px; margin-bottom: 12px; opacity: .4; }

/* ── ALERTS ───────────────────────────────────────────────────── */
.br-alert { border-radius: 10px; padding: 14px 18px; font-size: .85rem; margin-bottom: 20px; }
.br-alert-success { background: var(--br-teal-dim); color: var(--br-teal); border: 1px solid rgba(174,205,50,.25); }
.br-alert-error { background: rgba(248,113,113,.08); color: var(--br-red); border: 1px solid rgba(248,113,113,.25); }

/* ── AUTH PAGES (login/register) ──────────────────────────────── */
.br-auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--black);
}
.br-auth-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px 32px;
}
.br-auth-card h1 { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; color: var(--white); margin-bottom: 6px; text-align: center; }
.br-auth-sub { text-align: center; font-size: .85rem; color: var(--muted); margin-bottom: 28px; }
.br-auth-foot { text-align: center; font-size: .84rem; color: var(--muted); margin-top: 20px; }
.br-auth-foot a { color: var(--br-teal); text-decoration: none; }
.br-logo-center { display: flex; justify-content: center; margin-bottom: 20px; }

/* ── MOBILE MORE SHEET ────────────────────────────────────────── */
.br-more-sheet {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 300;
  display: none; align-items: flex-end;
}
.br-more-sheet.is-open { display: flex; }
.br-more-panel {
  background: var(--dark); border-radius: 16px 16px 0 0; width: 100%;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.br-more-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 6px;
  text-decoration: none; color: var(--white); font-size: .92rem; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.br-more-item:last-child { border-bottom: none; }
.br-more-item svg { width: 20px; height: 20px; color: var(--muted); }
