/* v6.css — klasser for V6 (ISMS-komplethed) + Enterprise-moduler.
 *
 * Erstatter inline styles i soa/, risk_register/, settings/risk_appetite,
 * incidents (afledte opgaver), asset_detail (historik) og compare_plans
 * (enterprise-callout). Jf. feedback_no_inline_css: ingen style="..." i
 * templates undtagen DYNAMISKE værdier (farve/bredde beregnet pr. render).
 */

/* ── Side-containere ───────────────────────────────────────────── */
.v6-page      { margin: 0 auto; }
.v6-page--sm  { max-width: 800px; }
.v6-page--md  { max-width: 900px; }
.v6-page--lg  { max-width: 1000px; }
.v6-page--xl  { max-width: 1100px; }
.v6-page--xxl { max-width: 1200px; }

/* ── Sidehoved (titel + handlinger) ────────────────────────────── */
.v6-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.v6-head--center { align-items: center; }
.v6-head--flush { margin-bottom: 0; }
.v6-item-title { font-size: 15px; font-weight: 700; }
.v6-subtitle { margin: 4px 0 0; font-size: 13px; }
.v6-actions { display: flex; gap: 8px; }
.v6-actions--sm { gap: 6px; }
.v6-backlink { font-size: 13px; text-decoration: none; }

/* ── Filterrække ───────────────────────────────────────────────── */
.v6-filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Tabeller ──────────────────────────────────────────────────── */
.v6-table { width: 100%; border-collapse: collapse; font-size: 13px; }
/* R2 (#652): type-først drilldown i katalog-vurderingen (native <details>, CSP-rent) */
.v6-typegroup { border: 1px solid var(--line, #e2e8f0); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.v6-typegroup-sum { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 14px; }
.v6-typegroup[open] > .v6-typegroup-sum { border-bottom: 1px solid var(--line, #e2e8f0); }
.v6-typegroup > .v6-table { margin: 0; }
.v6-typegroup > .v6-table td, .v6-typegroup > .v6-table th { padding-left: 14px; padding-right: 14px; }
/* R3 (#653): scenarie-wizard drilldown */
.wiz-chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.wiz-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line, #e2e8f0); border-radius: 16px; font-size: 13px; cursor: pointer; }
.wiz-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--line, #e2e8f0); border-radius: 8px; padding: 6px; }
.wiz-list .v6-typegroup { border: none; border-bottom: 1px solid var(--line, #e2e8f0); border-radius: 0; margin: 0; }
.wiz-optwrap { display: flex; flex-direction: column; padding: 2px 14px 10px; }
.wiz-opt { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; cursor: pointer; }
.wiz-hidden { display: none !important; }
.v6-table thead tr { border-bottom: 1px solid var(--line, #e2e8f0); }
.v6-table thead tr.v6-table-head--shaded { background: #f8fafc; }
.v6-table th { text-align: left; padding: 8px 10px; }
.v6-table th.v6-th--center { text-align: center; }
/* K12 (#685): sortérbare kolonneoverskrifter i risikoregistret. */
.v6-table th[data-sort-key] { cursor: pointer; user-select: none; white-space: nowrap; }
.v6-table th[data-sort-key]:hover { color: var(--accent, #2563eb); }
.rr-sort-ind { font-size: 11px; color: var(--muted, #64748b); }
.rr-matrix-tabs { margin-bottom: 12px; }
.v6-table td { padding: 8px 10px; vertical-align: top; }
.v6-table td.v6-td--center { text-align: center; }
.v6-table tbody tr { border-bottom: 1px solid #f1f5f9; }
.v6-col--narrow { width: 75px; }
.v6-col--src { width: 110px; }
.v6-col--domain { width: 130px; }
.v6-col--worst { width: 120px; }
.v6-col--owner { width: 120px; }
.v6-col--status { width: 110px; }
.v6-col--date { width: 120px; }
.v6-col--ctrl { width: 90px; }

/* ── Kort / paneler ────────────────────────────────────────────── */
.v6-card-pad { padding: 16px 20px; }
.v6-card-pad--sm { padding: 14px 18px; }
.v6-card-mt { margin-top: 16px; }
.v6-card-mb { margin-bottom: 12px; }
.v6-empty { padding: 32px; text-align: center; }
.v6-empty p { margin: 0 0 12px; }
.v6-link-card { text-decoration: none; color: var(--text); display: block; }
.v6-stacklist { display: flex; flex-direction: column; gap: 10px; }

/* ── Behandlings-/svar-badges (statisk farve via klasse) ───────── */
.v6-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  /* issue 18: fulde behandlings-labels — sikkerhedsnet mod layout-brud.
     Fuld tekst vises via title-tooltip på hover. */
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.v6-pill--lg { padding: 3px 10px; font-weight: 700; }
.v6-pill-accept  { background: #22c55e; }
.v6-pill-monitor { background: #eab308; }
.v6-pill-treat   { background: #dc2626; }
.v6-pill-transfer { background: #6366f1; }
.v6-pill-unset   { background: #e2e8f0; color: #475569; }

/* ── Summary-linje (fx SoA-status) ─────────────────────────────── */
.v6-summary { display: flex; gap: 24px; flex-wrap: wrap; font-size: 13px; }

/* ── Detalje-sektioner ─────────────────────────────────────────── */
.v6-section-title { margin: 18px 0 8px; font-size: 15px; }
.v6-dim-card { padding: 14px 18px; margin-bottom: 10px; }
.v6-dim-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.v6-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.v6-grid-title-frist { display: grid; grid-template-columns: 1fr 160px; gap: 8px; margin-bottom: 8px; }
.v6-hint { display: block; margin-top: 4px; }
.mt-6 { margin-top: 6px; }

/* ── Forms ─────────────────────────────────────────────────────── */
.v6-form-actions { margin-top: 14px; display: flex; gap: 8px; }
.v6-push-right { margin-left: auto; }

/* ── Matrix (risikoappetit + risikomatrix) ─────────────────────── */
.v6-matrix-wrap { overflow-x: auto; }
.v6-matrix { border-collapse: collapse; margin: 0 auto; font-size: 13px; }
.v6-matrix th { padding: 6px 10px; text-align: center; }
.v6-matrix th.v6-matrix-axis { text-align: right; padding: 6px 8px; }
.v6-matrix-col { width: 80px; }
.v6-matrix-col--wide { width: 120px; }
.v6-matrix-cell {
  color: #fff;
  padding: 10px 8px;
  min-height: 60px;
  text-align: center;
  font-weight: 700;
  border: 1px solid #fff;
}
.v6-matrix-cell-count { font-size: 18px; }
.v6-matrix-cell-list { font-size: 10px; opacity: .85; line-height: 1.3; }
.v6-matrix-cell-hint { font-size: 11px; opacity: .7; }
.v6-matrix-td { padding: 0; vertical-align: top; }
.v6-matrix-pad td { padding: 4px; }
/* K5 (#667): farve-legende under matricen (celle-tekst fjernet) */
.v6-matrix-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin: 12px 0; font-size: 12px; color: var(--muted); }
.v6-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.v6-legend-swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.12); display: inline-block; }
.v6-appetite-select { color: #fff; font-weight: 600; border: none; width: 100%; }
.mb-8 { margin-bottom: 8px; }
.mt-0 { margin-top: 0; }

/* ── SoA: tilknyttede foranstaltninger (dokumentation) ─────────── */
.v6-measure-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.v6-measure-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 4px;
  padding: 1px 4px 1px 8px; font-size: 12px;
}
.v6-measure-tag a { color: #3730a3; text-decoration: none; }

/* ── Issue 14: SoA Udfyld — chips + "Tilknyt foranstaltninger"-modal ───────── */
.v6-measure-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 4px; }
.v6-measure-chip {
  display: inline-flex; align-items: center;
  background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 4px;
  padding: 1px 8px; font-size: 12px; color: #3730a3;
}
.v6-measure-link-btn { display: block; margin-top: 2px; }

.v6-mm { display: flex; flex-direction: column; gap: 16px; min-width: 360px; }
.v6-mm-section { display: flex; flex-direction: column; gap: 8px; }
.v6-mm-h { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.v6-mm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.v6-mm-catalog { max-height: 220px; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px; }
.v6-mm-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 4px;
}
.v6-mm-catalog .v6-mm-row:hover { background: #f8fafc; }
.v6-mm-row.is-linked { opacity: .55; }
.v6-mm-title { font-size: 13px; font-weight: 500; }
.v6-mm-edit { margin-left: auto; color: #3730a3; text-decoration: none; white-space: nowrap; }
.v6-mm-catalog .v6-mm-row .v6-mm-add { margin-left: auto; }
.v6-mm-remove { color: #dc2626; }
.v6-mm-create { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.v6-mm-create [data-soa-new-title] { flex: 1 1 180px; }
.v6-mm-error { color: #dc2626; font-size: 13px; margin: 0; }

/* Inline-form (fx slet-knap i en handlingsrække). */
.v6-inline-form { display: inline; margin: 0; }
.v6-tag-x {
  border: none; background: none; cursor: pointer;
  color: #94a3b8; font-size: 16px; line-height: 1; padding: 0 2px;
}
.v6-tag-x:hover { color: #dc2626; }

/* ── TPRM: kontrakt/cert udløbs-badges + tilføj-formular ────────── */
.v6-expiry {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 3px; font-size: 11px; font-weight: 700; color: #fff;
}
.v6-expiry-exp { background: #dc2626; }
.v6-expiry-soon { background: #eab308; }
.v6-grid-add {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) auto;
  gap: 6px; align-items: center; margin-top: 8px;
}
/* Konsekvensanalyse-lister (issue 015). */
.v6-impact-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
/* Select + knap på én linje (fx leverandør-kobling). */
.v6-link-measure-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* Smalt talfelt (fx sortering). */
.v6-num { width: 90px; }

/* ── Farveforklaring ───────────────────────────────────────────── */
.v6-legend {
  margin-top: 18px;
  padding: 12px 16px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 13px;
}
.v6-legend-swatch {
  display: inline-block;
  padding: 2px 8px;
  color: #fff;
  border-radius: 3px;
  margin-left: 6px;
}

/* ── Historik (asset changelog) ────────────────────────────────── */
.v6-history {
  margin-top: 16px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.v6-history summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.v6-history-list { margin: 10px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.5; }
.v6-history-list li { margin-bottom: 6px; }
.v6-history-empty { margin: 8px 0 0; font-size: 12px; }

/* ── Enterprise-callout (compare_plans) ────────────────────────── */
.v6-ent-callout {
  margin-top: 28px;
  padding: 24px;
  border: 2px solid var(--accent, #1f4e78);
  border-radius: 12px;
}
.v6-ent-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.v6-ent-head h2 { margin: 0; font-size: 18px; }
.v6-ent-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--accent, #1f4e78);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
}
.v6-ent-lead { margin: 0 0 16px; font-size: 13px; }
.v6-ent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.v6-ent-tile { padding: 14px 16px; background: #f8fafc; border-radius: 8px; }
.v6-ent-tile-title { font-weight: 700; margin-bottom: 4px; }
.v6-ent-tile-body { font-size: 12px; line-height: 1.5; }
.v6-ent-foot { margin: 16px 0 0; font-size: 12px; }
.v6-ent-cta { margin-top: 16px; }

/* ── Diverse småting ───────────────────────────────────────────── */
.v6-note-block {
  margin-top: 18px;
  padding: 12px 16px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 13px;
}
.v6-progress-track { margin-top: 8px; height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden; }
.v6-progress-fill { height: 100%; border-radius: 2px; }

/* v11 ISSUE-10 — hierarkisk org-visning (sammenklappelig via <details>) */
.org-tree { padding: 8px 4px; }
.org-node { margin: 2px 0; }
.org-node > summary {
  list-style: none; cursor: pointer; padding: 6px 8px; border-radius: 6px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.org-node > summary::-webkit-details-marker { display: none; }
.org-node > summary::before { content: "▸"; color: #94a3b8; font-size: 11px; }
.org-node[open] > summary::before { content: "▾"; }
.org-node > summary:hover { background: var(--bg-muted, #f8f9fa); }
.org-node-name { font-weight: 600; }
.org-node-counts { margin-left: auto; }
.org-node-children { margin-left: 18px; border-left: 2px solid #e2e8f0; padding-left: 6px; }
