/* ============================================================
   FÖRSÄLJNING ÖVERSIKT — period at a glance
   ============================================================ */

.fo-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 48px;
}

/* ── TOPBAR ───────────────────────────────────────────────── */
.fo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}
.fo-top-left {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.fo-top-title { color: var(--text); font-weight: 500; font-size: 18px; letter-spacing: -0.015em; }
.fo-export-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border-radius: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}
.fo-export-btn:hover { border-color: var(--hairline-strong); background: var(--surface); }

/* ── FILTER BAR ───────────────────────────────────────────── */
.fo-filterbar { padding-top: 8px; }
.fo-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.fo-select {
  appearance: none;
  padding: 7px 28px 7px 12px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.fo-months {
  display: inline-flex;
  gap: 0;
  padding: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: 7px;
}
.fo-month {
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 5px;
  transition: background 100ms, color 100ms;
}
.fo-month:hover { color: var(--text); }
.fo-month.is-on { background: var(--text); color: var(--bg); }
.fo-month-clear {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 5px 9px;
  border-radius: 5px;
}
.fo-month-clear:hover { color: var(--text); }
.fo-toggle {
  padding: 7px 12px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.fo-toggle:hover { color: var(--text); border-color: var(--hairline-strong); }
.fo-toggle.is-on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ── HERO ─────────────────────────────────────────────────── */
.fo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: end;
  padding: 18px 0 28px;
  border-bottom: 1px solid var(--hairline);
}
.fo-hero-eyebrow {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.fo-hero-value {
  font-size: 112px;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: var(--text);
  margin-top: 8px;
  font-family: "Crimson Pro", "Clarendon Text", Georgia, serif;
}
.fo-hero-unit {
  font-size: 32px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  font-family: var(--font-sans);
  line-height: 1;
}
.fo-hero-stack {
  /* Inline-block so the stack's baseline = the "kr" baseline (kr is the
     only in-flow child). That aligns kr's baseline with the big number's
     baseline. The "?" icon floats above kr via absolute positioning. */
  display: inline-block;
  position: relative;
  margin-left: 16px;
  vertical-align: baseline;
}
.fo-hero-info {
  /* `.fo-hero-stack` inherits line-height: 0.92 from the parent at 112 px
     font-size, so its line-box is ~103 px tall and its top edge sits at the
     parent line-box top — well above the digit cap line. The cap-top of the
     digits sits ~18 px below line-box top (parent baseline ≈ 92 px from top,
     Crimson Pro cap-height ≈ 74 px above baseline). So `top: 18px` puts the
     icon's top edge on the digit-cap line. */
  position: absolute;
  top: 18px;
  bottom: auto;
  left: 0;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1;
}
.fo-hero-info-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
  transition: color 100ms;
}
.fo-hero-info-btn:hover { color: var(--text); }
.fo-hero-info-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  transform: translateX(-90%);
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.05), 0 16px 40px oklch(0 0 0 / 0.16);
  z-index: 60;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.fo-hero-info-pop-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.fo-hero-info-pop-list {
  list-style: decimal;
  padding-left: 18px;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fo-hero-info-pop-list strong { font-weight: 600; }
.fo-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.fo-yoy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.fo-hero-right {
  display: flex;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  /* overflow: hidden was used to mask the rounded corners — but it also
     clipped the popovers (?-icon tooltip) inside the stats. Round the
     first/last stat directly instead so popovers can overflow. */
}
.fo-hero-stat:first-child { border-radius: 7px 0 0 7px; }
.fo-hero-stat:last-child { border-radius: 0 7px 7px 0; }
.fo-hero-stat {
  background: var(--bg-elevated);
  padding: 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fo-hero-stat-k {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fo-stat-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  /* Lift the badge (and its absolutely-positioned popover child) above
     sibling .fo-hero-stat columns so the popover renders on top. */
  z-index: 70;
}
.fo-stat-badge-btn {
  width: 16px;
  height: 16px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 100ms;
}
.fo-stat-badge-btn:hover { color: var(--text); }
/* Positioning override for the smaller stat-badge popup. Keeps the same
   visual styling as .fo-hero-info-pop (width, border, shadow, padding) but
   anchored to the small badge instead of the big hero number. */
.fo-stat-pop {
  left: 0;
  transform: translateX(-50%);
  width: 260px;
}
.fo-hero-stat-v {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}
.fo-hero-stat-v-empty { color: var(--text-faint); font-weight: 400; }

/* ── 3-COL BAND ───────────────────────────────────────────── */
.fo-band {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 48px;
  padding: 8px 0;
}
.fo-band-head { padding-bottom: 10px; border-bottom: 1px solid var(--hairline); margin-bottom: 4px; }
.fo-band-table { width: 100%; font-size: 13px; color: var(--text); }
.fo-band-table td { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.fo-band-table tr:last-child td { border-bottom: 0; }
.fo-band-table .num { text-align: right; }
.fo-band-rev { color: var(--text); font-weight: 500; }
.fo-band-total td { font-weight: 500; padding-top: 14px; border-top: 1px solid var(--hairline-strong); }

/* ── AUDIENCE KPI ROW ─────────────────────────────────────── */
.fo-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 8px 0 4px;
}
.fo-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  min-height: 110px;
  justify-content: center;
}
.fo-kpi-eyebrow {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.fo-kpi-value {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}
.fo-kpi-unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
  letter-spacing: 0.04em;
}
.fo-kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.fo-kpi-empty {
  font-size: 12.5px;
  color: var(--text-faint);
  font-style: italic;
}
@media (max-width: 1180px) {
  .fo-kpi-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .fo-kpi-row { grid-template-columns: 1fr; gap: 12px; }
}

/* ── CONCERTS TABLE ───────────────────────────────────────── */
.fo-concerts {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}
.fo-concerts-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.fo-concerts-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.fo-concerts-filters { display: inline-flex; align-items: center; gap: 8px; }

.fo-table tr.fo-row-clickable { cursor: pointer; transition: background 100ms; }
.fo-table tr.fo-row-clickable:hover { background: color-mix(in oklch, var(--text) 3%, transparent); }
.fo-table tr.fo-row-clickable.is-selected { background: color-mix(in oklch, var(--text) 6%, transparent); }
.fo-table tr.fo-row-clickable.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--text); }

.fo-hero-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  padding: 3px 8px 3px 6px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  cursor: pointer;
  transition: background 100ms, color 100ms;
}
.fo-hero-clear:hover { background: var(--bg-elevated); color: var(--text); }
.fo-search {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  min-width: 240px;
}
.fo-search input {
  flex: 1; font-size: 12.5px; color: var(--text); border: 0; background: transparent;
}
.fo-search input::placeholder { color: var(--text-faint); }
.fo-search input:focus { outline: none; }

.fo-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.fo-table th {
  text-align: left;
  padding: 10px 12px 10px 0;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px solid var(--hairline);
  user-select: none;
  transition: color 100ms;
}
.fo-table th:hover { color: var(--text); }
.fo-table th.num { text-align: right; padding-right: 0; }
.fo-table th.is-sorted { color: var(--text); }
.fo-table th .fc-th-inner { display: inline-flex; align-items: center; gap: 4px; }
/* Faint chevron on every header so users see they're sortable. The Th
   component already renders an explicit chevron for the active sort column. */
.fo-table th:not(.is-sorted) .fc-th-inner::after {
  content: "";
  width: 0; height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid var(--text-faint);
  opacity: 0.45;
  transition: opacity 100ms;
}
.fo-table th:not(.is-sorted):hover .fc-th-inner::after { opacity: 0.9; }
.fo-table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--text);
}
.fo-table td.num { text-align: right; padding-right: 0; }
/* Indent the first column (Datum) so the date doesn't hug the row's edge. */
.fo-table th:first-child,
.fo-table td:first-child { padding-left: 16px; }
.fo-quiet { color: var(--text-muted); }
.fo-date { display: flex; align-items: baseline; gap: 6px; }
.fo-date-day { font-weight: 500; font-size: 14px; color: var(--text); }
.fo-date-mo { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.fo-kat-chip {
  display: inline-flex;
  padding: 2px 8px;
  background: var(--hairline);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text);
}
.fo-cap-sub { color: var(--text-faint); font-weight: 400; margin-left: 1px; }
.fo-concerts-foot {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 0 4px;
}

@media (max-width: 1100px) {
  .fo-hero { grid-template-columns: 1fr; align-items: flex-start; gap: 20px; }
  .fo-hero-value { font-size: 80px; }
  .fo-hero-right { grid-template-columns: repeat(3, 1fr); }
  .fo-band { grid-template-columns: 1fr; gap: 32px; }
}
