/* PrivaNex · Module Access and Error (04 Nov 2026)
 *  1. Corrective actions chart (Programme Dashboard): HTML bars in the page font (the stretched SVG distorted the text)
 *  2. Dashboard header: Dashboard PDF, PowerPoint deck and Report Centre on the right (every role dashboard)
 *  3. Cards whose form or text sits directly in the card (no card body) get the card's inner spacing
 *  4. Evidence Vault › Add a record: labelled two-column form
 *  5. System Admin › Module Access: table, Yes / No switch
 *  6. Protected module-guide viewer
 * PrivaNex navy #10458F, orange #FF791F, Outfit. */

:root { --pnx-navy: #10458F; --pnx-orange: #FF791F; --pnx-card-pad: var(--space-5, 20px); }

/* 1. Corrective actions chart ------------------------------------------------------------------------------------ */
.pnx-trend { --pnx-trend-h: 168px; }
.pnx-trend__legend { margin-bottom: 18px; }
.pnx-trend__chart { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 8px; font-family: var(--font, "Outfit", system-ui, sans-serif); }
.pnx-trend__axis { height: var(--pnx-trend-h); display: flex; flex-direction: column; justify-content: space-between; text-align: right; }
.pnx-trend__axis span { display: flex; align-items: center; justify-content: flex-end; height: 0; font-size: .75rem; line-height: 0; color: var(--text-muted, #5b6b7d); }
.pnx-trend__plot { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.pnx-trend__plot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--pnx-trend-h); pointer-events: none;
  border-bottom: 1px solid var(--border-strong, #c9d4df);
  background-image: linear-gradient(to bottom, var(--border, #e3e9ef) 1px, transparent 1px); background-size: 100% 25%; }
.pnx-trend__plot--1::before { background-size: 100% 100%; } .pnx-trend__plot--2::before { background-size: 100% 50%; } .pnx-trend__plot--3::before { background-size: 100% 33.333%; }
.pnx-trend__month { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pnx-trend__bars { position: relative; height: var(--pnx-trend-h); width: 100%; display: flex; justify-content: center; align-items: flex-end; gap: 6px; }
.pnx-trend__bar { position: relative; width: min(30px, 32%); border-radius: 5px 5px 0 0; min-height: 0; }
.pnx-trend__bar--a { background: #2F6DB5; } .pnx-trend__bar--b { background: var(--pnx-orange); }
.pnx-trend__bar b { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -3px); font-size: .75rem; font-weight: 600; color: var(--text, #1f2937); line-height: 1; }
.pnx-trend__lbl { margin-top: 8px; font-size: .78rem; color: var(--text-muted, #5b6b7d); white-space: nowrap; }
@media (max-width: 640px) { .pnx-trend__lbl { font-size: .7rem; } .pnx-trend__bars { gap: 3px; } }

/* 2. Dashboard header: downloads on the right -------------------------------------------------------------------- */
html .dpc-db-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
html .dpc-db-dl { justify-content: flex-end; justify-self: end; max-width: 560px; }
html .dpc-db-dl small { text-align: right; }
@media (max-width: 860px) { html .dpc-db-head { grid-template-columns: minmax(0, 1fr); } html .dpc-db-dl { justify-self: start; justify-content: flex-start; } html .dpc-db-dl small { text-align: left; } }

/* 3. Content placed directly in a card (no card body) keeps the card's inner spacing ------------------------------ */
.dpc-card:not(.dpc-card__body):not(.dpc-db-card) > :is(p, .dpc-field, .dpc-grid, .dpc-stack, .dpc-callout):not(.dpc-card__head):not(.dpc-card__body):not(.dpc-card__foot):not(.dpc-table-wrap):not(.dpc-row):not(.dpc-actions):not(:has(table)) { margin-left: var(--pnx-card-pad); margin-right: var(--pnx-card-pad); }
.dpc-card:not(.dpc-card__body):not(.dpc-db-card) > .dpc-card__head + :is(p, .dpc-field, .dpc-grid, .dpc-stack, .dpc-callout):not(.dpc-card__head):not(.dpc-card__body):not(.dpc-card__foot):not(.dpc-table-wrap):not(.dpc-row):not(.dpc-actions):not(:has(table)) { margin-top: var(--space-4, 16px); }
.dpc-card:not(.dpc-card__body):not(.dpc-db-card) > :is(p, .dpc-field, .dpc-grid, .dpc-stack, .dpc-callout):not(.dpc-card__head):not(.dpc-card__body):not(.dpc-card__foot):not(.dpc-table-wrap):not(.dpc-row):not(.dpc-actions):not(:has(table)):first-child { margin-top: var(--space-4, 16px); }
.dpc-card:not(.dpc-card__body):not(.dpc-db-card) > :is(p, .dpc-field, .dpc-grid, .dpc-stack, .dpc-callout):not(.dpc-card__head):not(.dpc-card__body):not(.dpc-card__foot):not(.dpc-table-wrap):not(.dpc-row):not(.dpc-actions):not(:has(table)):last-child { margin-bottom: var(--space-4, 16px); }
/* Guide Library: the four fields of a row stay aligned with the button under the last one */
.dpc-card > form.dpc-grid--4 { align-items: start; row-gap: var(--space-3, 12px); }

/* 4. Evidence Vault › Add a record ------------------------------------------------------------------------------ */
.pnx-vault-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.pnx-vault-add .dpc-field { margin: 0; min-width: 0; }
.pnx-vault-add .dpc-input, .pnx-vault-add .dpc-select, .pnx-vault-add .dpc-textarea { width: 100%; }
.pnx-vault-add__wide { grid-column: 1 / -1; }
.pnx-vault-add .dpc-textarea { min-height: 64px; resize: vertical; }
.pnx-vault-add__foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border, #e3e9ef); }
.pnx-req { color: var(--danger, #b83a08); }
@media (max-width: 720px) { .pnx-vault-add { grid-template-columns: minmax(0, 1fr); } }

/* Report Builder: naming set by the provider */
.pnx-naming-note { display: flex; align-items: center; gap: 6px; }
.pnx-ico-sm { width: 14px; height: 14px; flex: 0 0 14px; }

/* 5. Module Access ---------------------------------------------------------------------------------------------- */
.pnx-ma-table td, .pnx-ma-table th { vertical-align: middle; }
.pnx-ma-table .pnx-ma-sec th { background: var(--surface-2, #eaf2f8); color: var(--pnx-navy); font-size: .8rem; letter-spacing: .02em; text-transform: uppercase; padding-top: 10px; padding-bottom: 10px; }
.pnx-ma-table .pnx-ma-mod { font-weight: 600; color: var(--text, #1f2937); white-space: nowrap; }
.pnx-ma-table tr.pnx-ma-first td { border-top: 1px solid var(--border-strong, #c9d4df); }
.pnx-ma-table tr.pnx-ma-offrow td:not(.pnx-ma-mod) { color: var(--text-muted, #5b6b7d); }
.pnx-ma-table .pnx-ma-note { width: 100%; min-width: 11rem; }
.pnx-ma-count { font-size: 1.05rem; font-weight: 600; color: var(--pnx-navy); }
.pnx-ma-help { font-size: .82rem; }
.pnx-ma-save { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.pnx-ma-save__note { flex: 1 1 22rem; margin: 0; }
.pnx-ma-save__btns { display: flex; gap: 8px; }
.pnx-yn { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.pnx-yn--yes { background: var(--success-bg, #e6f4ec); color: var(--success, #1f7a4d); }
.pnx-yn--no { background: var(--surface-2, #eef2f6); color: var(--text-muted, #5b6b7d); }
/* the Yes / No switch (a checkbox) */
.pnx-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.pnx-switch input { position: absolute; z-index: 1; opacity: 0; width: 44px; height: 24px; margin: 0; cursor: pointer; }
.pnx-switch__track { position: relative; width: 44px; height: 24px; border-radius: 12px; background: #c3ccd6; transition: background .15s ease; flex: 0 0 44px; }
.pnx-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s ease; }
.pnx-switch input:checked + .pnx-switch__track { background: var(--pnx-navy); }
.pnx-switch input:checked + .pnx-switch__track::after { transform: translateX(20px); }
.pnx-switch input:focus-visible + .pnx-switch__track { outline: 2px solid var(--pnx-orange); outline-offset: 2px; }
.pnx-switch__yes, .pnx-switch__no { font-size: .8rem; font-weight: 600; min-width: 22px; }
.pnx-switch__yes { color: var(--pnx-navy); display: none; } .pnx-switch__no { color: var(--text-muted, #5b6b7d); }
.pnx-switch input:checked ~ .pnx-switch__yes { display: inline; } .pnx-switch input:checked ~ .pnx-switch__no { display: none; }
[data-theme=dark] .pnx-switch input:checked + .pnx-switch__track { background: var(--primary, #2B6CB0); }
[data-theme=dark] .pnx-switch__yes { color: var(--link, #7FB5E8); }

/* 6. Protected module-guide viewer --------------------------------------------------------------------------- */
.pnx-gv-body { margin: 0; background: #525c69; height: 100vh; overflow: hidden; }
.pnx-gv { display: flex; flex-direction: column; height: 100vh; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pnx-gv__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 16px; background: var(--surface, #fff); border-bottom: 3px solid var(--pnx-orange); }
.pnx-gv__title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pnx-gv__title svg { width: 22px; height: 22px; color: var(--pnx-navy); flex: 0 0 22px; }
.pnx-gv__title b { display: block; font-size: .95rem; color: var(--pnx-navy); }
.pnx-gv__title span { display: block; font-size: .74rem; color: var(--text-muted, #5b6b7d); }
.pnx-gv__nav, .pnx-gv__actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pnx-gv__pages { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; }
.pnx-gv__pages .dpc-input { width: 4.2rem; text-align: center; }
.pnx-gv__zoom { min-width: 3.4rem; text-align: center; font-size: .82rem; font-weight: 600; }
.pnx-gv__sep { width: 1px; height: 22px; background: var(--border, #d9e1e8); margin: 0 4px; }
.pnx-gv__notice { display: flex; align-items: center; gap: 8px; padding: 6px 16px; background: #fff6ef; color: #7a3a0b; font-size: .76rem; border-bottom: 1px solid #f3d6bf; }
.pnx-gv__notice svg { width: 14px; height: 14px; flex: 0 0 14px; }
.pnx-gv__stage { flex: 1 1 auto; overflow: auto; padding: 18px 12px 40px; display: flex; flex-direction: column; align-items: center; gap: 16px; outline: none; }
.pnx-gv__page { position: relative; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); flex: 0 0 auto; }
.pnx-gv__page canvas { display: block; pointer-events: none; }
.pnx-gv__loading { margin-top: 18vh; color: #fff; font-size: .95rem; }
.pnx-gv__loading.is-error { background: #fff; color: var(--danger, #b83a08); padding: 14px 18px; border-radius: 10px; }
.pnx-gv__shield { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #10458F; color: #fff; text-align: center; }
.pnx-gv__shield[hidden] { display: none; }
.pnx-gv__shield > div { display: grid; gap: 8px; justify-items: center; max-width: 420px; padding: 24px; }
.pnx-gv__shield svg { width: 34px; height: 34px; }
.pnx-gv__shield b { font-size: 1.1rem; }
.pnx-gv__shield span { font-size: .85rem; opacity: .9; }
.pnx-gv.is-shielded .pnx-gv__stage { filter: blur(24px); }
.pnx-gv-noprt { display: none; }
@media print {
  .pnx-gv-body > *:not(.pnx-gv-noprt) { display: none !important; }
  .pnx-gv-noprt { display: block !important; font: 600 18px/1.4 Outfit, sans-serif; color: #10458F; padding: 40px; }
}
@media (max-width: 720px) { .pnx-gv__bar { padding: 8px 10px; } .pnx-gv__sep, .pnx-gv__zoom { display: none; } }
.pnx-ma-help { padding: 12px 16px; border: 1px solid var(--border, #d9e1e8); border-left: 4px solid var(--pnx-navy); border-radius: 10px; background: var(--surface, #fff); color: var(--text, #1f2937); line-height: 1.5; }
.pnx-ma-pair { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-4, 16px); align-items: start; }
.pnx-ma-pair [data-module-access-features] td:first-child { min-width: 18rem; }
@media (max-width: 1100px) { .pnx-ma-pair { grid-template-columns: minmax(0, 1fr); } }
.pnx-ma-pair .pnx-ma-note { min-width: 8rem; }
