/* =============================================================================
   JanaTribe · Wedding Budget
   Same language as the marketing pages: Manrope, ink #0f1220, brand #fe5c0e,
   pastel cards with 28px corners, pills, orange underline links.
============================================================================= */

:root {
  --ink: #0f1220;
  --ink-70: rgba(15, 18, 32, 0.7);
  --ink-55: rgba(15, 18, 32, 0.55);
  --ink-40: rgba(15, 18, 32, 0.4);
  --line: rgba(15, 18, 32, 0.1);
  --brand: #fe5c0e;
  --brand-dark: #e14f0c;
  --brand-soft: #fff2ec;
  --peach: #ffe3d2;  --peach-ink: #b8420a;
  --lilac: #ece1f5;  --lilac-ink: #6b3fa0;
  --mint: #d9f0e8;   --mint-ink: #0f766e;
  --butter: #fff1bd; --butter-ink: #8a6a00;
  --danger: #dc2626; --danger-soft: #fef2f2;
  --ok: #0f766e;     --ok-soft: #e7f6f0;
  --radius: 28px;
}

/* Self-sufficient base (doesn't depend on the Tailwind CDN's preflight) */
/* :where() keeps these resets at zero specificity, so component classes always win */
:where(.b-body) *, :where(.b-body) *::before, :where(.b-body) *::after { box-sizing: border-box; }
:where(.b-body) :where(h1, h2, h3, p, ul, ol, figure) { margin: 0; }
:where(.b-body) :where(ul, ol) { padding: 0; }
:where(.b-body) a { color: inherit; text-decoration: none; }
:where(.b-body) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.b-body) :where(img, svg) { display: inline-block; vertical-align: middle; }
.b-body [hidden] { display: none !important; }

.b-body {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #ffffff 0%, #f8faff 52%, #f1f5fc 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.b-wrap { max-width: 1200px; margin: 0 auto; padding: 28px 20px 80px; }
@media (min-width: 768px) { .b-wrap { padding: 40px 32px 96px; } }

/* ------------------------------------------------------------------ type */
.b-kicker { font-size: 12px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--brand); }
.b-title { margin-top: 10px; font-size: clamp(30px, 4.6vw, 48px); font-weight: 600; letter-spacing: -.03em; line-height: 1.06; text-wrap: balance; }
.b-h2 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.b-h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.b-sub { margin-top: 10px; font-size: 15px; color: var(--ink-70); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.b-sub .dot { color: var(--ink-40); }
.b-muted { color: var(--ink-55); }
.b-small { font-size: 13px; }
.b-tiny { font-size: 12px; }
.b-num { font-variant-numeric: tabular-nums; }
.b-countdown { font-weight: 700; color: var(--brand); }

/* ------------------------------------------------------------------ links & buttons */
.b-link {
  display: inline-block; padding-bottom: 4px; font-weight: 600; color: var(--ink);
  background: linear-gradient(var(--brand), var(--brand)) left bottom / 40% 3px no-repeat;
  transition: background-size .35s cubic-bezier(.4, 0, .2, 1);
}
.b-link:hover { background-size: 100% 3px; }
.b-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

.b-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1.5px solid var(--ink);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; line-height: 1.2;
  cursor: pointer; white-space: nowrap; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
}
.b-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgba(15, 18, 32, .55); }
.b-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.b-btn-brand { background: var(--brand); border-color: var(--brand); }
.b-btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.b-btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.b-btn-ghost:hover { border-color: rgba(15, 18, 32, .3); box-shadow: none; }
.b-btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.b-btn-danger:hover { background: var(--danger-soft); box-shadow: none; }
.b-btn-sm { padding: 7px 14px; font-size: 13px; }
.b-btn-lg { padding: 15px 30px; font-size: 16px; }
.b-btn-block { width: 100%; }
.b-btn[disabled], .b-btn.is-locked { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.b-iconbtn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--ink-55); cursor: pointer;
  transition: background .15s, color .15s;
}
.b-iconbtn:hover { background: rgba(15, 18, 32, .06); color: var(--ink); }
.b-iconbtn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.b-iconbtn svg { width: 16px; height: 16px; }
.b-btn svg { flex: none; }

.b-textbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-55); cursor: pointer; }
.b-textbtn:hover { color: var(--ink); }
.b-textbtn.danger:hover { color: var(--danger); }

/* ------------------------------------------------------------------ cards */
.b-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
@media (min-width: 768px) { .b-card { padding: 30px; } }
.b-card-tight { padding: 18px 20px; border-radius: 22px; }
.b-card + .b-card { margin-top: 20px; }
.b-grid > .b-card + .b-card, .b-grid > * + .b-card { margin-top: 0; }

.b-pastel { border: 0; }
.b-peach  { background: var(--peach);  --accent: var(--peach-ink); }
.b-lilac  { background: var(--lilac);  --accent: var(--lilac-ink); }
.b-mint   { background: var(--mint);   --accent: var(--mint-ink); }
.b-butter { background: var(--butter); --accent: var(--butter-ink); }
/* "Feature" cards (Pro, welcome): soft warm tint instead of dark */
.b-dark   { background: linear-gradient(160deg, #fff7f2 0%, #fdeee6 100%); color: var(--ink); border: 1px solid rgba(254, 92, 14, .16); }
.b-dark .b-muted { color: var(--ink-55); }

.b-grid { display: grid; gap: 16px; }
.b-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 639px) {
  .b-stat { min-height: 0; padding: 16px; border-radius: 20px; }
  .b-stat-value { font-size: 20px; }
  .b-stat-label { font-size: 10px; letter-spacing: .16em; }
  .b-stat-note { font-size: 12px; }
}
@media (min-width: 640px)  { .b-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px)  { .b-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .b-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) { .b-grid-4 { gap: 16px; } }
@media (min-width: 1000px) { .b-split { grid-template-columns: 1.05fr 1fr; } .b-split-wide { grid-template-columns: 1.6fr 1fr; } }

.b-section { margin-top: 28px; }
.b-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ stats */
.b-stat { position: relative; border-radius: 24px; padding: 20px 22px; min-height: 140px; display: flex; flex-direction: column; gap: 6px; }
.b-stat-label { font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--accent, var(--ink-55)); }
.b-stat-value { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.b-stat-note { margin-top: auto; font-size: 13px; color: var(--ink-70); }
.b-stat .b-bar { margin-top: 8px; background: rgba(255, 255, 255, .65); }

/* ------------------------------------------------------------------ progress */
.b-bar { position: relative; height: 8px; border-radius: 999px; background: rgba(15, 18, 32, .07); overflow: hidden; }
.b-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--bar, var(--brand)); transition: width .5s cubic-bezier(.2, .7, .2, 1); }
.b-bar > span.paid { background: var(--ink); opacity: .85; }
.b-bar.over > span:not(.paid) { background: var(--danger); }
.b-bar-thin { height: 5px; }
.b-bar-marker { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 2px; }

/* ------------------------------------------------------------------ app header + tabs */
.b-apphead-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.b-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.b-tabs { display: flex; gap: 6px; margin-top: 26px; padding: 5px; border-radius: 999px; background: rgba(15, 18, 32, .05); width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.b-tabs::-webkit-scrollbar { display: none; }
.b-tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-70); white-space: nowrap; transition: background .15s, color .15s; }
.b-tab:hover { color: var(--ink); }
.b-tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 18, 32, .12); }
.b-tab .b-count { min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; text-align: center; }

/* ------------------------------------------------------------------ banners & flash */
.b-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; padding: 16px 20px; border-radius: 20px; background: #fff7f2; border: 1px solid rgba(254, 92, 14, .18); color: var(--ink); }
.b-banner p { font-size: 14px; color: var(--ink-70); }
.b-banner strong { color: var(--ink); }
.b-banner .b-textbtn { color: var(--ink-55); }

.b-flash { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 13px 16px; border-radius: 16px; font-size: 14px; font-weight: 500; animation: b-in .3s ease-out; }
.b-flash svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.b-flash-success { background: var(--ok-soft); color: #065f46; }
.b-flash-error { background: var(--danger-soft); color: #991b1b; }

.b-callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 18px; font-size: 14px; }
.b-callout > svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.b-callout-ok { background: var(--ok-soft); color: #065f46; }
.b-callout-warn { background: #fff7ed; color: #9a3412; }
.b-callout-bad { background: var(--danger-soft); color: #991b1b; }

@keyframes b-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ badges */
.b-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.b-badge-PLANNED { background: #f1f2f5; color: #52525b; }
.b-badge-QUOTED  { background: var(--butter); color: var(--butter-ink); }
.b-badge-BOOKED  { background: var(--lilac); color: var(--lilac-ink); }
.b-badge-PAID    { background: var(--mint); color: var(--mint-ink); }
.b-badge-over    { background: var(--danger-soft); color: var(--danger); }
.b-badge-due     { background: #fff7ed; color: #c2410c; }
.b-badge-pro     { background: var(--ink); color: #fff; letter-spacing: .12em; font-size: 10px; }
.b-badge-link    { background: var(--brand-soft); color: var(--brand-dark); }

/* ------------------------------------------------------------------ forms */
.b-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.b-form-row > * { min-width: 0; }
.b-label { font-size: 12.5px; font-weight: 600; color: var(--ink-70); }
.b-label small { font-weight: 400; color: var(--ink-40); }
.b-input, .b-select, .b-textarea {
  width: 100%; padding: 11px 14px; border: 1px solid rgba(15, 18, 32, .16); border-radius: 14px;
  background: #fff; font: inherit; font-size: 15px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
.b-select { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230f1220' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.b-textarea { min-height: 76px; resize: vertical; }
.b-input:focus, .b-select:focus, .b-textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(254, 92, 14, .14); }
.b-input::placeholder, .b-textarea::placeholder { color: var(--ink-40); }
.b-input-sm, .b-select.b-input-sm { padding: 8px 12px; font-size: 14px; border-radius: 12px; }
.b-money { position: relative; min-width: 0; }
.b-money > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; font-weight: 600; color: var(--ink-40); pointer-events: none; }
.b-money > .b-input { padding-left: calc(14px + var(--sym-w, 34px)); font-variant-numeric: tabular-nums; }
.b-form-row { display: grid; gap: 12px; }
@media (min-width: 640px) {
  .b-form-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-form-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .b-form-row.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.b-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.b-help { font-size: 12.5px; color: var(--ink-55); }

.b-seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(15, 18, 32, .06); }
.b-seg label { position: relative; cursor: pointer; }
.b-seg input { position: absolute; opacity: 0; pointer-events: none; }
.b-seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-70); }
.b-seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 18, 32, .12); }
.b-seg input:disabled + span { opacity: .45; cursor: not-allowed; }
.b-seg input:focus-visible + span { outline: 2px solid var(--brand); }

form.htmx-request { opacity: .65; pointer-events: none; transition: opacity .15s; }

/* ------------------------------------------------------------------ add-row (quick add) */
.b-quickadd { display: grid; gap: 10px; padding: 14px 18px; border-top: 1px dashed var(--line); background: rgba(15, 18, 32, .015); }
.b-quickadd > * { min-width: 0; }
@media (min-width: 720px) { .b-quickadd { grid-template-columns: minmax(0, 1fr) 190px auto; align-items: center; } }

/* ------------------------------------------------------------------ category card */
.b-cat { background: #fff; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; scroll-margin-top: 90px; }
.b-cat + .b-cat { margin-top: 16px; }
.b-cat-head { display: grid; gap: 12px; padding: 18px 20px; }
@media (min-width: 760px) { .b-cat-head { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.b-cat-name { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.b-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--brand)); }
.b-cat-figs { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--ink-55); }
.b-cat-figs b { color: var(--ink); font-weight: 700; }
.b-cat-tools { display: flex; align-items: center; gap: 2px; justify-self: end; }
.b-cat-bar { padding: 0 20px 16px; }

/* ------------------------------------------------------------------ item rows */
.b-items { border-top: 1px solid var(--line); }
.b-item { border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.b-item:last-child { border-bottom: 0; }
.b-item > summary { list-style: none; cursor: pointer; display: grid; gap: 8px; padding: 14px 20px; transition: background .15s; }
.b-item > summary::-webkit-details-marker { display: none; }
.b-item > summary:hover { background: rgba(15, 18, 32, .025); }
.b-item[open] > summary { background: rgba(254, 92, 14, .05); }
@media (min-width: 860px) {
  .b-item > summary { grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(90px, 1fr)) 28px; align-items: center; }
}
.b-item-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 600; font-size: 15px; }
.b-item-vendor { width: 100%; font-size: 12.5px; font-weight: 500; color: var(--ink-55); }
.b-item-fig { display: flex; justify-content: space-between; font-size: 14px; font-variant-numeric: tabular-nums; }
.b-item-fig small { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-40); }
@media (min-width: 860px) {
  .b-item-fig { display: block; text-align: right; }
  .b-item-fig small { display: none; }
}
.b-item-chev { justify-self: end; color: var(--ink-40); transition: transform .2s; }
.b-item[open] .b-item-chev { transform: rotate(180deg); }
.b-item-body { display: grid; gap: 22px; padding: 6px 20px 22px; }
@media (min-width: 960px) { .b-item-body { grid-template-columns: 1.3fr 1fr; } }
.b-cols-head { display: none; }
@media (min-width: 860px) {
  .b-cols-head { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(90px, 1fr)) 28px; gap: 8px; padding: 10px 20px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-40); border-top: 1px solid var(--line); }
  .b-cols-head span:not(:first-child) { text-align: right; }
}

.b-panel { border-radius: 18px; background: #fafafb; border: 1px solid var(--line); padding: 16px; }
.b-panel-title { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-55); margin-bottom: 12px; }

/* ------------------------------------------------------------------ lists & tables */
.b-list { display: flex; flex-direction: column; }
.b-list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.b-list-row:last-child { border-bottom: 0; }
.b-list-main { min-width: 0; }
.b-list-title { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; }
.b-list-meta { font-size: 12.5px; color: var(--ink-55); }
.b-list-side { display: flex; align-items: center; gap: 10px; justify-content: flex-end; text-align: right; }
.b-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.b-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.b-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-40); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.b-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.b-table tr:last-child td { border-bottom: 0; }
.b-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.b-table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------------ donut */
.b-donut-wrap { display: grid; gap: 22px; align-items: center; }
@media (min-width: 560px) { .b-donut-wrap { grid-template-columns: 190px minmax(0, 1fr); } }
.b-donut { position: relative; width: 190px; height: 190px; margin: 0 auto; }
.b-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.b-donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.b-donut-center strong { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.b-donut-center span { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-40); }
.b-legend { display: flex; flex-direction: column; gap: 9px; }
.b-legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 14px; }
.b-legend-row .pct { color: var(--ink-40); font-size: 12px; font-variant-numeric: tabular-nums; width: 36px; text-align: right; }

/* ------------------------------------------------------------------ empty states */
.b-empty { text-align: center; padding: 44px 24px; border: 1.5px dashed rgba(15, 18, 32, .15); border-radius: var(--radius); background: rgba(255, 255, 255, .6); }
.b-empty h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.b-empty p { margin: 8px auto 18px; max-width: 42ch; color: var(--ink-70); font-size: 15px; }

/* ------------------------------------------------------------------ pro */
.b-pro-card { position: relative; overflow: hidden; }
.b-pro-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(254, 92, 14, .14), transparent 70%); pointer-events: none; }
.b-checks { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.b-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.b-checks li::before { content: "✓"; flex: none; font-weight: 800; color: var(--brand); }
.b-price { font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.b-lock { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-55); }

/* ------------------------------------------------------------------ vendor picker */
.b-vendor { position: relative; }
.b-vr { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px -18px rgba(15, 18, 32, .35); overflow: hidden; }
.b-vr:empty { display: none; }
.b-vr button { display: flex; width: 100%; justify-content: space-between; gap: 10px; padding: 10px 14px; text-align: left; background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; }
.b-vr button:hover, .b-vr button:focus-visible { background: var(--brand-soft); outline: 0; }
.b-vr small { color: var(--ink-55); }
.b-vr-foot { padding: 8px 14px; font-size: 12px; color: var(--ink-55); background: #fafafb; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ toast (htmx errors) */
.b-toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .5); transition: opacity .25s, transform .25s; }
.b-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ misc */
.b-divider { height: 1px; background: var(--line); margin: 22px 0; }
.b-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(15, 18, 32, .05); font-size: 13px; font-weight: 600; }
.b-copy { display: flex; gap: 8px; }
.b-copy .b-input { font-size: 13px; }
.b-hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.b-disclose > summary { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .b-btn, .b-link, .b-bar > span, .b-flash, .b-toast { transition: none; animation: none; }
}

/* ------------------------------------------------------------------ print */
@media print {
  #siteHeader, .b-noprint, .b-tabs, .b-actions, .b-banner, footer { display: none !important; }
  .b-body { background: #fff; }
  .b-wrap { padding: 0; max-width: none; }
  .b-card, .b-cat { break-inside: avoid; border-color: #ddd; }
}

/* =============================================================================
   App layout: left sidebar + main column
============================================================================= */
.b-app { max-width: 1360px; margin: 0 auto; padding: 20px 16px 80px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.b-main, .b-side { min-width: 0; }
@media (min-width: 1000px) {
  .b-app { grid-template-columns: 250px minmax(0, 1fr); gap: 40px; padding: 32px 32px 96px; }
}

.b-side { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 1000px) {
  .b-side { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 108px); overflow-y: auto; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 24px; scrollbar-width: thin; }
}
.b-side-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-55); transition: color .15s; }
.b-side-back:hover { color: var(--brand); }
.b-side-current { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: #fff7f2; border: 1px solid rgba(254, 92, 14, .14); }
.b-side-current strong { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-side-current small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-55); }
.b-side-avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 800; }

.b-side-nav, .b-side-group { display: flex; flex-direction: column; gap: 2px; }
.b-side-group { padding-top: 14px; border-top: 1px solid var(--line); }
.b-side-label { margin: 0 0 6px 10px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-40); }
.b-side-link { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; font-weight: 600; color: var(--ink-70); text-align: left; background: none; border: 0; cursor: pointer; transition: background .15s, color .15s; }
.b-side-link svg { flex: none; color: var(--ink-40); transition: color .15s; }
.b-side-link:hover { background: rgba(15, 18, 32, .04); color: var(--ink); }
.b-side-link.is-active { background: var(--brand-soft); color: var(--ink); }
.b-side-link.is-active svg { color: var(--brand); }
.b-side-link .b-count, .b-side-link .b-badge { margin-left: auto; }
.b-side-link .b-count { min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; text-align: center; }
.b-side-btn { font: inherit; font-size: 14.5px; font-weight: 600; }
.b-side-budget { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; font-size: 14px; color: var(--ink-70); }
.b-side-budget span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-side-budget:hover { background: rgba(15, 18, 32, .04); color: var(--ink); }
.b-side-budget.is-active { color: var(--ink); font-weight: 700; }
.b-side-pro { display: block; padding: 14px; border-radius: 16px; background: linear-gradient(160deg, #fff7f2 0%, #fdeee6 100%); border: 1px solid rgba(254, 92, 14, .16); transition: transform .2s; }
.b-side-pro:hover { transform: translateY(-1px); }
.b-side-pro strong { display: block; font-size: 13.5px; color: var(--ink); }
.b-side-pro span { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: var(--ink-55); }
.b-side-prochip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-55); }

/* Phones & tablets: sidebar becomes a compact top strip */
@media (max-width: 999px) {
  .b-side-current, .b-side-group, .b-side-pro, .b-side-prochip { display: none; }
  .b-side { gap: 12px; }
  .b-side-nav { flex-direction: row; gap: 6px; overflow-x: auto; padding: 5px; border-radius: 999px; background: rgba(15, 18, 32, .05); scrollbar-width: none; }
  .b-side-nav::-webkit-scrollbar { display: none; }
  .b-side-link { width: auto; flex: none; padding: 9px 16px; border-radius: 999px; font-size: 14px; }
  .b-side-link.is-active { background: #fff; box-shadow: 0 1px 3px rgba(15, 18, 32, .12); }
  .b-side-link svg { display: none; }
}
