/* ================================================================
   Nora Signal — Firmaprofil (slide-over): topp, KPI-er, diagram, signaler, roller
   Utledet fra samples/sample2.html · Profilhåndbok v1.0
   ================================================================ */

/* ============ Slide-over firmaprofil ============ */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.detail {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 101;
  width: 540px; max-width: 92vw;
  background: var(--surface);
  border-radius: 16px 0 0 16px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.15);
  transform: translateX(100%); transition: transform .2s ease;
  display: flex; flex-direction: column;
}
.detail.open { transform: translateX(0); }
.detail-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 24px 24px 18px; border-bottom: 1px solid var(--border-light);
}
.detail-mark {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  position: relative; overflow: hidden;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Source Serif 4', Georgia, serif; font-size: 20px; font-weight: 600;
}
.detail-title { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.detail-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; font-family: 'DM Mono', monospace; }
.detail-close {
  margin-left: auto; width: 32px; height: 32px; border-radius: 6px;
  background: var(--bg); border: none; color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.detail-close:hover { background: var(--red-light); color: var(--red); }
.detail-close svg { width: 16px; height: 16px; }
.detail-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.detail-section { margin-bottom: 22px; }
.detail-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .7px; color: var(--text-tertiary); margin-bottom: 10px;
}
.detail-score {
  display: flex; align-items: center; gap: 14px;
  background: var(--accent-light); border-radius: 10px; padding: 14px 16px;
}
.detail-score-num {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 26px; font-weight: 600; color: var(--accent);
}
.detail-score-note { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi {
  background: var(--bg); border-radius: 8px; padding: 12px 14px;
}
.kpi-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-tertiary); }
.kpi-value { font-family: 'Source Serif 4', Georgia, serif; font-size: 20px; font-weight: 600; margin-top: 3px; }
.kpi-value .unit { font-size: 12px; color: var(--text-tertiary); font-family: 'DM Sans', sans-serif; font-weight: 400; }

/* Mini-omsetningsdiagram (én serie, direkte etiketter) */
.rev-chart { display: flex; align-items: flex-end; gap: 18px; height: 96px; padding: 4px 4px 0; }
.rev-col { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; height: 100%; justify-content: flex-end; }
.rev-val { font-size: 11px; font-weight: 500; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.rev-bar { width: 26px; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 4px; }
.rev-year { font-size: 10.5px; color: var(--text-tertiary); }

.sig-list { display: flex; flex-direction: column; gap: 10px; }
.sig-item { display: flex; gap: 10px; font-size: 13px; align-items: flex-start; }
.sig-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.sig-date { color: var(--text-tertiary); font-size: 11.5px; min-width: 72px; padding-top: 1px; }
.sig-text { color: var(--text-secondary); line-height: 1.5; }
.sig-text strong { color: var(--text); font-weight: 500; }

/* Nyheter — AI-klassifiserte saker i firmaprofilen */
.nyhet-list { display: flex; flex-direction: column; gap: 4px; }
.nyhet-item { padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.nyhet-item:first-child { padding-top: 2px; }
.nyhet-item:last-child { border-bottom: none; padding-bottom: 2px; }
.nyhet-top { display: flex; align-items: center; gap: 8px; }
.nyhet-dato { margin-left: auto; font-size: 11.5px; color: var(--text-tertiary); }
.nyhet-tittel { font-weight: 500; margin-top: 7px; line-height: 1.4; }
.nyhet-summary { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin-top: 3px; }
.nyhet-foot { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 12px; }
.nyhet-belop { font-family: 'DM Mono', monospace; color: var(--text); }
.nyhet-foot a { color: var(--accent); text-decoration: none; font-weight: 500; }
.nyhet-foot a:hover { text-decoration: underline; }

.plist { display: flex; flex-direction: column; gap: 2px; }
.prow {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13px;
}
.prow:last-child { border-bottom: none; }
.prow-name { font-weight: 500; }
.prow-sub { font-size: 11.5px; color: var(--text-tertiary); }
.prow-right { margin-left: auto; text-align: right; font-size: 12px; color: var(--text-secondary); }
.prow-right .pct { font-family: 'Source Serif 4', Georgia, serif; font-weight: 600; font-size: 14px; color: var(--text); }

.detail-foot {
  display: flex; gap: 8px; padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}
.detail-foot .btn-ghost { margin-left: auto; }

/* ============ Klikkbare rader i profilen ============ */
.row-click { cursor: pointer; border-radius: 8px; transition: background .12s; }
.sig-item.row-click { padding: 5px 8px; margin: -5px -8px; }
.prow.row-click { padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
.row-click:hover, .row-click:focus-visible { background: var(--bg); outline: none; }
.row-chev {
  width: 13px; height: 13px; flex-shrink: 0; align-self: center;
  margin-left: auto; color: var(--text-tertiary);
  opacity: 0; transition: opacity .12s;
}
.prow .row-chev { margin-left: 0; }
.sig-item .row-chev { padding-top: 0; }
.row-click:hover .row-chev, .row-click:focus-visible .row-chev { opacity: 1; }
.c-a { color: inherit; text-decoration: none; }
.c-a:hover { color: var(--accent); text-decoration: underline; }

/* ============ Detalj-popup (signaler, stillinger, aksjonærer) ============ */
.dpop {
  position: fixed; z-index: 140; width: 330px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 14px 36px rgba(0,0,0,.18);
  opacity: 0; pointer-events: none; transform: translateY(5px);
  transition: opacity .15s ease, transform .15s ease;
}
.dpop.open { opacity: 1; pointer-events: auto; transform: none; }
.dpop-head {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 13px 14px 10px; border-bottom: 1px solid var(--border-light);
}
.dpop-head .sig-dot { margin-top: 5px; }
.dpop-title { font-size: 13.5px; font-weight: 600; letter-spacing: -.1px; line-height: 1.35; }
.dpop-date { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.dpop-x {
  margin-left: auto; width: 22px; height: 22px; flex-shrink: 0;
  border: none; background: none; border-radius: 6px; color: var(--text-tertiary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.dpop-x:hover { background: var(--bg); color: var(--text); }
.dpop-x svg { width: 13px; height: 13px; }
.dpop-body {
  padding: 12px 14px; display: flex; flex-direction: column; gap: 9px;
  max-height: 340px; overflow-y: auto; font-size: 12.5px;
}
.dpop-foot { padding: 9px 14px; border-top: 1px solid var(--border-light); font-size: 11px; color: var(--text-tertiary); line-height: 1.5; }
.dpop a { color: var(--accent); font-weight: 500; text-decoration: none; }
.dpop a:hover { text-decoration: underline; }

.pop-kv { display: flex; gap: 10px; align-items: baseline; }
.pop-k {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-tertiary);
  min-width: 88px; flex-shrink: 0; display: inline-block; margin-bottom: 4px;
}
.pop-kv .pop-k { margin-bottom: 0; }
.pop-v { color: var(--text); line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }
.pop-v strong { font-weight: 600; }
.pop-text { color: var(--text-secondary); line-height: 1.55; }
.pop-title2 { font-size: 13px; font-weight: 600; line-height: 1.4; }
.pop-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.pop-list { margin: 0; padding-left: 16px; color: var(--text-secondary); line-height: 1.55; }
.pop-more { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.pop-fromto { display: flex; align-items: center; gap: 14px; }
.pop-arrow { width: 14px; height: 14px; color: var(--text-tertiary); flex-shrink: 0; }
.pop-big { font-family: 'Source Serif 4', Georgia, serif; font-size: 17px; font-weight: 600; margin-top: 1px; }
.pop-act {
  border: none; background: var(--accent-light); color: var(--accent);
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 7px 11px; border-radius: 8px; cursor: pointer;
  text-align: left; align-self: flex-start; transition: all .12s;
}
.pop-act:hover { background: var(--accent); color: #fff; }

/* ============ Aksjonærer / Aksjeposter med årsvelger ============ */
.aksje-head { display: flex; align-items: center; gap: 8px 10px; margin-bottom: 10px; flex-wrap: wrap; }
.aksje-tabs {
  display: inline-flex; gap: 2px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 2px;
}
.aksje-tab {
  border: none; background: transparent; cursor: pointer;
  padding: 4px 10px; border-radius: 6px;
  font: inherit; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px; color: var(--text-tertiary);
  transition: all .15s;
}
.aksje-tab:hover { color: var(--text-secondary); }
.aksje-tab.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.aksje-aar { position: relative; margin-left: auto; display: inline-flex; align-items: center; }
.aksje-aar select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 26px 5px 10px; cursor: pointer; transition: border-color .15s;
}
.aksje-aar select:hover, .aksje-aar select:focus { border-color: var(--accent); outline: none; }
.aksje-aar-chev {
  position: absolute; right: 8px; width: 13px; height: 13px;
  color: var(--text-tertiary); pointer-events: none;
}

/* ---------- Selskapstidslinjen («Hele historien») ---------- */
.tl-toggle {
  float: right; font-size: 11px; font-weight: 600; letter-spacing: .3px;
  color: var(--accent); background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 9px; cursor: pointer; text-transform: none;
}
.tl-toggle:hover { border-color: var(--accent); background: var(--accent-light); }
.tl-list { position: relative; padding-left: 18px; }
.tl-list::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border); border-radius: 1px;
}
.tl-year {
  font-size: 11px; font-weight: 700; color: var(--text-tertiary);
  letter-spacing: .6px; margin: 12px 0 4px; position: relative;
}
.tl-year:first-child { margin-top: 0; }
.tl-row { position: relative; display: flex; gap: 10px; padding: 5px 0; min-width: 0; }
.tl-dot {
  position: absolute; left: -18px; top: 10px; width: 8px; height: 8px;
  border-radius: 50%; box-shadow: 0 0 0 2px var(--bg-card, var(--bg));
}
.tl-body { min-width: 0; }
.tl-title { font-size: 13px; font-weight: 600; color: var(--text); }
.tl-date { font-weight: 400; font-size: 11.5px; color: var(--text-tertiary); margin-left: 8px; }
.tl-text { font-size: 12px; color: var(--text-secondary); margin-top: 1px; overflow-wrap: anywhere; }
