/* ============================================================
   BYGPAS · DASHBOARD-SIDE
   ------------------------------------------------------------
   Editorial dashboard for håndværkere. Pairs with
   bygpas-editorial.css (nav, footer, eyebrow, skip-link, design
   tokens) and style.css (legacy dash-* form/preview/notification
   /subscription components that dashboard.js still references).

   Adds the rich page-header, KPI strip, watchlist table, alerts
   rail, upgrade card, and activity timeline as new visual layers
   on top of the existing state machine (#dash-loading,
   #dash-gate-login, #dash-gate-subscribe, #dash-main).

   2026-04-25 — first revision. Editorial brand alignment.
   ============================================================ */

/* ---- Local tokens (mirror bygpas-editorial.css for safety) ---- */
.dash-side-page {
  --paper-3: #ebe4d0;
  --line-hard: #c9c0aa;
  --accent-soft: #c5d2a8;
  --accent-tint: #e6eed4;
  --risk: #b03a2e;
  --risk-soft: #f5d9d3;
  --warn: #c28a2e;
  --warn-soft: #f3e4c3;
  --ok: #4f6839;
  --ok-soft: #dbe5c4;
  --radius-side: 14px;
  --radius-side-sm: 10px;
}

/* ============ PAGE HEADER ============ */
.dash-side-page-head {
  padding: clamp(40px, 6vw, 64px) 0 clamp(28px, 4vw, 48px);
}
.dash-side-head-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: end;
}
@media (max-width: 960px) {
  .dash-side-head-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
.dash-side-page-head .eyebrow {
  margin-bottom: 18px;
}
.dash-side-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
  text-wrap: balance;
  color: var(--ink-1);
}
.dash-side-title em {
  font-style: italic;
  color: var(--accent-2);
}
.dash-side-deck {
  font-family: var(--f-serif);
  font-size: 17px;
  color: var(--ink-2);
  margin: 0;
  max-width: 46ch;
  line-height: 1.55;
}
.dash-side-cvr {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-top: 8px;
}

/* Plan-badge styled for editorial header */
.dash-side-plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-2);
  margin-top: 18px;
}

/* Quick-check capsule (mini hero search) */
.dash-side-quick-check {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-side);
  padding: 6px 6px 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.02),
    0 12px 32px -24px rgba(30, 26, 22, 0.15);
}
.dash-side-quick-check svg {
  color: var(--ink-3);
  flex-shrink: 0;
}
.dash-side-quick-check input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  padding-block: 12px;
  outline: none;
  min-width: 0;
  color: var(--ink-1);
}
.dash-side-quick-check input::placeholder {
  color: var(--ink-3);
  opacity: 0.85;
}
.dash-side-quick-check button {
  background: var(--ink-1);
  color: var(--paper);
  border: 0;
  padding: 11px 18px;
  border-radius: var(--radius-side-sm);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s;
}
.dash-side-quick-check button:hover {
  background: var(--accent-2);
}

/* ============ KPI STRIP ============ */
.dash-side-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-side);
  overflow: hidden;
  margin-bottom: clamp(40px, 6vw, 64px);
}
@media (max-width: 820px) {
  .dash-side-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}
.dash-side-kpi {
  background: var(--paper);
  padding: 24px 26px;
  position: relative;
}
.dash-side-kpi-label {
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.dash-side-kpi-value {
  font-family: var(--f-display);
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink-1);
  margin-bottom: 10px;
  min-height: 46px;
}
.dash-side-kpi-value em {
  font-family: var(--f-display);
  font-style: italic;
  color: var(--ink-3);
  font-size: 24px;
  margin-left: 4px;
}
.dash-side-kpi-delta {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  min-height: 14px;
}
.dash-side-kpi-delta--up {
  color: var(--ok);
}
.dash-side-kpi-delta--down {
  color: var(--risk);
}
.dash-side-kpi-spark {
  position: absolute;
  right: 18px;
  top: 18px;
  opacity: 0.55;
}

/* ============ SECTION HEAD (inline) ============ */
.dash-side-sec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-side-sec-head h2 {
  font-family: var(--f-display);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
  color: var(--ink-1);
}
.dash-side-sec-head h2 em {
  font-style: italic;
  color: var(--accent-2);
}
.dash-side-sec-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dash-side-btn-ghost {
  background: transparent;
  border: 1px solid var(--line-hard);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-1);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: var(--f-sans);
  transition: background 0.15s, border-color 0.15s;
}
.dash-side-btn-ghost:hover {
  background: var(--paper);
  border-color: var(--ink-1);
}
.dash-side-btn-link {
  background: transparent;
  border: 0;
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--ink-2);
  padding: 4px 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}
.dash-side-btn-link:hover {
  color: var(--accent-2);
}

/* ============ LAYOUT: watchlist + rail ============ */
.dash-side-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  margin-bottom: clamp(40px, 6vw, 64px);
}
@media (max-width: 1080px) {
  .dash-side-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ CARDS ============ */
.dash-side-card-frame {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-side);
  overflow: hidden;
}

/* ============ WATCHLIST TABLE ============ */
.dash-side-filter-bar {
  display: flex;
  gap: 6px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
  flex-wrap: wrap;
}
.dash-side-chip {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-hard);
  background: transparent;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.dash-side-chip.active {
  background: var(--ink-1);
  color: var(--paper);
  border-color: var(--ink-1);
}
.dash-side-chip i {
  font-style: normal;
  color: var(--ink-3);
  font-weight: 500;
}
.dash-side-chip.active i {
  color: #a8a294;
}
.dash-side-filter-spacer {
  flex: 1;
}
.dash-side-filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-hard);
  border-radius: 999px;
  min-width: 200px;
  color: var(--ink-3);
}
.dash-side-filter-search input {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  outline: none;
  flex: 1;
  color: var(--ink-1);
}

table.dash-side-watchlist {
  width: 100%;
  border-collapse: collapse;
}
.dash-side-watchlist thead th {
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--ink-3);
  padding: 14px 20px;
  text-align: left;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.dash-side-watchlist thead th.num {
  text-align: right;
}
.dash-side-watchlist tbody tr {
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s;
}
.dash-side-watchlist tbody tr:hover {
  background: var(--paper-2);
}
.dash-side-watchlist tbody tr:last-child {
  border-bottom: 0;
}
.dash-side-watchlist td {
  padding: 16px 20px;
  vertical-align: middle;
  font-size: 14px;
  color: var(--ink-1);
}
.dash-side-watchlist td.num {
  text-align: right;
  font-family: var(--f-mono);
}

.dash-side-biz {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-side-biz-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-size: 18px;
  color: var(--paper);
  flex-shrink: 0;
  line-height: 1;
  padding-bottom: 2px;
}
.dash-side-biz-mark--green {
  background: var(--accent-2);
}
.dash-side-biz-mark--warm {
  background: #9a6832;
}
.dash-side-biz-mark--rust {
  background: #8a3e2e;
}
.dash-side-biz-mark--slate {
  background: #4a5568;
}
.dash-side-biz-name {
  font-weight: 500;
  color: var(--ink-1);
}
.dash-side-biz-meta {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* .dash-side-score + modifiers RETIRED 2026-05-12
   Var del af "Seneste score" KPI tile + score-display i håndværker-
   tabel-rækker som blev fjernet i Fase 1.6 (vurderingsfri restructure).
   Eniro-undtagelsen forbyder samlet score-visning. Phase 5 dead-code
   cleanup. */

.dash-side-trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.dash-side-trend--up {
  color: var(--ok);
}
.dash-side-trend--down {
  color: var(--risk);
}
.dash-side-trend--flat {
  color: var(--ink-3);
}

.dash-side-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.dash-side-status-pill--ok {
  background: var(--ok-soft);
  color: var(--accent-2);
}
.dash-side-status-pill--warn {
  background: var(--warn-soft);
  color: #8a5f1a;
}
.dash-side-status-pill--risk {
  background: var(--risk-soft);
  color: #7a2a20;
}
.dash-side-status-pill--flat {
  background: var(--paper-3);
  color: var(--ink-3);
}
.dash-side-status-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  font-style: normal;
}

.dash-side-row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.dash-side-row-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dash-side-row-btn:hover {
  background: var(--paper-3);
  color: var(--ink-1);
  border-color: var(--line-hard);
}
.dash-side-row-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* ============ RAIL: alerts + upgrade ============ */
.dash-side-rail {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Alerts */
.dash-side-alerts {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-side);
}
.dash-side-alerts-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dash-side-alerts-head h3 {
  font-family: var(--f-display);
  font-size: 22px;
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--ink-1);
}
.dash-side-alerts-count {
  font-family: var(--f-mono);
  font-size: 11px;
  background: var(--risk);
  color: var(--paper);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.dash-side-alert {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  width: 100%;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  font-family: inherit;
  color: inherit;
}
.dash-side-alert:hover {
  background: var(--paper-2);
}
.dash-side-alert:last-of-type {
  border-bottom: 0;
}
.dash-side-alert:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: -2px;
}
.dash-side-alert-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.dash-side-alert-icon--risk {
  background: var(--risk-soft);
  color: var(--risk);
}
.dash-side-alert-icon--warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.dash-side-alert-icon--ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.dash-side-alert-icon--info {
  background: var(--paper-3);
  color: var(--ink-2);
}
.dash-side-alert-body {
  min-width: 0;
}
.dash-side-alert-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-1);
  line-height: 1.4;
  margin-bottom: 4px;
}
.dash-side-alert-title em {
  font-style: normal;
  font-weight: 600;
}
.dash-side-alert-meta {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.dash-side-alert-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  flex-shrink: 0;
}
.dash-side-alerts-foot {
  padding: 14px 22px;
  text-align: center;
  background: var(--paper-2);
  border-top: 1px solid var(--line-soft);
}

/* Upgrade card */
.dash-side-upgrade {
  background: linear-gradient(140deg, var(--ink-1) 0%, #2a2720 100%);
  color: #e8e2d0;
  border-radius: var(--radius-side);
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.dash-side-upgrade::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.35;
}
.dash-side-upgrade-eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--accent-soft);
  margin-bottom: 14px;
  position: relative;
}
.dash-side-upgrade h3 {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  line-height: 1.15;
  color: #fff;
  position: relative;
}
.dash-side-upgrade h3 em {
  font-style: italic;
  color: var(--accent-soft);
}
.dash-side-upgrade p {
  font-size: 13.5px;
  line-height: 1.5;
  color: #b8b2a4;
  margin: 0 0 18px;
  position: relative;
}
.dash-side-upgrade-btn {
  background: var(--paper);
  color: var(--ink-1);
  border: 0;
  padding: 11px 18px;
  border-radius: var(--radius-side-sm);
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  cursor: pointer;
  font-family: var(--f-sans);
}
.dash-side-upgrade-btn:hover {
  background: #fff;
}

/* ============ ACTIVITY TIMELINE ============ */
.dash-side-activity {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-side);
  padding: 28px 32px;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.dash-side-activity-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.dash-side-activity-head h2 {
  font-family: var(--f-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink-1);
}
.dash-side-activity-head h2 em {
  font-style: italic;
  color: var(--accent-2);
}
.dash-side-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.dash-side-timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 20px;
  bottom: 20px;
  width: 1px;
  background: var(--line);
  z-index: 0;
}
.dash-side-tl-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 20px;
  padding: 14px 0;
  align-items: baseline;
  position: relative;
  z-index: 1;
}
.dash-side-tl-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line-hard);
  display: grid;
  place-items: center;
  color: var(--ink-2);
}
.dash-side-tl-dot--ok {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok);
}
.dash-side-tl-dot--warn {
  background: var(--warn-soft);
  border-color: var(--warn);
  color: var(--warn);
}
.dash-side-tl-dot--risk {
  background: var(--risk-soft);
  border-color: var(--risk);
  color: var(--risk);
}
.dash-side-tl-body {
  min-width: 0;
}
.dash-side-tl-title {
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ink-1);
}
.dash-side-tl-title strong {
  font-weight: 600;
}
.dash-side-tl-title em {
  font-style: normal;
  color: var(--accent-2);
  font-weight: 500;
}
.dash-side-tl-meta {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-top: 4px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.dash-side-tl-time {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Hide table column on small screens */
@media (max-width: 720px) {
  .dash-side-watchlist th.dash-side-hide-sm,
  .dash-side-watchlist td.dash-side-hide-sm {
    display: none;
  }
  .dash-side-watchlist td,
  .dash-side-watchlist thead th {
    padding: 12px 14px;
  }
}

/* ============ FOOTER H2 OVERRIDE ============
   Dashboard's main content sits inside aria-hidden state machines, so
   the footer's column titles must be h2 to keep heading hierarchy
   intact (h1 → h2). Style them like the editorial h4 footer-col rule
   in bygpas-editorial.css so the visual rhythm is unchanged. */
body > footer.footer .footer-col h2 {
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: #8a8478;
  margin: 0 0 16px;
}
