/* Tahona Billing screens. Every colour comes from the theme tokens; load tobala-blazor.css, then the theme, then this. */

html, body { margin: 0; background: var(--tb-bone); color: var(--tb-ink); font-family: var(--tb-font-body); font-size: 15px; line-height: 1.45; }
a { color: var(--tb-ink); }
a:hover { color: var(--tb-copper); }
h1, h2, .display { font-family: var(--tb-font-display); font-weight: 700; line-height: 1.1; margin: 0; }
h1 { font-size: 34px; }
h2 { font-size: 16px; font-family: var(--tb-font-body); font-weight: 600; }
.eyebrow { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--tb-smoke); margin: 0; }
.muted { color: var(--tb-smoke); }
.num { font-variant-numeric: tabular-nums; }

/* Shell */
.billing-shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.billing-nav { flex: 1 1 220px; max-width: 240px; background: var(--tb-nav-bg); color: var(--tb-nav-ink); padding: 24px 20px; display: flex; flex-direction: column; gap: 28px; box-sizing: border-box; }
.billing-nav .brand { font-family: var(--tb-font-display); font-weight: 700; font-size: 19px; letter-spacing: 4px; color: var(--tb-nav-ink); text-decoration: none; }
.billing-nav .brand span { font-weight: 600; letter-spacing: 2px; color: var(--tb-nav-muted); }
.billing-nav ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.billing-nav a:not(.brand) { display: block; padding: 10px 12px; color: var(--tb-nav-ink-soft); text-decoration: none; border-left: 2px solid transparent; }
.billing-nav a.active { color: var(--tb-nav-ink); background: #2A2A27; border-left-color: #D4943A; }
.billing-body { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.billing-main { flex: 1; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; box-sizing: border-box; }
.billing-footer { padding: 14px 32px; border-top: 1px solid var(--tb-line); font-size: 12.5px; color: var(--tb-smoke); display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head .titles { display: flex; flex-direction: column; gap: 6px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stages { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--tb-smoke); }
.stages .done { color: var(--tb-ok); }
.stages .current { color: var(--tb-ink); font-weight: 600; border-bottom: 2px solid var(--tb-copper); padding-bottom: 2px; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.stat-tile { background: var(--tb-surface); border: 1px solid var(--tb-line); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--tb-smoke); }
.stat-value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 13.5px; color: var(--tb-smoke); }
.stat-ok .stat-value { color: var(--tb-ok); }
.stat-warn { background: var(--tb-warn-bg); border-color: #E3C98F; }
.stat-warn .stat-label, .stat-warn .stat-value, .stat-warn .stat-note { color: #5A3F0A; }
.stat-error .stat-value { color: var(--tb-error); }

/* Panels and tables */
.panel { background: var(--tb-surface); border: 1px solid var(--tb-line); display: flex; flex-direction: column; }
.panel-head { padding: 14px 16px; border-bottom: 1px solid var(--tb-line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.panel-head .hint { font-size: 13.5px; color: var(--tb-smoke); }
.table-wrap { overflow-x: auto; }
table.billing { border-collapse: collapse; width: 100%; min-width: 720px; }
table.billing th { font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--tb-smoke); font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--tb-rule); white-space: nowrap; }
table.billing td { padding: 11px 12px; border-bottom: 1px solid #E6E0D4; font-size: 14.5px; vertical-align: top; }
table.billing td.n, table.billing th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.billing tr.resolved { color: var(--tb-smoke); }
table.billing tr.attention { background: var(--tb-warn-bg); }
table.billing tr.expandable { cursor: pointer; }
.fixes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.fixes button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--tb-ink); font-weight: 600; cursor: pointer; text-decoration: underline; }
.fixes button.link.quiet { color: var(--tb-smoke); font-weight: 400; }

/* Pills and chips */
.pill { display: inline-block; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; padding: 3px 9px; border: 1px solid var(--tb-rule); color: var(--tb-smoke); }
.pill-ok { border-color: var(--tb-ok); color: var(--tb-ok); }
.pill-warn, .pill-accent { border-color: var(--tb-copper); color: #5A3F0A; }
.pill-error { border-color: var(--tb-error); color: var(--tb-error); }
.chip { display: inline-block; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; padding: 2px 8px; border: 1px solid var(--tb-rule); color: var(--tb-smoke); }

/* Forms and buttons */
.billing-main input[type=text], .billing-main input[type=number], .billing-main input[type=date], .billing-main input[type=email], .billing-main select, .billing-main textarea { font: inherit; color: var(--tb-ink); background: var(--tb-surface); border: 1px solid var(--tb-rule); padding: 10px 12px; min-height: 44px; width: 100%; box-sizing: border-box; font-variant-numeric: tabular-nums; }
.billing-main input:focus, .billing-main select:focus, .billing-main textarea:focus { outline: 2px solid var(--tb-copper); outline-offset: 1px; }
.billing-main label { font-size: 13px; color: var(--tb-smoke); display: flex; flex-direction: column; gap: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 14px; }
fieldset.group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
fieldset.group legend { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--tb-smoke); padding: 0; margin-bottom: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--tb-ink); background: var(--tb-ink); color: var(--tb-nav-ink); text-decoration: none; }
.btn.primary { background: var(--tb-copper); border-color: var(--tb-copper); color: var(--tb-surface); }
.btn.ghost { background: transparent; color: var(--tb-ink); }
.btn:disabled { background: var(--tb-rule); border-color: var(--tb-rule); color: #6B655A; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.tb-softwarn, .softwarn { background: var(--tb-warn-bg); color: #5A3F0A; padding: 12px 16px; font-size: 14.5px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.error-text { color: var(--tb-error); font-size: 13.5px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; }
.fact { display: flex; flex-direction: column; gap: 6px; border-top: 2px solid var(--tb-ink); padding-top: 12px; }
.fact .value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.period-picker { display: inline-flex; align-items: center; gap: 10px; }
.period-picker button { min-height: 44px; min-width: 44px; background: transparent; border: 1px solid var(--tb-rule); font: inherit; font-size: 18px; cursor: pointer; }
.period-label { font-weight: 600; min-width: 140px; text-align: center; }
.inline-form { background: var(--tb-surface-tint); border: 1px solid var(--tb-line); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
