/* Bruce Track — samme udtryk som bruceagency.dk */
:root {
  --bone: #ECE9E4;
  --card: #F5F3EF;
  --ink: #1D1D1F;
  --muted: #5F5E5B;
  --sage: #868974;
  --sage-ink: #4E513F;
  --line: rgba(29, 29, 31, .14);
  --line-soft: rgba(29, 29, 31, .09);
  --good: #2F6B2A;
  --good-bg: #DDE6D8;
  --warn: #8A5A12;
  --warn-bg: #F1E3C4;
  --bad: #A23A26;
  --bad-bg: #F2D6CF;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font: "Helvetica Neue", Helvetica, Inter, Arial, sans-serif;
  --radius: 4px;
  --pad: clamp(16px, 4vw, 56px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bone); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
a:hover { color: var(--sage-ink); }
button, input, textarea, select { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .92em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.num { font-family: var(--mono); font-size: 12px; opacity: .65; }
.inline { display: inline; margin: 0; }

/* ---------- Knapper og felter ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 3px; border: 1px solid rgba(29,29,31,.3); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; font-size: 15px; }
.btn:hover { background: rgba(29,29,31,.05); color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.btn-primary:hover { background: #000; color: var(--bone); }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn-danger { border-color: var(--bad); color: var(--bad); }
.btn-link { background: none; border: 0; padding: 8px 0; color: var(--ink); text-decoration: underline; cursor: pointer; min-height: 44px; }
.btn[disabled] { opacity: .55; cursor: progress; }

label { display: block; font-size: 14px; margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=password], input:not([type]), textarea, select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(29,29,31,.25); border-radius: 3px; background: #FBFAF8;
}
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: center; margin: 16px 0; font-size: 14px; }
.check input { width: 18px; height: 18px; }

.msg { padding: 12px 14px; border-radius: 3px; margin: 12px 0; font-size: 14px; }
.msg-error { background: var(--bad-bg); color: #6E2416; }
.msg-info { background: var(--card); border: 1px solid var(--line); }

/* ---------- Login / opsætning ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 5vw, 40px); }
.auth-card h1 { font-size: 28px; font-weight: 500; letter-spacing: -.01em; margin: 10px 0 12px; line-height: 1.15; }
.auth-card form .btn-primary { width: 100%; margin-top: 20px; }
.auth-foot { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; margin-top: 20px; }
.qr { display: flex; justify-content: center; margin: 16px 0; }
.qr img { background: #fff; border: 1px solid var(--line); image-rendering: pixelated; max-width: 100%; height: auto; }
.steps { padding-left: 20px; margin: 0 0 8px; }
.steps li { margin: 4px 0; }
.manual summary { cursor: pointer; font-size: 14px; min-height: 32px; }
.secret { display: inline-block; font-size: 16px; letter-spacing: .08em; background: #fff; padding: 8px 10px; border: 1px solid var(--line); word-break: break-all; }
.codes { columns: 2; padding-left: 22px; margin: 16px 0; }
.codes li { margin: 6px 0; }
.codes code { font-size: 15px; letter-spacing: .05em; }
pre.copy { white-space: pre-wrap; word-break: break-all; background: #fff; border: 1px solid var(--line); padding: 12px; border-radius: 3px; }

/* ---------- Dashboard-ramme ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 32px var(--pad) 64px; padding-top: max(32px, env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 24px; }
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.top-id { display: flex; flex-direction: column; gap: 8px; }
.site { margin: 0; font-size: clamp(30px, 4vw, 44px); font-weight: 500; letter-spacing: -.02em; line-height: 1; }
.tagline { color: var(--muted); }
.site-pick { position: relative; display: inline-flex; align-items: center; max-width: 100%; }
.site-select { font: inherit; color: inherit; letter-spacing: inherit; line-height: 1.1; background: transparent; border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; padding: 0 1.1em 4px 0; margin: 0; cursor: pointer; appearance: none; -webkit-appearance: none; max-width: 100%; text-overflow: ellipsis; }
.site-select:hover { border-bottom-color: var(--ink); }
.site-select:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.site-caret { position: absolute; right: 0; top: 50%; transform: translateY(-60%); font-size: .45em; pointer-events: none; color: var(--muted); }
.top-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; flex: none; }
.live .dot { animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live .dot { animation: none; } }

.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; min-height: 36px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--bone); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 3px; border: 1px solid var(--line); background: var(--card); text-decoration: none; font-size: 15px; }
.tabs a[aria-current=page] { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.tabs .count:empty { display: none; }
.tabs .count { font-family: var(--mono); font-size: 12px; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.loading { padding: 48px 0; color: var(--muted); }

/* ---------- Byggeklodser ---------- */
.stack { display: flex; flex-direction: column; gap: 24px; }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 24px; }
.row > * { flex: 1 1 380px; min-width: 0; }
.row.three > * { flex-basis: 300px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card h2 { margin: 0; font-size: 17px; font-weight: 500; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.card .hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
.kpi { gap: 10px; }
.kpi .label { font-size: 14px; color: var(--muted); }
.kpi .value { font-size: clamp(32px, 3.4vw, 42px); font-weight: 500; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 13px; color: var(--muted); }
.up { color: var(--good); font-weight: 500; }
.down { color: var(--bad); font-weight: 500; }

/* Søjlediagram */
.chart { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 240px; padding-top: 44px; border-bottom: 1px solid var(--line); }
.bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.bar i { display: block; background: var(--sage); border-radius: 2px 2px 0 0; min-height: 1px; }
.bar.peak i { background: var(--ink); }
.bar.future i { background: transparent; border: 1px dashed var(--line); }
.bar:hover i { background: var(--ink); }
.bar .tag { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; background: var(--ink); color: var(--bone); padding: 4px 8px; border-radius: 3px; pointer-events: none; z-index: 2; }
.bar .tag.left { left: auto; right: 0; transform: none; }
.bar .tag.right { left: 0; transform: none; }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* Lister med bjælker */
.blist { display: flex; flex-direction: column; gap: 12px; }
.bitem { display: flex; flex-direction: column; gap: 5px; }
.bitem .top-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.bitem .top-line span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bitem .val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bitem .val small { color: var(--muted); font-size: 12px; margin-right: 8px; }
.track { height: 6px; background: rgba(29,29,31,.08); border-radius: 3px; }
.track i { display: block; height: 6px; background: var(--ink); border-radius: 3px; }
.track.sage i { background: var(--sage); }

.mini-seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.mini-seg button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; min-height: 32px; }
.mini-seg button[aria-pressed=true] { background: var(--ink); color: var(--bone); border-color: var(--ink); }

.kv { display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.kv > div:last-child { border-bottom: 0; }
.kv .big { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }

.stackbar { display: flex; height: 26px; border-radius: 3px; overflow: hidden; background: rgba(29,29,31,.06); }
.stackbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { width: 10px; height: 10px; display: inline-block; }

.empty { padding: 20px 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Tabeller */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 400; color: var(--muted); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { display: block; font-size: 13px; color: var(--muted); }
.company-link { font-weight: 500; text-decoration: none; }
.company-link:hover { text-decoration: underline; }
table.companies { min-width: 820px; }

.badge { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge-Varm { background: var(--ink); color: var(--bone); }
.badge-Lun { background: #D9D6CC; color: var(--ink); }
.badge-Ny { box-shadow: inset 0 0 0 1px var(--ink); }
.badge-Stille { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.badge-status { background: var(--good-bg); color: var(--good); margin-left: 6px; }
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-mid { background: var(--warn-bg); color: var(--warn); }
.badge-poor { background: var(--bad-bg); color: var(--bad); }

/* Virksomhed */
.back { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.company-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.company-head h2 { margin: 6px 0 8px; font-size: clamp(28px, 3.6vw, 42px); font-weight: 500; letter-spacing: -.02em; line-height: 1.05; overflow-wrap: anywhere; }
.company-head .meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.why { background: var(--ink); color: var(--bone); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.why .eyebrow { color: #C9C5BA; }
.why p { margin: 0; }
.why .lead { font-size: clamp(19px, 2.1vw, 24px); line-height: 1.38; max-width: 920px; }
.why .tip { font-size: 14px; color: #D3CFC5; }
.timeline { display: flex; flex-direction: column; }
.tl { display: flex; gap: 14px; }
.tl .rail { display: flex; flex-direction: column; align-items: center; width: 12px; flex: none; }
.tl .rail b { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); margin-top: 5px; flex: none; }
.tl .rail span { width: 1px; flex: 1; background: rgba(29,29,31,.2); }
.tl:last-child .rail span { display: none; }
.tl .body { padding-bottom: 18px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tl .when { font-weight: 500; }
.tl .path { font-size: 14px; overflow-wrap: anywhere; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--good-bg); color: var(--good); margin-left: 6px; }

/* Sundhed */
.vital { background: var(--bone); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.vital .v { font-size: 34px; font-weight: 500; letter-spacing: -.02em; line-height: 1; }
.issue { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.issue:last-child { border-bottom: 0; }
.issue .dot { margin-top: 6px; }
.issue .dot.warn { background: #C2862B; }
.issue .dot.bad { background: var(--bad); }
.issue .t { font-weight: 500; overflow-wrap: anywhere; }
.issue .m { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.users td .btn-small { margin: 2px 4px 2px 0; }
.linkbox { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbox input { flex: 1 1 260px; font-family: var(--mono); font-size: 13px; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.form-row > div { flex: 1 1 240px; }
.form-row label { margin-top: 0; }

@media (max-width: 640px) {
  .wrap { gap: 18px; }
  .chart { height: 200px; gap: 2px; }
  .bar .tag { font-size: 11px; }
  .card { padding: 18px; }
  .codes { columns: 1; }
  .seg { width: 100%; justify-content: space-between; }
  .seg button { flex: 1; padding: 7px 6px; }
}

/* Lokal testversion */
.dev-banner { position: sticky; top: 0; z-index: 50; background: #D9B56B; color: #1D1D1F; text-align: center; font-size: 13px; font-weight: 500; padding: 6px 12px; letter-spacing: .02em; }
