/* Holstebro Rengøring CRM
   Mobil-først. Alt under 700 px er den primære visning; bredere skærme får
   mere plads, ikke et andet design. */

:root {
  color-scheme: light dark;

  --paper:        #f6f4f0;
  --surface:      #ffffff;
  --surface-sunk: #efece6;
  --line:         #ddd8cf;
  --line-strong:  #c6bfb2;

  --ink:          #1b1a17;
  --ink-soft:     #56534c;
  --ink-faint:    #868177;

  --brand:        #1f5b4a;
  --brand-strong: #164437;
  --brand-tint:   #e4ede9;
  --brand-ink:    #ffffff;

  --warn:         #9a5b12;
  --warn-tint:    #f7ecdc;
  --danger:       #a03530;
  --danger-tint:  #f8e6e4;

  --radius:       10px;
  --radius-lg:    16px;
  --tap:          44px;

  --shadow-low:   0 1px 2px rgba(27, 26, 23, .06), 0 1px 1px rgba(27, 26, 23, .04);
  --shadow-mid:   0 4px 16px rgba(27, 26, 23, .10);
  --shadow-high:  0 -8px 40px rgba(27, 26, 23, .18);

  --bar-height:   calc(58px + env(safe-area-inset-bottom));
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #14161a;
    --surface:      #1c1f24;
    --surface-sunk: #24282e;
    --line:         #2f343b;
    --line-strong:  #434a53;

    --ink:          #eceae6;
    --ink-soft:     #a8a49d;
    --ink-faint:    #7d7973;

    --brand:        #5fbfa2;
    --brand-strong: #7ed2b7;
    --brand-tint:   #1c2f2a;
    --brand-ink:    #10241e;

    --warn:         #d9a05a;
    --warn-tint:    #2e2620;
    --danger:       #e08079;
    --danger-tint:  #2e2020;

    --shadow-low:   0 1px 2px rgba(0, 0, 0, .4);
    --shadow-mid:   0 4px 16px rgba(0, 0, 0, .45);
    --shadow-high:  0 -8px 40px rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 { margin: 0; font-weight: 620; letter-spacing: -.011em; line-height: 1.25; }
h1 { font-size: 21px; letter-spacing: -.018em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p  { margin: 0 0 .75em; }
p:last-child { margin-bottom: 0; }
a  { color: inherit; }

/* Ren versal-label uden ornament foran. */
.eyebrow {
  font-size: 11px;
  font-weight: 640;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.tnum { font-variant-numeric: tabular-nums; }

/* Skelet ----------------------------------------------------------------- */

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--bar-height);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 16px calc(8px + env(safe-area-inset-top)) 16px;
  padding-top: calc(8px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .desktop-nav { display: none; }

.view { flex: 1; padding: 16px; }

/*
 * Lodret rytme mellem sektioner på en side. Flex-gap frem for margin mellem
 * naboer: en regel som ".card + .card" falder på gulvet, så snart der står
 * noget imellem der ikke er et kort, og så klistrer sektionerne sammen uden
 * at nogen opdager det.
 */
.view > * + *,
.stack > * + * { margin-top: 16px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

/* Bundnavigation --------------------------------------------------------- */

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 30;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: var(--bar-height);
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tap);
  font-size: 11px;
  font-weight: 560;
  color: var(--ink-faint);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.tabbar a svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tabbar a[aria-current="page"] { color: var(--brand); }

.tabbar .badge {
  position: absolute;
  transform: translate(14px, -12px);
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

/* Kort og lister --------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-low);
}

.card-pad { padding: 14px 16px; }

/*
 * Indre rytme i et kort. Uden den lander en overskrift direkte oven på det
 * første felt, og en gem-knap klistrer til feltet over sig. Elementer der har
 * deres egen bundmargin kolliderer ikke: nabomargener lægges ikke sammen, de
 * falder sammen til den største.
 */
.card-pad > * + * { margin-top: 12px; }

/* Afsnittets egen bundmargin slukkes, så rytmereglen ovenfor er den eneste
   der bestemmer. Ellers lægges de to sammen foran en knap: knapper er
   inline-flex, og inline-elementer får ikke margener til at falde sammen. */
.card-pad > p { margin-bottom: 0; }

/* KPI-flisen styrer selv sin afstand med flex-gap, og der falder margener
   ikke sammen – de ville blive lagt oveni. */
.kpi > * + * { margin-top: 0; }

.rows { display: flex; flex-direction: column; gap: 10px; }

.row {
  display: block;
  width: 100%;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-low);
  color: inherit;
  text-align: left;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.row:active { background: var(--surface-sunk); }

.row-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.row-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.row-meta .dot { color: var(--line-strong); }

/* Mærker ----------------------------------------------------------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-sunk);
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
}

.tag.stage-ny            { background: var(--surface-sunk); color: var(--ink-soft); }
.tag.stage-kontaktet     { background: #e6edf6; color: #1f4a7a; }
.tag.stage-besigtigelse  { background: #eae7f6; color: #4a3f86; }
.tag.stage-tilbud        { background: var(--warn-tint); color: var(--warn); }
.tag.stage-vundet        { background: var(--brand-tint); color: var(--brand-strong); }
.tag.stage-tabt          { background: var(--danger-tint); color: var(--danger); }

@media (prefers-color-scheme: dark) {
  .tag.stage-kontaktet    { background: #1d2836; color: #8fbaea; }
  .tag.stage-besigtigelse { background: #262238; color: #b0a4e8; }
}

.prio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.prio-A { background: var(--brand); color: var(--brand-ink); }
.prio-B { background: var(--surface-sunk); color: var(--ink-soft); border: 1px solid var(--line); }
.prio-C { background: transparent; color: var(--ink-faint); border: 1px dashed var(--line-strong); }

.overdue-mark { color: var(--danger); font-weight: 600; }

/* Knapper ---------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 580;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.button:active { transform: translateY(1px); }
.button:disabled { opacity: .5; cursor: default; transform: none; }

.button.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.button.quiet { background: transparent; border-color: transparent; color: var(--brand); padding: 0 10px; }
.button.danger { background: var(--danger); color: #fff; }
.button.small { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.button.block { width: 100%; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icon-button:active { background: var(--surface-sunk); }

.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.button-row > * { flex: 1 1 auto; }

/* Formularfelter --------------------------------------------------------- */

label.field { display: block; }

.field-label {
  display: block;
  margin-bottom: 5px;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--ink-soft);
}

input, select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  /* 16 px, ellers zoomer iOS ind når feltet får fokus. */
  font-size: 16px;
}

select {
  /* Egen chevron: den native pil sidder klemt op ad kanten og følger ikke
     feltets typografi. appearance:none giver os kontrol over placeringen. */
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.75 6 6.25 11 1.75' stroke='%2356534c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px 8px;
}

@media (prefers-color-scheme: dark) {
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.75 6 6.25 11 1.75' stroke='%23a8a49d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

textarea { min-height: 88px; resize: vertical; line-height: 1.45; }

input:focus-visible, select:focus-visible, textarea:focus-visible,
.button:focus-visible, .row:focus-visible, .icon-button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

input.is-saving { border-color: var(--brand); opacity: .7; }
input.is-saved, textarea.is-saved, select.is-saved { border-color: var(--brand); }

.field-grid { display: grid; gap: 12px; }

@media (min-width: 520px) {
  .field-grid.two { grid-template-columns: 1fr 1fr; }
}

/* Søgning og filtre ------------------------------------------------------ */

.search-bar { display: flex; gap: 8px; }
.search-bar input { flex: 1; }

.filter-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: 13.5px;
  font-weight: 540;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* Panel der glider op ---------------------------------------------------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 19, 17, 0);
  transition: background .2s ease;
}

.sheet-backdrop.is-open { background: rgba(20, 19, 17, .45); }

.sheet {
  width: 100%;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-high);
  transform: translateY(100%);
  transition: transform .24s cubic-bezier(.32, .72, 0, 1);
}

.sheet-backdrop.is-open .sheet { transform: translateY(0); }

.sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 12px 18px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 { flex: 1; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 18px; -webkit-overflow-scrolling: touch; }
.sheet-body > * + * { margin-top: 14px; }
.sheet-text { color: var(--ink-soft); }

.sheet-foot {
  display: flex;
  gap: 10px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.sheet-foot > * { flex: 1; }

@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: var(--radius-lg); transform: translateY(12px) scale(.98); opacity: 0; transition: transform .2s ease, opacity .2s ease; }
  .sheet-backdrop.is-open .sheet { transform: none; opacity: 1; }
}

/* Beskeder --------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bar-height) + 12px);
  z-index: 60;
  max-width: min(92vw, 460px);
  padding: 11px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 520;
  box-shadow: var(--shadow-mid);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast[data-kind="error"] { background: var(--danger); color: #fff; }

/* Tomme tilstande -------------------------------------------------------- */

.loading, .empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 44px 20px;
  color: var(--ink-soft);
  text-align: center;
}

.empty h3 { color: var(--ink); }
.empty p { max-width: 34ch; }
.empty.error h3 { color: var(--danger); }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Desktop ---------------------------------------------------------------- */

@media (min-width: 900px) {
  .app { padding-bottom: 0; }
  .tabbar { display: none; }

  .topbar { padding-left: 24px; padding-right: 24px; gap: 24px; }
  .topbar h1 { flex: 0 0 auto; }

  .topbar .desktop-nav {
    display: flex;
    flex: 1;
    gap: 4px;
  }

  .topbar .desktop-nav a {
    padding: 7px 13px;
    border-radius: var(--radius);
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 540;
    text-decoration: none;
  }

  .topbar .desktop-nav a:hover { background: var(--surface-sunk); color: var(--ink); }
  .topbar .desktop-nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-strong); }

  .view { max-width: 1180px; width: 100%; margin: 0 auto; padding: 24px; }
  .row:hover { border-color: var(--line-strong); }

  /* Formulartunge sider skal ikke strækkes: et indtastningsfelt på tusind
     pixel er hverken pænt eller lettere at ramme. */
  .narrow { max-width: 760px; margin: 0 auto; }
}

.narrow > * + * { margin-top: 16px; }


/* Ringelisten ------------------------------------------------------------ */

.call-card .call-actions {
  display: flex;
  gap: 8px;
  margin-top: 11px;
}

.call-card .call-actions > * { flex: 1; }
.call-card .row-name { text-decoration: none; }

.outcome-grid { display: grid; gap: 8px; }

@media (min-width: 460px) {
  .outcome-grid { grid-template-columns: 1fr 1fr; }
}

/* Virksomhedslisten ------------------------------------------------------ */

.list-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.missing-mark { color: var(--ink-faint); font-size: 12.5px; }

/* Virksomhedssiden ------------------------------------------------------- */

.company-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stage-picker {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid currentColor;
  font-size: 13.5px;
  cursor: pointer;
}

.stage-picker .caret { opacity: .6; font-size: 10px; }

.prio-group { display: flex; gap: 5px; }
.prio-group .chip { width: 38px; padding: 0; text-align: center; }



.static-value {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  color: var(--ink-soft);
}

.weighted-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--brand-tint);
  color: var(--brand-strong);
}

.weighted-line strong { font-size: 17px; }

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: var(--tap);
  padding: 4px 0;
  cursor: pointer;
}

.checkbox-line input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  min-height: 0;
  margin-top: 2px;
  accent-color: var(--brand);
}

.checkbox-line .row-meta { display: block; font-size: 12.5px; }

.task-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.small-icon { width: 34px; height: 34px; font-size: 17px; }
.row.muted { opacity: .62; }

.more-details { margin-top: 12px; }
.more-details summary { cursor: pointer; color: var(--ink-soft); font-size: 13.5px; padding: 8px 0; }
.more-details > .rows, .more-details > .timeline { margin-top: 8px; }

.danger-text { color: var(--danger); }
.warn-text { color: var(--warn); }

/* Tidslinje */

.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline > li { position: relative; padding: 0 0 16px 14px; }
.timeline > li:last-child { padding-bottom: 0; }

.timeline > li::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 3px var(--surface);
}

.timeline-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.timeline-head .eyebrow { flex: 1; }
.timeline p { margin: 3px 0 0; color: var(--ink-soft); font-size: 14px; }
.timeline.compact > li { padding-bottom: 8px; display: flex; justify-content: space-between; gap: 12px; }

/* CVR-panel -------------------------------------------------------------- */

.match-banner {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-sunk);
}

.match-banner p { margin: 4px 0 0; font-weight: 600; }
.match-sikker     { background: var(--brand-tint); border-color: transparent; color: var(--brand-strong); }
.match-sandsynlig { background: var(--warn-tint); border-color: transparent; color: var(--warn); }
.match-usikker    { background: var(--danger-tint); border-color: transparent; color: var(--danger); }

.reasons { margin: 6px 0 0; padding-left: 18px; font-size: 13px; opacity: .9; }
.reasons li { margin-top: 2px; }

.lookup-rows { display: flex; flex-direction: column; gap: 2px; }

.lookup-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.lookup-row:last-child { border-bottom: 0; }
.lookup-row > div { flex: 1; min-width: 0; }

.lookup-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  min-height: 0;
  margin-top: 3px;
  accent-color: var(--brand);
}

.lookup-row .field-label { margin-bottom: 2px; }
.lookup-row.is-conflict { background: var(--warn-tint); border-radius: var(--radius); padding-inline: 8px; }

.lookup-values {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.old-value { color: var(--ink-faint); text-decoration: line-through; }
.old-value.is-empty { text-decoration: none; font-style: italic; }

/* Kanban ----------------------------------------------------------------- */

.board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.column {
  flex: 0 0 min(86vw, 300px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--surface-sunk);
  border-top: 3px solid var(--line-strong);
}

.column.is-target {
  background: var(--brand-tint);
  border-top-color: var(--brand);
  outline: 2px dashed var(--brand);
  outline-offset: -3px;
}

.stage-border-ny            { border-top-color: var(--line-strong); }
.stage-border-kontaktet     { border-top-color: #4a7fbd; }
.stage-border-besigtigelse  { border-top-color: #7566c4; }
.stage-border-tilbud        { border-top-color: var(--warn); }
.stage-border-vundet        { border-top-color: var(--brand); }
.stage-border-tabt          { border-top-color: var(--danger); }

.column-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 4px 10px;
}

.column-head .eyebrow { flex: 1; }
.column-count { font-weight: 700; font-size: 13px; }
.column-sum { width: 100%; font-size: 12px; color: var(--ink-soft); }

.column-body { display: flex; flex-direction: column; gap: 8px; }
.column-empty { padding: 14px 4px; color: var(--ink-faint); font-size: 13.5px; }

.kanban-card {
  position: relative;
  padding: 11px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-low);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.kanban-card.is-source { opacity: .35; }

.kanban-name {
  display: block;
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.3;
  text-decoration: none;
}

.kanban-card .row-meta { font-size: 12.5px; margin-top: 5px; }

.kanban-money {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 13.5px;
  font-weight: 600;
}

.kanban-stage {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 540;
  cursor: pointer;
}

.kanban-stage .caret { margin-left: 4px; font-size: 10px; opacity: .7; }

.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  pointer-events: none;
  box-shadow: var(--shadow-mid);
  transform-origin: top left;
  rotate: 1.5deg;
  opacity: .95;
}

@media (min-width: 900px) {
  .board { margin: 0; padding: 0 0 10px; scroll-snap-type: none; }
  /* Alle seks stadier skal kunne ses på én gang på en almindelig skærm. */
  .column { flex: 1 1 0; min-width: 164px; }
}

/* Dashboard -------------------------------------------------------------- */

.goal-card .goal-numbers {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 12px;
}

.goal-card .goal-numbers strong { font-size: 28px; letter-spacing: -.02em; }
.goal-card .goal-numbers span { color: var(--ink-soft); }

.meter {
  height: 9px;
  border-radius: 999px;
  background: var(--surface-sunk);
  overflow: hidden;
  margin-bottom: 10px;
}

.meter-fill { height: 100%; background: var(--brand); border-radius: 999px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi strong { font-size: 20px; letter-spacing: -.015em; }

/* Etiketterne er forskellige i længde, og en der bryder over to linjer ville
   ellers gøre hele sin række højere end de andre. Alle reserverer to linjer,
   så gitteret bliver regelmæssigt uanset ordvalg. */
.kpi .eyebrow { min-height: 2.2em; }

@media (min-width: 600px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }

.bars { display: flex; flex-direction: column; gap: 8px; }

.bar-row {
  display: grid;
  /* Etiketten er det man læser; bjælken er kun en størrelsesorden. På en
     telefon får navnet derfor pladsen, så "Kontorfællesskab" står helt. */
  grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

@media (min-width: 600px) {
  /* Etiketkolonnen får et loft: på en bred skærm ville 1fr efterlade et
     tomrum på flere hundrede pixel mellem navnet og bjælken. */
  .bar-row { grid-template-columns: minmax(120px, 220px) 1fr auto; }
}

.bar-label { color: var(--ink-soft); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label:hover { color: var(--brand); }
.bar-track { height: 8px; border-radius: 999px; background: var(--surface-sunk); overflow: hidden; }
.bar-fill { height: 100%; background: var(--line-strong); border-radius: 999px; min-width: 2px; }
.bar-value { font-weight: 620; min-width: 2ch; text-align: right; }
.bar-extra { grid-column: 2 / -1; font-size: 12px; color: var(--ink-faint); }
.bar-extra:empty { display: none; }

.stage-fill-ny           { background: var(--line-strong); }
.stage-fill-kontaktet    { background: #4a7fbd; }
.stage-fill-besigtigelse { background: #7566c4; }
.stage-fill-tilbud       { background: var(--warn); }
.stage-fill-vundet       { background: var(--brand); }
.stage-fill-tabt         { background: var(--danger); }

.goal-list { display: flex; flex-direction: column; gap: 2px; }

.goal-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.goal-row:last-child { border-bottom: 0; }

/* Mere ------------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.report-heading { margin-top: 16px; color: var(--ink-soft); font-size: 13px; }

/* Log ind ---------------------------------------------------------------- */

.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
}

.login-card { width: 100%; max-width: 380px; }
.login-card > * + * { margin-top: 14px; }

/* Reklamebeskyttelse ----------------------------------------------------- */

.protected-note {
  margin-top: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--warn-tint);
  color: var(--warn);
  font-size: 12.5px;
  font-weight: 560;
}

.protected-banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--warn-tint);
  color: var(--warn);
}

.protected-banner p { margin: 4px 0 0; font-size: 13.5px; }

.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.hidden-note {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-sunk);
  color: var(--ink-soft);
  font-size: 13px;
}

/* Markering og sletning i listen ----------------------------------------- */

.select-bar {
  position: fixed;
  inset: auto 0 var(--bar-height) 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-mid);
  font-size: 14px;
  font-weight: 560;
}

.row-selectable {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.row-selectable > input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  min-height: 0;
  margin-top: 2px;
  accent-color: var(--brand);
}

.row-selectable .row-body { flex: 1; min-width: 0; }

.delete-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
}

@media (min-width: 900px) {
  .select-bar { bottom: 0; }
}
