/* ============================================================
   Scouting at Odiham — Trustee Assurance
   Design system v0.3.0: modern, clean, compact, information-dense.
   One token set drives every page. No per-page overrides.
   ============================================================ */

:root {
    /* Identity */
    --brand: #003982;          /* deep navy (existing header colour) */
    --brand-2: #0b4aa3;
    --scout: #7413dc;          /* Scouts purple: restrained accent only */
    --accent: #006ddf;

    /* Surface */
    --bg: #f4f6f9;
    --surface: #ffffff;
    --line: #dfe4ea;
    --line-strong: #c5ccd6;
    --text: #404040;
    --text-2: #52606d;
    --text-3: #7b8794;

    /* Status */
    --green: #38a169;  --green-bg: #c6f6d5;  --green-fg: #22543d;
    --amber: #d69e2e;  --amber-bg: #fefcbf;  --amber-fg: #744210;
    --red: #e53e3e;    --red-bg: #fed7d7;    --red-fg: #742a2a;
    --grey: #a0aec0;   --grey-bg: #e2e8f0;   --grey-fg: #4a5568;
    --info-bg: #ebf4ff; --info-fg: #2a4365;

    /* Type scale */
    --fs-body: 15px;
    --fs-data: 15px;
    --fs-small: 14px;
    --fs-nav: 15px;
    --fs-h1: 1.6rem;           /* 25.6px */
    --fs-h2: 1.2rem;           /* ~19px */
    --fs-h3: 1.05rem;

    /* Spacing scale */
    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;

    --radius: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    --focus: 0 0 0 3px rgba(43, 108, 176, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: var(--fs-body);
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 3px; }

.skip-link {
    position: absolute; left: -999px; top: 0; background: var(--surface);
    padding: var(--s2) var(--s3); z-index: 100;
}
.skip-link:focus { left: var(--s2); top: var(--s2); }
.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header / navigation (Scouts.org.uk style: white bar, dark links) ---------- */
header {
    background: #fff;
    color: var(--text);
    padding: 0 var(--s4);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}
header nav {
    display: flex;
    align-items: center;
    gap: var(--s4);
    min-height: 72px;
    max-width: 1100px;
    margin: 0 auto;
}
.logo-block { display: flex; align-items: center; text-decoration: none; margin-right: var(--s3); }
.logo-mark { height: 56px; width: auto; background: #fff; }
.nav-links { display: flex; gap: var(--s1); flex: 1; justify-content: flex-start; }
.nav-links a {
    color: var(--text);
    font-size: 15px; font-weight: 600;
    padding: 26px var(--s3) 22px;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}
.nav-links a:hover { color: var(--scout); text-decoration: none; }
.nav-links a.active { color: var(--scout); border-bottom-color: var(--scout); }
.nav-auth { display: flex; align-items: center; gap: var(--s3); margin-left: auto; font-size: var(--fs-nav); }
.nav-auth .btn-small { background: var(--brand); color: #fff; border-color: transparent; }
.cog { display: block; }

.admin-menu { position: relative; }
.admin-menu summary {
    list-style: none; cursor: pointer; color: var(--text-2);
    padding: 6px; border-radius: 50%; display: flex;
}
.admin-menu summary::-webkit-details-marker { display: none; }
.admin-menu summary:hover, .admin-menu summary.active, .admin-menu[open] summary { color: var(--scout); background: #f1e8fc; }
.menu-user { display: block; padding: 6px var(--s3); font-weight: 700; color: var(--brand); border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.admin-menu-list {
    position: absolute; right: 0; top: 100%; z-index: 50; min-width: 170px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(16,24,40,0.18); padding: var(--s1) 0; margin-top: 4px;
}
.admin-menu-list a { display: block; padding: 6px var(--s3); color: var(--text); }
.admin-menu-list a:hover { background: var(--bg); text-decoration: none; }

main {
    max-width: 1100px;
    width: 100%;
    margin: var(--s5) auto;
    padding: 0 var(--s4);
    flex: 1;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: var(--s4);
    flex-wrap: wrap;
    padding: var(--s3) var(--s4);
    color: var(--text-3);
    font-size: var(--fs-small);
    border-top: 1px solid var(--line);
    background: var(--surface);
}

/* ---------- Typography ---------- */
h1 { font-size: var(--fs-h1); line-height: 1.25; font-weight: 650; color: var(--brand); margin-bottom: var(--s1); }
h2 { font-size: var(--fs-h2); font-weight: 650; margin: 0 0 var(--s2); color: var(--text); }
h3 { font-size: var(--fs-h3); font-weight: 650; margin: var(--s2) 0 var(--s1); color: var(--text-2); text-transform: none; }
p { margin-bottom: var(--s2); }
.subtitle { color: var(--text-2); margin-bottom: var(--s3); }
.hint, .mini-note, .form-note { color: var(--text-2); font-size: var(--fs-small); }
.hint { margin-bottom: var(--s2); }
.empty-state { color: var(--text-3); font-size: var(--fs-data); padding: var(--s1) 0; margin: 0; }
.title-meta { color: var(--text-2); font-size: var(--fs-data); }
.inline-h { display: inline; font-size: var(--fs-h2); }

.breadcrumb {
    margin-bottom: var(--s2);
    font-size: var(--fs-small);
    color: var(--text-3);
    display: flex; flex-wrap: wrap; gap: 0 var(--s2);
}
.breadcrumb a { color: var(--accent); }

.dashboard-title-row, .check-header {
    display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap;
    margin-bottom: var(--s2);
}
.dashboard-title-row h1, .check-header h1 { margin: 0; }
.alert-inline {
    background: var(--amber-bg); color: var(--amber-fg); border-radius: 10px;
    padding: 1px 10px; font-size: var(--fs-small); font-weight: 600;
}

/* ---------- Panels / cards ---------- */
.panel, .check-detail, .assessment-form, .dashboard-summary, .dashboard-checks {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--s3);
    margin-bottom: var(--s3);
}
.dashboard-summary h2, .dashboard-checks h2 { margin-bottom: var(--s2); }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s2); }
.section-header h2 { margin: 0; }
.action-links-bar, .action-bar { display: flex; gap: var(--s2); margin-bottom: var(--s2); }
.action-links { display: flex; gap: var(--s2); }
.dashboard-nav { margin-top: var(--s2); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    font: inherit; font-size: var(--fs-data); font-weight: 600;
    padding: 5px var(--s3);
    border-radius: 5px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: white;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #2c5282; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-small { padding: 2px 10px; font-size: var(--fs-small); }
.btn-tiny { padding: 0 6px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.action-icon-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--accent); color: white; font-weight: 700; font-size: 15px; line-height: 1;
}
.action-icon-link:hover { background: #2c5282; text-decoration: none; }
.edit-icon { color: var(--text-2); font-size: 15px; }

/* ---------- Badges ---------- */
.rag-badge, .badge, .status-badge, .priority-badge {
    display: inline-block;
    padding: 0 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: var(--fs-small);
    line-height: 1.6;
    white-space: nowrap;
}
.rag-badge { letter-spacing: 0.02em; font-size: 13px; }
.rag-green, .badge-green { background: var(--green-bg); color: var(--green-fg); }
.rag-amber, .badge-amber, .rag-yellow { background: var(--amber-bg); color: var(--amber-fg); }
.rag-red, .badge-red { background: var(--red-bg); color: var(--red-fg); }
.rag-grey, .badge-grey { background: var(--grey-bg); color: var(--grey-fg); }
.rag-large { font-size: var(--fs-data); padding: 1px 12px; }
.badge-large { font-size: var(--fs-data); padding: 1px 12px; }
.status-badge, .priority-badge { background: var(--grey-bg); color: var(--grey-fg); }
.status-open, .status-blocked, .priority-high, .status-not-started { background: var(--red-bg); color: var(--red-fg); }
.status-in-progress, .status-under-review, .priority-medium, .status-at-risk { background: var(--amber-bg); color: var(--amber-fg); }
.status-completed, .status-closed, .status-complete, .status-on-track, .priority-low, .status-active { background: var(--green-bg); color: var(--green-fg); }
.status-treat, .status-tolerate, .status-transfer, .status-terminate { background: var(--info-bg); color: var(--info-fg); }

/* Data completeness dots */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }
.dot-grey { background: var(--grey); }

/* RAG borders */
.rag-border-green { border-left: 10px solid #00c853; }
.rag-border-amber { border-left: 10px solid #ffab00; }
.rag-border-red { border-left: 10px solid #ff1744; }
.rag-border-grey { border-left: 10px solid #b0bec5; }

/* ---------- Alerts / flashes ---------- */
.alert, .flash {
    padding: 6px var(--s3);
    border-radius: 5px;
    font-size: var(--fs-data);
    margin-bottom: var(--s2);
    border: 1px solid transparent;
}
.alert-warning, .alert-amber, .flash-warning { background: var(--amber-bg); color: var(--amber-fg); border-color: #ecc94b; }
.alert-red, .flash-error { background: var(--red-bg); color: var(--red-fg); border-color: #fc8181; }
.alert-info { background: var(--info-bg); color: var(--info-fg); border-color: #bee3f8; }
.flash-success { background: var(--green-bg); color: var(--green-fg); border-color: #9ae6b4; }
.flash-messages { margin-bottom: var(--s2); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: var(--fs-data); }
th {
    text-align: left; font-size: 13px; font-weight: 650; color: var(--text-2);
    
    padding: 4px var(--s2); border-bottom: 1px solid var(--line-strong); background: transparent;
    white-space: nowrap;
}
td { padding: 4px var(--s2); border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: #f8fafc; }
tr:last-child td { border-bottom: none; }
.checks-table, .data-table-wrap { overflow-x: auto; }
.check-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-small); color: var(--text-2); white-space: nowrap; }
.data-table.compact td, .data-table.compact th { padding: 3px var(--s2); }

/* Compact Assurance Check list (Foundation dashboard) */
.checks-table-compact { max-width: 800px; }
.checks-table-compact td, .checks-table-compact th { white-space: nowrap; }
.checks-table-compact .check-name { white-space: normal; }
.check-name a { font-weight: 500; }
.area-row td {
    background: var(--bg); font-size: var(--fs-small); font-weight: 650; color: var(--text-2);
     border-bottom: 1px solid var(--line);
    padding-top: 6px;
}
.area-row:hover { background: var(--bg); }
.review-overdue { color: var(--red-fg); font-weight: 600; }
.review-current { color: var(--green-fg); }
.review-none { color: var(--text-3); }
.col-edit { text-align: center; }

/* ---------- Forms ---------- */
label { display: block; font-size: var(--fs-small); font-weight: 600; color: var(--text-2); margin-bottom: 2px; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], select, textarea {
    width: 100%;
    font: inherit; font-size: var(--fs-data);
    padding: 4px var(--s2);
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: var(--surface);
    color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
textarea { resize: vertical; }
.form-group { margin-bottom: var(--s2); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s3); }
.form-actions { display: flex; gap: var(--s2); margin-top: var(--s2); }
form.form, .auth-form { max-width: 720px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); }
.filter-form, .filter-bar { margin-bottom: var(--s2); }
.filter-actions { display: flex; align-items: flex-end; gap: var(--s2); }
.link-form { margin-top: var(--s2); }
.tiny-form { display: inline; }
.full-width { grid-column: 1 / -1; }
.auth-page { max-width: 380px; margin: var(--s5) auto; }
.auth-hint { margin-top: var(--s2); font-size: var(--fs-small); color: var(--text-2); }

/* Inline (in-place) editing */
.inline-form {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 var(--s3);
    padding: var(--s2) var(--s3) var(--s3);
    background: #f8fafc; border-top: 1px solid var(--line);
}
.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }
.item-list { border: 1px solid var(--line); border-radius: 5px; margin-bottom: var(--s2); overflow: hidden; }
.item-row + .item-row { border-top: 1px solid var(--line); }
.item-row summary {
    display: grid; grid-template-columns: auto minmax(120px, 2fr) minmax(0, 3fr) 90px 34px;
    gap: var(--s3); align-items: center; padding: 5px var(--s3); cursor: pointer; list-style: none;
    font-size: var(--fs-data);
}
.item-row summary::-webkit-details-marker { display: none; }
.item-row summary:hover { background: #f8fafc; }
.item-row[open] summary { background: #f0f4f8; }
.item-title { font-weight: 600; }
.item-desc { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-date { color: var(--text-3); font-size: var(--fs-small); }
.item-edit { color: var(--accent); font-size: var(--fs-small); text-align: right; }
.add-item summary { list-style: none; display: inline-block; cursor: pointer; }
.add-item summary::-webkit-details-marker { display: none; }
.add-item[open] summary { margin-bottom: var(--s2); }
.add-item .inline-form { border: 1px solid var(--line); border-radius: 5px; }
.link-existing { display: flex; gap: var(--s2); margin-top: var(--s2); }

/* details / accordions */
details > summary { cursor: pointer; font-size: var(--fs-data); font-weight: 600; color: var(--text-2); }
details > summary:hover { color: var(--accent); }
.assessment-history, .inline-details { margin-top: var(--s2); }
.dc-subgrid details { margin-top: var(--s2); }
details[open] > summary { margin-bottom: var(--s2); }

/* ---------- Board dashboard ---------- */
.board-layout-v2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s3); align-items: start; }
.board-main-v2 > section, .board-sidebar-v2 > section {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: var(--s3); margin-bottom: var(--s3);
}
.responsibilities-2x2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.responsibility-tile {
    display: flex; flex-direction: column; gap: var(--s1);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: var(--s2) var(--s3);
    color: inherit; text-decoration: none;
}
.responsibility-tile:hover { background: #f8fafc; text-decoration: none; box-shadow: var(--shadow); }
.responsibility-tile-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.responsibility-tile-name { font-weight: 650; font-size: var(--fs-body); color: var(--brand); }
.rag-mix { display: flex; gap: var(--s1); }
.mix { min-width: 26px; text-align: center; border-radius: 4px; font-size: var(--fs-small); font-weight: 650; padding: 0 4px; }
.mix-green { background: var(--green-bg); color: var(--green-fg); }
.mix-amber { background: var(--amber-bg); color: var(--amber-fg); }
.mix-red { background: var(--red-bg); color: var(--red-fg); }
.mix-grey { background: var(--grey-bg); color: var(--grey-fg); }
.responsibility-tile-stats { display: flex; gap: var(--s3); font-size: var(--fs-small); color: var(--text-2); }
.responsibility-tile-risks { display: flex; gap: var(--s3); font-size: var(--fs-small); font-weight: 600; min-height: 1.2em; }
.risk-h { color: var(--red); }
.risk-m { color: var(--amber-fg); }
.risk-l { color: #b7791f; }

.risk-priority-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-bottom: var(--s2); }
.risk-priority-card {
    display: flex; flex-direction: column; align-items: center;
    padding: var(--s1) var(--s2); background: var(--bg); border-radius: 5px; border-top: 3px solid var(--grey);
}
.risk-priority-count { font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.risk-priority-label { font-size: var(--fs-small); color: var(--text-2); }
.risk-high { border-top: 3px solid #e53e3e; }
.risk-high .risk-priority-count { color: #e53e3e; }
.risk-medium { border-top: 3px solid #ed8936; }
.risk-medium .risk-priority-count { color: #ed8936; }
.risk-low { border-top: 3px solid #ecc94b; }
.risk-low .risk-priority-count { color: #ecc94b; }

.mini-list { list-style: none; font-size: var(--fs-data); }
.mini-list li { display: flex; justify-content: space-between; gap: var(--s2); padding: 3px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: none; }
.mini-list a { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.mini-num { font-weight: 650; color: var(--text-2); }

/* Assurance summary (Foundation dashboard) */
.compact-summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.compact-summary h2 { margin: 0; }
.summary-cards { display: flex; gap: var(--s2); }
.summary-card {
    display: flex; align-items: baseline; gap: 6px;
    padding: 2px 10px; border-radius: 5px; background: var(--bg); border-left: 4px solid var(--grey);
}
.summary-count { font-size: 1.1rem; font-weight: 700; }
.summary-label { font-size: var(--fs-small); color: var(--text-2); }
.summary-green { border-left-color: var(--green); }
.summary-amber { border-left-color: var(--amber); }
.summary-red { border-left-color: var(--red); }
.summary-grey, .summary-na { border-left-color: var(--grey); }
.rag-explain { flex: 1 1 260px; font-size: var(--fs-data); }
.rag-explain p { margin: 0; }
.rag-breakdown { color: var(--text-2); }

/* ---------- Check detail (working page) ---------- */
.check-about { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.check-about h3:first-child { margin-top: 0; }
.check-about p { font-size: var(--fs-data); }
.check-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: var(--s3); align-items: start; }
.assessment-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); align-items: stretch; }
.current-assessment { display: flex; flex-direction: column; justify-content: flex-start; }
.current-assessment p { margin-bottom: 0.3rem; font-size: var(--fs-data); }
.assessment-description { display: flex; flex-direction: column; }
.assessment-form h3 { margin-top: 0; }
.assessment-form { border: none; box-shadow: none; padding: 0; margin: 0; background: transparent; }
.unassessed-notice { background: var(--grey-bg); color: var(--grey-fg); border-radius: 5px; padding: var(--s2) var(--s3); font-size: var(--fs-data); }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s4); }
.kv-grid p { font-size: var(--fs-data); }

.findings-list { display: flex; flex-direction: column; }
.finding-card {
    display: flex; align-items: center; gap: var(--s2);
    padding: 4px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: var(--fs-data);
}
.finding-card:last-child { border-bottom: none; }
.finding-card:hover { background: #f8fafc; text-decoration: none; }
.finding-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-small); color: var(--text-2); }
.finding-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finding-header { display: flex; gap: var(--s2); align-items: center; }

.evidence-list, .req-list, .check-chip-list { list-style: none; font-size: var(--fs-data); }
.evidence-list li, .check-chip-list li { padding: 2px 0; border-bottom: 1px solid var(--line); display: flex; gap: var(--s2); justify-content: space-between; }
.evidence-list li:last-child, .check-chip-list li:last-child { border-bottom: none; }
.req-list { color: var(--text-2); margin: 2px 0 var(--s1) var(--s4); list-style: disc; }
.req-list li { padding: 0; }
.data-req { padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.data-req:last-child { border-bottom: none; }
.data-req-head { display: flex; align-items: center; gap: var(--s2); font-weight: 600; }

/* ---------- Data & Evidence Centre ---------- */
.dc-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: var(--s3); align-items: start; }
.dc-rail {
    position: sticky; top: var(--s2);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: var(--s2) 0;
    font-size: var(--fs-data);
}
.dc-rail ul { list-style: none; }
.dc-rail a { display: flex; align-items: center; gap: var(--s2); padding: 4px var(--s3); color: var(--text); }
.dc-rail a:hover { background: var(--bg); text-decoration: none; }
.dc-rail a.active { background: var(--info-bg); color: var(--brand); font-weight: 650; box-shadow: inset 3px 0 0 var(--scout); }
.dc-rail-name { flex: 1; }
.dc-rail-count { color: var(--text-3); font-size: var(--fs-small); }
.dc-rail-overview { font-weight: 600; }
.dc-rail-register { border-top: 1px solid var(--line); margin-top: var(--s1); padding-top: var(--s2) !important; color: var(--text-2) !important; font-size: var(--fs-small); }
.dc-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s3); align-items: start; }
.completeness-status { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text-2); font-size: var(--fs-data); }
.completeness-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); font-size: var(--fs-small); color: var(--text-2); margin-bottom: var(--s2); }
.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s2); }
.section-card {
    display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: var(--s2) var(--s3); color: inherit;
}
.section-card:hover { background: #f8fafc; text-decoration: none; }
.section-card .section-header { justify-content: flex-start; margin-bottom: var(--s1); }
.section-name { font-weight: 650; }
.section-desc { font-size: var(--fs-small); color: var(--text-2); margin-bottom: var(--s1); }
.section-meta { display: flex; gap: var(--s3); font-size: var(--fs-small); color: var(--text-3); }
.missing-critical { font-size: var(--fs-small); color: var(--red-fg); margin-top: var(--s1); }
.vacant-line { font-size: var(--fs-data); color: var(--text-2); margin-top: var(--s2); }

/* ---------- Strategy / Risk / Evidence detail ---------- */
.check-meta { color: var(--text-2); font-size: var(--fs-data); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s2) var(--s4); }
.detail-field label { font-size: 13px;  color: var(--text-3); }
.detail-field span, .detail-field p { font-size: var(--fs-data); }
.filter-form .form-row { align-items: end; }
.risk-summary, .rating-box { font-weight: 650; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .board-layout-v2 { grid-template-columns: 1fr; }
    .check-cols, .dc-two { grid-template-columns: 1fr; }
    .inline-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    header nav { flex-wrap: wrap; padding: var(--s1) 0; gap: var(--s1) var(--s3); }
    .nav-links { order: 3; flex-basis: 100%; margin-left: 0; overflow-x: auto; }
    .dc-layout { grid-template-columns: 1fr; }
    .dc-rail { position: static; }
    .dc-rail ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .check-about, .assessment-two-column, .kv-grid { grid-template-columns: 1fr; }
    .responsibilities-2x2 { grid-template-columns: 1fr; }
    .item-row summary { grid-template-columns: auto 1fr 34px; }
    .item-desc, .item-date { display: none; }
    .logo-block { margin-right: var(--s2); }
}

.section-header .title-meta { margin-right: auto; margin-left: var(--s2); }

/* Inline filter bars (Risk Register, All Actions) */
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.filter-bar .filter-form { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin: 0; }
.filter-bar .filter-form label { display: inline; margin: 0; }
.filter-bar select, .filter-bar input[type=text] { width: auto; min-width: 130px; }

/* v0.3.1 additions */
h1, h2, h3, h4 { font-family: 'Nunito Sans', inherit; color: var(--brand); }
.req-detail { display: block; }
.evidence-req { background: #fffbe0; border-color: #f0e39a; }
.evidence-req a { font-weight: 600; }
.menu-user + a { margin-top: 2px; }
@media (max-width: 860px) {
    header nav { flex-wrap: wrap; min-height: 0; padding: var(--s2) 0; }
    .nav-links { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; }
    .nav-links a { padding: 8px var(--s2); }
    .logo-mark { height: 44px; }
}

/* v0.3.2: stripe must beat the tile's own border; larger check table text */
.responsibility-tile.rag-border-green { border-left: 10px solid #00c853; }
.responsibility-tile.rag-border-amber { border-left: 10px solid #ffab00; }
.responsibility-tile.rag-border-red { border-left: 10px solid #ff1744; }
.responsibility-tile.rag-border-grey { border-left: 10px solid #b0bec5; }
.checks-table-compact { max-width: 1000px; }
.checks-table-compact table { font-size: 15px; }
.checks-table-compact td, .checks-table-compact th { padding: 7px var(--s2); }
.checks-table-compact th { font-size: 13px; }

/* ============================================================
   Cycle D: simplified Data & Evidence Centre
   ============================================================ */
.dc-tabs { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s2) 0 var(--s3); border-bottom: 1px solid var(--line); }
.dc-tabs a { padding: var(--s2) var(--s3); color: var(--text-2); border-bottom: 3px solid transparent; font-weight: 600; }
.dc-tabs a:hover { text-decoration: none; color: var(--brand); }
.dc-tabs a.active { color: var(--brand); border-bottom-color: var(--scout); }
.dc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3); }
.vacant-row td { background: #fff8f8; }
.req-source { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); margin-bottom: 2px; }
.req-link-form { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1); margin-top: var(--s1); }
.req-link-form select { max-width: 220px; }
.inline-form-tight { display: inline; }
.link-btn { background: none; border: 0; color: var(--text-3); cursor: pointer; font-size: 16px; line-height: 1; }
.link-btn:hover { color: #c62828; }
.plain-list { margin: var(--s2) 0 0 var(--s4); }
.stack-form { display: flex; flex-direction: column; gap: var(--s2); max-width: 520px; }
.stack-form .form-group { display: flex; flex-direction: column; gap: 2px; }
.stack-form input, .stack-form select, .stack-form textarea { width: 100%; }
.stack-form .btn { align-self: flex-start; }

/* ---------- People & Documents refinements ---------- */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; font-size: 18px; line-height: 1; }
a.edit-icon.icon-btn { border-radius: 4px; font-size: 18px; }
a.edit-icon.icon-btn:hover { background: var(--grey-bg); text-decoration: none; }
.actions-col { width: 1%; white-space: nowrap; text-align: right; }
.category-row td { background: var(--bg); font-weight: 700; color: var(--brand); border-bottom: 1px solid var(--line-strong); padding-top: var(--s2); }
.category-row:hover { background: transparent; }
.readonly-field { background: var(--grey-bg); color: var(--text-2); }

/* ============================================================
   v0.4.x: Data & Evidence Centre form frames
   Balanced two-column forms with a shared frame header bar
   (Save icon at the far right) — ported from the SMS-GP
   "Popup" and "Form Actions" conventions.
   ============================================================ */
.frame-panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 3px rgba(29, 78, 116, 0.10); overflow: hidden; }
.frame-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s4); background: #f0f4f8; border-bottom: 1px solid var(--line-strong); }
.frame-header h1, .frame-header h2 { margin: 0; font-size: 18px; line-height: 1.2; display: inline-flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.frame-header .badge { font-size: 12px; }
.frame-save { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--brand); font-size: 18px; line-height: 1; cursor: pointer; text-decoration: none; }
.frame-save:hover { background: var(--brand); color: #fff; text-decoration: none; }
.frame-save:disabled { opacity: 0.5; cursor: not-allowed; }
.frame-body { padding: var(--s4); }
.dc-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s4); max-width: 1000px; }
.dc-form-grid > .dc-field-wide { grid-column: 1 / -1; }
.dc-form-grid > .dc-buttons { grid-column: 1 / -1; }
@media (max-width: 720px) {
    .dc-form-grid { grid-template-columns: 1fr; }
    .frame-body { padding: var(--s3); }
    .frame-header { padding: var(--s2) var(--s3); }
}
