/* Business pages of the specification gap closure (2026-10-25): status board, inventory, scan,
   finance, configuration, pricing card, documents. Colours come from the component library theme
   (--surface, --text, --primary, ...) so the pages follow the dark and light themes; Bootstrap's
   --bs-* colours stay light in the dark theme. */

.biz-page { display: flex; flex-direction: column; gap: 1rem; }

/* ── Generic building blocks ─────────────────────────────────────────── */

.biz-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.biz-grid--wide { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.biz-card { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.biz-card__title { display: flex; align-items: center; gap: .5rem; justify-content: space-between; font-weight: 600; }
.biz-card__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.biz-muted { color: var(--app-muted); font-size: .875rem; }
.biz-kv { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: .25rem .75rem; align-items: baseline; }
.biz-kv > dt { font-weight: 500; color: var(--app-muted); font-size: .875rem; }
.biz-kv > dd { margin: 0; }
.biz-kv__total { border-top: 1px solid var(--app-hairline); padding-top: .25rem; font-weight: 600; }
.biz-positive { color: var(--success); font-weight: 600; }
.biz-negative { color: var(--error); font-weight: 600; }
.biz-form { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.biz-form__wide { grid-column: 1 / -1; }
.biz-form__error { color: var(--error); font-size: .875rem; }
.biz-section-title { font-weight: 600; margin: .5rem 0 0; display: flex; align-items: center; gap: .5rem; }
.biz-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.biz-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.biz-table th, .biz-table td { padding: .4rem .5rem; border-bottom: 1px solid var(--app-hairline); text-align: left; vertical-align: top; }
.biz-table th { font-weight: 600; white-space: nowrap; }
.biz-table td.num, .biz-table th.num { text-align: right; white-space: nowrap; }
.biz-table tr.biz-row--link { cursor: pointer; }
.biz-table tr.biz-row--link:hover { background: color-mix(in srgb, var(--text) 6%, var(--background)); }
.biz-empty { padding: 1rem; text-align: center; color: var(--app-muted); }
.biz-scroll-x { overflow-x: auto; }

/* Status / kind badge; the background is the status colour (inline style). */
.biz-badge { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem;
             font-weight: 600; color: #fff; background: #6c757d; white-space: nowrap; }
.biz-badge--outline { background: transparent; color: inherit; border: 1px solid currentColor; }
.biz-badge--warn { background: var(--warning); color: #212529; }
.biz-badge--error { background: var(--error); }
.biz-badge--success { background: #198754; }

/* Context help (?) */
.biz-help { display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem; border-radius: 50%;
            font-size: .7rem; font-weight: 700; cursor: help; color: var(--app-muted);
            border: 1px solid currentColor; margin-left: .25rem; vertical-align: middle; }
.biz-hint { font-size: .8rem; color: var(--app-muted); margin-top: -.25rem; }

/* Progress bar (coverage, refinancing) */
.biz-progress { height: .5rem; border-radius: .25rem; background: color-mix(in srgb, var(--text) 10%, var(--surface)); overflow: hidden; min-width: 80px; }
.biz-progress > span { display: block; height: 100%; background: var(--success); }

/* Alerts list on the dashboard */
.biz-alerts { display: flex; flex-direction: column; gap: .5rem; }
.biz-alert { display: flex; gap: .5rem; align-items: center; padding: .5rem .75rem; border-radius: .5rem; border-left: 4px solid; background: color-mix(in srgb, var(--text) 6%, var(--background)); }
.biz-alert--warning { border-color: var(--warning); }
.biz-alert--error { border-color: var(--error); }
.biz-alert--info { border-color: var(--secondary); }

/* Simple bar chart (finance) */
.biz-bars { display: flex; align-items: flex-end; gap: .35rem; height: 160px; padding: .5rem 0; overflow-x: auto; }
.biz-bars__item { display: flex; flex-direction: column; align-items: center; gap: .25rem; min-width: 42px; flex: 1; }
.biz-bars__pair { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.biz-bars__bar { width: 14px; border-radius: 3px 3px 0 0; }
.biz-bars__bar--revenue { background: var(--primary); }
.biz-bars__bar--profit { background: var(--success); }
.biz-bars__bar--loss { background: var(--error); }
.biz-bars__label { font-size: .7rem; white-space: nowrap; color: var(--app-muted); }

/* ── Status board (drag & drop) ──────────────────────────────────────── */

.biz-board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; align-items: flex-start; }
.biz-board__col { flex: 0 0 260px; background: color-mix(in srgb, var(--text) 6%, var(--background)); border-radius: .5rem; display: flex; flex-direction: column;
                  max-height: 75vh; border-top: 4px solid #6c757d; }
.biz-board__col--over { outline: 2px dashed var(--primary); outline-offset: -2px; }
.biz-board__head { padding: .5rem .75rem; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.biz-board__body { padding: .25rem .5rem .5rem; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; min-height: 60px; }
.biz-board__card { background: var(--surface); border-radius: .4rem; padding: .5rem; box-shadow: 0 1px 2px rgba(0,0,0,.08);
                   cursor: grab; display: flex; flex-direction: column; gap: .15rem; font-size: .85rem; border-left: 3px solid transparent; }
.biz-board__card--overdue { border-left-color: var(--error); }
.biz-board__card--dragging { opacity: .5; }
.biz-board__card-title { font-weight: 600; color: var(--app-accent-text); }
.biz-board__card select { font-size: .8rem; padding: .1rem .25rem; }

/* ── Inventory tree ──────────────────────────────────────────────────── */

.biz-tree { list-style: none; padding-left: 0; margin: 0; }
.biz-tree .biz-tree { padding-left: 1.25rem; border-left: 1px dashed var(--app-hairline); margin-left: .4rem; }
.biz-tree__node { padding: .25rem 0; }
.biz-tree__head { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.biz-tree__devices { list-style: none; padding-left: 1.5rem; margin: .25rem 0; font-size: .875rem; }
.biz-tree__devices li { display: flex; gap: .5rem; align-items: center; padding: .1rem 0; }

/* ── Scan page ───────────────────────────────────────────────────────── */

.biz-scan { max-width: 760px; }
.biz-scan__modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; }
.biz-scan__mode { padding: .75rem; border-radius: .5rem; border: 2px solid var(--app-hairline); background: var(--surface);
                  font-weight: 600; cursor: pointer; display: flex; gap: .5rem; align-items: center; justify-content: center; }
.biz-scan__mode--active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 22%, var(--surface)); }
.biz-scan__input { width: 100%; font-size: 1.4rem; padding: .75rem 1rem; border-radius: .5rem; border: 2px solid var(--primary); font-family: monospace; }
.biz-banner { padding: .75rem 1rem; border-radius: .5rem; font-weight: 600; display: flex; gap: .5rem; align-items: center; }
.biz-banner--ok { background: color-mix(in srgb, var(--success) 22%, var(--surface)); color: var(--text); }
.biz-banner--fail { background: color-mix(in srgb, var(--error) 22%, var(--surface)); color: var(--text); }
.biz-banner--queued { background: color-mix(in srgb, var(--warning) 22%, var(--surface)); color: var(--text); }

/* ── Images picker (listing dialog) ──────────────────────────────────── */

.biz-images { display: flex; flex-wrap: wrap; gap: .5rem; }
.biz-images__item { position: relative; width: 84px; height: 84px; border-radius: .4rem; overflow: hidden; border: 3px solid transparent; cursor: pointer; background: #eee; }
.biz-images__item--selected { border-color: var(--primary); }
.biz-images__item img { width: 100%; height: 100%; object-fit: cover; }
.biz-images__order { position: absolute; top: 2px; left: 2px; background: var(--primary); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .35rem; }

.biz-preview { border: 1px solid var(--app-hairline); border-radius: .5rem; padding: .75rem; max-height: 320px; overflow: auto; background: var(--surface); }

@media (max-width: 600px) {
    .biz-board__col { flex-basis: 85vw; }
    .biz-kv { grid-template-columns: 1fr; }
    .biz-scan__input { font-size: 1.2rem; }
}
