/* Maack ISMS – additions on top of the CRM stylesheet (styles.css) */
:root { --sidebar: 236px; --ok: #1d9a5b; --ok-soft: #e3f5ea; --warn-soft: #fff3e0; --bad-soft: #fdecea; --info-soft: #e6f0fc; }

.brand .logo { height: 26px; vertical-align: middle; }
.brand .tag { color: #6fb1ff; margin-left: 8px; font-size: 16px; }
.sidebar { overflow-y: auto; }
.nav .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: #7f8da3; padding: 14px 12px 4px; display: flex; justify-content: space-between; cursor: pointer; user-select: none; }
.nav .grp:hover { color: #c6cfdd; }
.nav .grp .iso { text-transform: none; letter-spacing: 0; opacity: .7; }
.nav .grp-items.collapsed { display: none; }
.nav a { padding: 7px 12px; font-size: 13.5px; }
.nav a .cnt { margin-left: auto; font-size: 11px; opacity: .7; }

/* intro box at the top of each list */
.intro { background: var(--info-soft); border: 1px solid #cfe0f7; color: #20406a; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; display: flex; gap: 12px; align-items: flex-start; }
.intro .iso { font-weight: 600; white-space: nowrap; background: #fff; border-radius: 6px; padding: 1px 8px; font-size: 12px; border: 1px solid #cfe0f7; }

/* status colours (badges) */
.badge.ok { background: var(--ok-soft); color: #157a45; }
.badge.warn { background: var(--warn-soft); color: #a55f00; }
.badge.bad { background: var(--bad-soft); color: #b03a31; }
.badge.info { background: var(--info-soft); color: #0f5bb3; }
.badge.mute { background: #eef1f5; color: #6b7686; }
.badge.score { min-width: 26px; text-align: center; font-weight: 650; }
.inactive-row td { opacity: .55; }

/* record page */
.rec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.rec-head h1 { margin: 2px 0 4px; font-size: 22px; }
.rec-head .crumb { color: var(--muted); font-size: 13px; }
.rec-head .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.rec-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rec-layout > div { display: grid; gap: 16px; min-width: 0; }
.fields { display: grid; grid-template-columns: 190px 1fr; gap: 7px 14px; font-size: 13.5px; }
.fields dt { color: var(--muted); }
.fields dd { margin: 0; word-break: break-word; white-space: pre-wrap; }
.fields .sec { grid-column: 1 / -1; font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.memo { white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; }
.memo-block { margin-bottom: 14px; }
.memo-block h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.rel-group { margin-bottom: 10px; }
.rel-group h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.rel-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.rel-item a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-item .x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 4px; visibility: hidden; }
.rel-item:hover .x { visibility: visible; }
.note { border-bottom: 1px solid var(--border); padding: 9px 0; }
.note:last-child { border-bottom: 0; }
.note .meta { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }
.note .meta button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.file-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.drop { border: 2px dashed var(--border); border-radius: 10px; padding: 12px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.drop.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.log-row { font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.log-row:last-child { border-bottom: 0; }
.log-row .ch { color: var(--muted); margin-top: 2px; }
.log-row .ch s { color: #b03a31; text-decoration: line-through; }
.log-row .ch b { color: #157a45; font-weight: 500; }

/* dashboard */
.grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.kpi a.value { color: inherit; display: block; }
.kpi.ok .value { color: var(--ok); }
.progress { height: 8px; background: #eef1f5; border-radius: 99px; overflow: hidden; margin-top: 8px; display: flex; }
.progress i { display: block; height: 100%; }
.att { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.att:last-child { border-bottom: 0; }
.att .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.att .dot.bad { background: var(--danger); } .att .dot.warn { background: var(--warning); } .att .dot.info { background: var(--primary); }
.att .items { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.att .items a { margin-right: 10px; }

/* risk matrix */
.matrix { display: grid; grid-template-columns: 34px repeat(4, 1fr); gap: 4px; max-width: 560px; }
.matrix .cell { aspect-ratio: 1.6; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 650; cursor: pointer; border: 2px solid transparent; color: #1c2430; }
.matrix .cell.sel { border-color: #1c2430; }
.matrix .cell.empty-c { color: rgba(0,0,0,.25); font-weight: 400; font-size: 14px; }
.matrix .axis { display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); text-align: center; }
.matrix .ylab { writing-mode: vertical-rl; transform: rotate(180deg); }
.heat-1 { background: #d9f2e3; } .heat-2 { background: #f6f0c4; } .heat-3 { background: #fbd9a6; } .heat-4 { background: #f5a99f; }

/* SoA */
.soa-theme { margin-bottom: 18px; }
.soa-theme h3 { margin: 0 0 8px; font-size: 15px; display: flex; gap: 10px; align-items: center; }
.soa .code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; white-space: nowrap; }
.soa td { vertical-align: top; }
.soa .just { color: var(--muted); font-size: 12.5px; max-width: 520px; white-space: pre-wrap; }

/* annual wheel */
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.month h4 { margin: 0 0 6px; font-size: 13px; text-transform: capitalize; }
.cal-item { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; background: #fafbfd; margin-bottom: 5px; border-left: 3px solid var(--primary); font-size: 13px; }
.cal-item.overdue { border-left-color: var(--danger); background: var(--bad-soft); }
.cal-item.k-Handling { border-left-color: #6a3fb8; }
.cal-item.k-Dokumentgennemgang { border-left-color: var(--warning); }
.cal-item .d { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 38px; }
.cal-item .o { color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) { .rec-layout { grid-template-columns: 1fr; } .grid.cols-5 { grid-template-columns: repeat(2, 1fr); } }
@media print {
  .sidebar, .topbar, .toolbar, .no-print, .btn { display: none !important; }
  .app { display: block; } .content { padding: 0; } .card { box-shadow: none; }
  body { background: #fff; }
}

/* multitenant: readers see no edit controls; tenant switcher */
body.readonly .w { display: none !important; }
.tenant-pick { display: flex; align-items: center; gap: 6px; }
.tenant-pick select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); font-weight: 600; max-width: 260px; }
.tenant-name { font-weight: 650; color: var(--text); }
.role-badge { font-size: 11px; }
.member-row { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.member-row select { padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; }
.grid.cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid > * { min-width: 0; }
@media (max-width: 1100px) { .grid.cols-2 { grid-template-columns: minmax(0, 1fr); } }

/* standards & compliance (RAG = rød/gul/grøn) */
.std-pick select { max-width: 200px; }
.nav-note { font-size: 11.5px; color: #8391a7; padding: 10px 12px; }
.nav-note a { color: #9cc6ff; }
.rag { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.rag-ok { background: var(--ok); } .rag-warn { background: var(--warning); } .rag-bad { background: var(--danger); } .rag-na, .rag-none { background: #b7c0cc; }
.rag-text-ok { color: var(--ok); } .rag-text-warn { color: var(--warning); } .rag-text-bad { color: var(--danger); } .rag-text-na, .rag-text-none { color: var(--muted); }
.rag-bg-ok { background: var(--ok-soft); color: #157a45; border-color: #b9e4cb !important; } .rag-bg-warn { background: var(--warn-soft); color: #a55f00; border-color: #f3d39b !important; }
.rag-bg-bad { background: var(--bad-soft); color: #b03a31; border-color: #f3c3bd !important; } .rag-bg-na, .rag-bg-none { background: #eef1f5; color: var(--muted); }
.std-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; margin-bottom: 16px; }
.std-card { cursor: pointer; border-top: 4px solid #b7c0cc; }
.std-card:hover { box-shadow: 0 4px 14px rgba(16,24,40,.12); }
.rag-border-ok { border-top-color: var(--ok); } .rag-border-warn { border-top-color: var(--warning); } .rag-border-bad { border-top-color: var(--danger); }
.std-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.std-name { font-size: 17px; font-weight: 650; }
.std-pct { font-size: 28px; font-weight: 700; }
.std-card .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.chap-tiles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.chap { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; border: 1px solid transparent; }
.chap:hover { outline: 2px solid rgba(0,0,0,.15); }
.chap-card { margin-bottom: 14px; scroll-margin-top: 70px; }
.chap-head { cursor: pointer; }
.chap-head h3 { display: flex; align-items: center; gap: 8px; }
.chap-head .hint { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rag-bar { margin-top: 6px; }
.checks-mini { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
.checks-mini .cm { font-size: 11.5px; }
.req-detail td { background: #fafbfd; }
.req-box { padding: 4px 0 6px; }
.req-status { margin-bottom: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.check-list { display: grid; gap: 7px; }
.check-item { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.check-recs { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; font-size: 12.5px; }
.check-recs a.miss { color: #a55f00; }
.hint-box { background: var(--info-soft); border-radius: 8px; padding: 8px 10px; margin-top: 10px; font-size: 13px; }
