/* ─── Footer ─── */
.home-footer {
    border-top: 1px solid #dee2e6;
    padding: 20px 0 32px;
}
.footer-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.footer-priv {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.65;
    flex: 3;
    margin-bottom: 0;
}
.footer-legal {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.65;
    flex: 2;
    border-left: 2px solid #C8D6FF;
    padding-left: 14px;
}
.footer-legal strong {
    font-size: 0.875rem;
    color: #495057;
    display: block;
    margin-bottom: 4px;
}
.footer-link {
    font-size: 0.875rem;
    color: #004EEB;
    cursor: pointer;
    display: block;
    margin-top: 6px;
    text-decoration: none;
}
.footer-link:hover {
    text-decoration: underline;
}

/* ─── Principle banner ─── */
.prin-banner {
    background-color: #004EEB;
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}
.pb-left {
    flex: 1;
}
.pb-ey {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,.55);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 4px;
}
.pb-t {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.2;
}
.pb-d {
    font-size: 0.9375rem;
    color: rgba(255,255,255,.7);
    line-height: 1.6;
    margin-bottom: 0;
}
.fw-tags {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}
.fw-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,.3);
    color: rgba(255,255,255,.85);
}
.pb-r {
    text-align: right;
    flex-shrink: 0;
}
.pb-cnt {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}
.pb-sub {
    font-size: 0.8rem;
    color: rgba(255,255,255,.55);
    margin-top: 3px;
}
.pb-mb {
    width: 80px;
    height: 4px;
    background: rgba(255,255,255,.25);
    border-radius: 2px;
    overflow: hidden;
    margin: 8px 0 0 auto;
}
.pb-mf {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    transition: width .3s ease;
}

/* ─── Utility bar ─── */
.util-bar {
    background-color: #090FA4;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.util-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.util-logo {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    text-decoration: none;
}
.util-logo img {
    height: 28px;
    width: 28px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}
.util-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}
.util-pill {
    font-size: 12px;
    color: rgba(255,255,255,.4);
    background: rgba(255,255,255,.08);
    border: .5px solid rgba(255,255,255,.15);
    border-radius: 3px;
    padding: 2px 7px;
}
.util-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-btn {
    font-size: 13px;
    color: rgba(255,255,255,.85);
    background: transparent;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 20px;
    padding: 6px 16px;
    cursor: pointer;
    transition: all .13s;
}
.nav-btn:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-color: rgba(255,255,255,.4);
}
.nav-btn-reset {
    color: #fca5a5 !important;
    border-color: rgba(248,113,113,.45) !important;
}
.nav-btn-reset:hover {
    background: rgba(248,113,113,.15) !important;
    border-color: rgba(248,113,113,.7) !important;
}
.nav-btn-primary {
    font-size: 13px;
    font-weight: 600;
    color: #090FA4;
    background: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 6px 18px;
    cursor: pointer;
    transition: all .13s;
}
.nav-btn-primary:hover {
    background: #D4DFFF;
}
.nav-btn-icon {
    background: transparent;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 6px;
    padding: 7px 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .13s, border-color .13s;
}
.nav-btn-icon:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.4);
}
.sb-hamburger { display: none; }
.sb-overlay {
    display: none;
    position: fixed;
    inset: 52px 0 0 0;
    background: rgba(0,0,0,.35);
    z-index: 199;
}
.sb-overlay.active { display: block; }

.lead {
    font-size: 1.1rem;
}

/* ─── Ensure risk card title is at least two lines tall */
.risk-card-title {
    min-height: 2.5em;
    display: flex;
    align-items: center;
    line-height: 1.2;
    word-break: break-word;
}
.navbar {
    padding: 1rem;
    /* margin-top: 50px; Increased margin */
    
}

body {
    /* padding-top: 50px; Increased padding */
}

.container.mt-4 {
    margin-top: 3rem !important; /* Increased margin */
}

/* Rest of the styles */
.home-icon {
    width: 20px;
    height: 20px;
}

/* ─── Tab nav ─── */
.tab-nav {
    background-color: #004EEB;
    display: flex;
    align-items: stretch;
    padding: 0 8px;
    overflow-x: auto;
    min-height: 50px;
    flex-shrink: 0;
    position: sticky;
    top: 52px;
    z-index: 1020;
}
.tab-nav::-webkit-scrollbar {
    height: 3px;
}
.tab-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.25);
}
.home-btn-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    flex-shrink: 0;
    border-bottom: 3px solid transparent;
    opacity: .6;
    text-decoration: none;
}
.home-btn-tab:hover {
    opacity: 1;
    border-bottom-color: rgba(255,255,255,.5);
}
.ctab {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    cursor: pointer;
    font-size: 0.8125rem;
    color: rgba(255,255,255,.6);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 50px;
    transition: color .13s, background .13s;
    user-select: none;
}
.ctab:hover {
    color: rgba(255,255,255,.9);
    background: rgba(255,255,255,.07);
}
.ctab.act {
    color: #fff;
    font-weight: 600;
    border-bottom-color: #fff;
}

.risk-card {
    border-radius: 10px;
    border-width: 2px;
    border-color: #004EEB;
    transition: transform 0.2s;
    cursor: pointer; /* Make cards clickable */
}

.risk-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Active state styles for risk cards */
.risk-card.active {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(0, 78, 235, 0.2);
}

.risk-card.active .card-body {
    color: #fff !important; 
    background-color: #004EEB !important; /* Light blue background */
}

.risk-card.active .progress-bar {
    background-color: #090FA4 !important; /* Darker blue progress bar */
}

.info-icon {
    font-size: 1.2rem;
    cursor: pointer;
}

.progress {
    height: 6px;
    background-color: #D4DFFF;
}

.risk-card.active .progress {
    background-color: #fff;
}

.progress-bar {
    background-color: white;
}

.nav-pills .nav-link {
    color: #0d6efd;
    background: none;
    border: 1px solid #0d6efd;
    border-radius: 20px;
    margin-right: 1rem;
    padding: 0.5rem 1.5rem;
}

.nav-pills .nav-link.active {
    background-color: #0d6efd;
    color: white;
}

.table {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 2rem;
    table-layout: fixed;
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

/* Table layout and cell styles */
.table {
    table-layout: fixed;
}

.table tr {
    display: table-row;
}

.table td {
    vertical-align: top;
    height: 100%;
}

/* Comments cell specific styles */
.comments-cell {
    position: relative;
    min-width: 200px;
    padding: 0 !important; /* Remove default padding */
}

.comments-cell > div {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.5rem;
}

.comments-cell textarea.form-control {
    width: 100%;
    height: 100% !important;
    min-height: 100%;
    resize: vertical;
    margin: 0;
    display: block;
    box-sizing: border-box;
}

/* Ensure content wrapping in other cells */
.table td:not(.comments-cell) {
    white-space: normal;
    word-wrap: break-word;
}

.col-1 { width: 120px; }
.col-3 { width: 165px; }
.comments-col {
    width: 300px;
}


.remarks-input {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
}

.category-counter {
    font-size: 0.9em;
    color: #6c757d;
}

#glossaryBtn {
    border-radius: 20px;
    padding: 0.5rem 1.5rem;
}

#generateReport {
    border-radius: 20px;
    padding: 0.5rem 1.5rem;
}

#resetData {
    border-radius: 20px;
    padding: 0.5rem 1.5rem;
    margin-right: 1rem;
}

#printButton,
#exportButton {
    border-radius: 20px;
    padding: 0.5rem 1.5rem;
}

#backButton {
    border-radius: 20px;
    padding: 0.5rem 1.5rem;
    margin-right: 1rem;
}
.btn-icon { display: none; }

.chart-container {
    max-width: 400px;
    margin: 0 auto;
}
.chart-container-overall {
    max-width: 300px;
    width: 100%;
}

/* ─── Report two-column layout + vertical tracker ─── */
.report-layout {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
}
#reportBanner {
    flex-basis: 100%;
    flex-shrink: 0;
}
.report-tracker {
    width: 180px;
    flex-shrink: 0;
    position: sticky;
    top: 52px;
    align-self: flex-start;
    max-height: calc(100vh - 52px);
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    padding: 16px 12px;
}
.report-content {
    flex: 1;
    min-width: 0;
}
.rt-toggle { display: none; }
.rt-close {
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6c757d;
    padding: 4px;
    margin: 0 0 8px auto;
    width: 24px;
    height: 24px;
}
.rt-close:hover { color: #004EEB; }
.rt-overlay {
    display: none;
    position: fixed;
    inset: 52px 0 0 0;
    background: rgba(0,0,0,.35);
    z-index: 299;
}
.rt-overlay.active { display: block; }
.rt-top {
    font-size: 11px;
    color: #004EEB;
    font-weight: 500;
    text-decoration: none;
    display: block;
    margin-bottom: 16px;
}
.rt-top:hover {
    text-decoration: underline;
}
.rt-list {
    position: relative;
}
.rt-line-track {
    position: absolute;
    left: 13px;
    top: 14px;
    bottom: 14px;
    width: 2px;
    background: #e2e8f0;
    z-index: 0;
}
.rt-line-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: #004EEB;
    transition: height .3s ease;
}
.rt-node {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
    z-index: 1;
}
.rt-node:last-child {
    margin-bottom: 0;
}
.rt-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #7b80a0;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.rt-node.visited .rt-circle {
    background: #D4DFFF;
    border-color: #C8D6FF;
    color: #004EEB;
}
.rt-node.active .rt-circle {
    background: #004EEB;
    border-color: #004EEB;
    color: #ffffff;
    box-shadow: 0 0 0 3px #EEF3FF;
}
.rt-label {
    padding-top: 4px;
    min-width: 0;
}
.rt-name {
    font-size: 11px;
    color: #7b80a0;
    line-height: 1.3;
    display: block;
    transition: color .2s, font-weight .2s;
}
.rt-node.visited .rt-name {
    color: #4a5068;
}
.rt-node.active .rt-name {
    color: #004EEB;
    font-weight: 600;
}
.rt-count {
    font-size: 10px;
    color: #9ca3b8;
    display: block;
    margin-top: 1px;
}

/* ─── Principle modal ─── */
.pm-header {
    background: #004EEB;
    border-bottom: none;
    padding: 20px 24px;
    align-items: flex-start;
    border-radius: calc(.3rem - 1px) calc(.3rem - 1px) 0 0;
}
.pm-header-left {
    flex: 1;
}
.pm-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pm-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #495057;
}
.pm-sym {
    font-size: 1rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}
.pm-stat-rate {
    font-size: 0.95rem;
    color: #495057;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}
.pm-rb-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 4px;
}
.pm-rb-track {
    position: relative;
    height: 8px;
    background: #e8edf5;
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
}
.pm-rb-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #004EEB;
    border-radius: 4px;
    transition: width .4s ease;
}
.pm-rb-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #7ba7ff;
    transform: translateX(-50%);
}
.pm-rb-vals {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 3px;
}

/* ─── Mini donut grid ─── */
.mini-donut-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.mini-donut-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    min-width: 140px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.mini-donut-item:hover {
    border-color: #7ba7ff;
    box-shadow: 0 2px 8px rgba(0,78,235,.08);
}
.mini-donut-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}
.mdi-center-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 700;
    color: #004EEB;
    pointer-events: none;
    line-height: 1;
}
.mdi-name {
    font-size: 11px;
    color: #4a5068;
    line-height: 1.3;
    margin-top: 8px;
    text-align: center;
}

/* ─── Stat cards grid ─── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}
.stat-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
    min-width: 0;
}
.stat-box-rate {
    background: #EEF3FF;
    border-color: #C8D6FF;
}
.stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    line-height: 1.1;
    margin-bottom: 4px;
}
.stat-num-obs   { color: #004EEB; }
.stat-num-part  { color: #4a6080; }
.stat-num-muted { color: #7b80a0; }
.stat-lbl {
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.3;
    margin-bottom: 2px;
}
.stat-note {
    font-size: 0.6875rem;
    color: #9ca3b8;
}

.report-disclaimer {
    color: #7b80a0;
}

#reportContent {
    max-height: 80vh;
    overflow-y: auto;
}

.category-card {
    border-radius: 10px;
    transition: transform 0.2s;
    cursor: pointer;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Hide the subcategory tabs since we're using cards */
.nav-pills {
    display: none;
}

.bg-gl1 {
    background-color: #090FA4;
}

.icon-wrapper {
  background-color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

/* custom.css */

/* Custom Primary Button */
.custom-btn-primary {
  background-color: #004EEB;
}

.custom-outline-btn {
  color: #004EEB; /* Green text */
  border-color: #004EEB;
}


.nav-tabs .nav-link.two-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.nav-tabs .nav-link.two-line span {
  line-height: 1; 
}

/* ─── Page body + left sidebar ─── */
.page-body {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 52px);
}
.main-col {
    flex: 1;
    min-width: 0;
}
.sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    background: #fafbff;
    border-right: 1px solid #dee2e6;
    transition: width .22s ease;
    overflow: hidden;
}
.sidebar.collapsed {
    width: 0;
    border-right: none;
}
.sb-inner {
    width: 260px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}
.sb-home {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6c757d;
    text-decoration: none;
    border-bottom: 1px solid #dee2e6;
    transition: background .13s, color .13s;
}
.sb-home:hover {
    background: #EEF3FF;
    color: #004EEB;
}
.sb-handle {
    position: fixed;
    left: 260px;
    top: calc(50vh - 26px);
    z-index: 101;
    width: 18px;
    height: 52px;
    background: #fafbff;
    border: 1px solid #dee2e6;
    border-left: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    color: #6c757d;
    padding: 0;
    transition: left .22s ease, background .13s, color .13s;
    box-shadow: 2px 0 4px rgba(0,0,0,.06);
}
.sb-handle:hover {
    background: #EEF3FF;
    color: #004EEB;
    border-color: #C8D6FF;
}
.sidebar.collapsed ~ .sb-handle {
    left: 0;
}
.sb-hdr {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6c757d;
    padding: 14px 14px 6px;
}
.sb-item {
    padding: 10px 14px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background .13s, border-color .13s;
}
.sb-item:hover {
    background: #EEF3FF;
}
.sb-item.act {
    background: #EEF3FF;
    border-left-color: #004EEB;
}
.sb-item-hd {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 5px;
}
.sb-num {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #004EEB;
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0;
}
.sb-ttl {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #495057;
    line-height: 1.3;
}
.sb-item.act .sb-ttl {
    color: #004EEB;
}
.sb-bar {
    height: 3px;
    background: #D4DFFF;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}
.sb-bar-fill {
    height: 100%;
    background: #004EEB;
    border-radius: 2px;
    transition: width .3s ease;
}
.sb-counts {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.sb-c {
    font-size: 0.6875rem;
    font-weight: 600;
}
.sb-c-yes     { color: #004EEB; }
.sb-c-partial { color: #4a6080; }
.sb-c-no      { color: #7b80a0; }
.sb-c-na      { color: #7b80a0; }
.sb-c-un      { color: #9ca3b8; }

/* ─── Source column ─── */
.src-col {
    width: 150px;
}
.src-tags {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.badge-pfmi,
.badge-dascp,
.badge-gbbc {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 3px 8px 3px 7px;
    border-radius: 3px;
    background: #EEF3FF;
    color: #004EEB;
    border: 1px solid #C8D6FF;
    border-left-width: 3px;
    display: inline-block;
    word-break: break-word;
}
.badge-pfmi  { border-left-color: #004EEB; }
.badge-dascp { border-left-color: #090FA4; }
.badge-gbbc  { border-left-color: #6B21A8; }

/* ─── Filter bar ─── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 0 8px;
    flex-wrap: wrap;
}
.fl {
    font-size: 0.8125rem;
    color: #6c757d;
    margin-right: 4px;
}
.fbtn {
    font-size: 0.8125rem;
    color: #495057;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all .13s;
}
.fbtn:hover {
    border-color: #004EEB;
    color: #004EEB;
}
.fbtn.act {
    background: #004EEB;
    color: #fff;
    border-color: #004EEB;
}

/* ─── Framework filter bar ─── */
.fw-btn {
    font-size: 0.8125rem;
    color: #495057;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all .13s;
}
.fw-btn:hover {
    border-color: #004EEB;
    color: #004EEB;
}
.fw-btn.fw-btn-active-all,
.fw-btn.fw-btn-active-pfmi,
.fw-btn.fw-btn-active-dascp,
.fw-btn.fw-btn-active-gbbc {
    background: #090FA4;
    border-color: #090FA4;
    color: #ffffff;
}

/* ─── Principle sections ─── */
.principle-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
}
.ps-header {
    background: #004EEB;
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.ps-header-left {
    flex: 1;
}
.ps-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.ps-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}
.ps-header-right {
    text-align: right;
    flex-shrink: 0;
}
.ps-ctrl-count {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}
.ps-ctrl-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
}
.ps-stats-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 24px;
    background: #EEF3FF;
    border-bottom: 1px solid #C8D6FF;
    flex-wrap: wrap;
}
.ps-stat {
    font-size: 0.8125rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 5px;
}
.ps-stat-spacer {
    flex: 1;
}
.ps-stat-rate {
    font-weight: 600;
    color: #212529;
}
.ps-status-pill {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.ps-sym-obs   { color: #004EEB; }
.ps-sym-part  { color: #4a6080; }
.ps-sym-muted { color: #7b80a0; }
.ps-table-wrap {
    padding: 0 0 16px;
}
.ps-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.ps-table thead th {
    background: #f8f9fa;
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}
.ps-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: top;
    color: #495057;
}
.ps-table tbody tr:last-child td {
    border-bottom: none;
}
.ps-col-code     { width: 110px; }
.ps-col-src      { width: 90px; }
.ps-col-resp     { width: 130px; }
.ps-col-comments { width: 220px; }
.ps-code {
    font-family: monospace;
    font-size: 0.75rem;
    color: #004EEB;
    font-weight: 600;
}
.ps-resp {
    font-size: 0.9rem;
}
.badge-src {
    font-size: 0.6875rem;
    padding: 2px 6px;
    display: inline-block;
    margin-bottom: 2px;
}
.ps-unanswered-note {
    font-size: 0.75rem;
    color: #9ca3b8;
    margin: 8px 14px 0;
    font-style: italic;
}

/* ─── Reset confirmation modal ─── */
.rm-warn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.rm-heading {
    font-size: 16px;
    font-weight: 600;
    color: #1a1f36;
    margin: 0;
}
.rm-body-text {
    color: #4a5068;
    line-height: 1.65;
    margin: 0;
}
.btn-reset-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid rgba(153,27,27,.25);
    font-weight: 600;
}
.btn-reset-danger:hover {
    background: #fecaca;
    color: #7f1d1d;
    border-color: rgba(153,27,27,.4);
}
.pm-print-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #EEF3FF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.btn-print-primary {
    background: #004EEB;
    color: #ffffff;
    border: none;
    font-size: 1rem;
    font-weight: 600;
}
.btn-print-primary:hover,
.btn-print-primary:focus {
    background: #003acc;
    color: #ffffff;
}

/* Add print media query at the end of your CSS file */
@media print {
    body {
        overflow: visible !important;
    }

    /* Optional: Ensure proper page breaks and printing styles */
    .category-section,
    .principle-section {
        page-break-inside: avoid;
    }

    /* Hide non-printable elements */
    #backButton,
    #exportButton,
    #printButton {
        display: none;
    }

    .report-tracker { display: none; }
    .report-content { margin-left: 0; width: 100%; }
    .ps-comment-body { display: block; }
}

/* ─── Mobile layout (compliance page) ─── */
@media (max-width: 767px) {
    html { overflow-x: hidden; }
    /* Util-bar: keep only hamburger + Generate Report */
    #glossaryBtn, #importBtn, #exportBtn, #resetData { display: none; }
    .util-right { gap: 2px; }
    /* Fix 2 (hamburger): compact size */
    .sb-hamburger { display: flex; padding: 4px 8px; line-height: 1; }
    .sb-handle { display: none; }
    /* Fix 1: Generate Report — compact, no wrapping */
    #generateReport { font-size: 0.75rem; padding: 5px 10px; white-space: nowrap; }
    /* Report page: export/print become icon-only on mobile */
    #exportButton .btn-icon, #printButton .btn-icon { display: block; }
    #exportButton .btn-label, #printButton .btn-label { display: none; }
    #exportButton, #printButton { padding: 7px 9px; border-radius: 6px; }
    #printButton { background: transparent; border: 1px solid rgba(255,255,255,.22); }

    /* Sidebar as slide-in drawer */
    .sidebar {
        position: fixed;
        top: 52px;
        left: 0;
        height: calc(100vh - 52px);
        width: 260px;
        transform: translateX(-100%);
        z-index: 200;
        transition: transform .25s ease;
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar.collapsed { width: 260px; transform: translateX(-100%); }

    /* Report tracker: hidden by default, slides in as fixed overlay */
    .report-tracker {
        position: fixed;
        top: 52px;
        left: 0;
        height: calc(100vh - 52px);
        max-height: none;
        width: 0;
        overflow: hidden;
        z-index: 300;
        border-right: none;
        padding: 0;
        transition: width .25s ease;
    }
    .report-tracker.open {
        width: 260px;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 16px 12px;
        border-right: 1px solid #dee2e6;
    }
    .rt-toggle { display: flex; }
    .rt-close { display: flex; }
    .report-content { flex-basis: 100%; }
    .report-layout { overflow-x: clip; }

    /* Principle banner: stack vertically */
    .prin-banner { flex-direction: column; gap: 12px; }
    .pb-r { text-align: left; }
    .pb-mb { margin: 8px 0 0; }

    /* Risk cards — compact horizontal strip */
    #riskCards { --bs-gutter-y: 0.5rem; }
    .risk-card { transform: none !important; }
    .risk-card:hover { transform: none; }
    .risk-card.active { transform: none !important; }
    .risk-card .card-body {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 10px 12px;
        gap: 0;
    }
    /* Fix 2 (card name): dissolve the d-flex wrapper so h3 and h4 sit as direct flex siblings */
    .risk-card .card-body > .d-flex { display: contents !important; }
    .risk-card .card-body > .d-flex .info-icon { display: none; }
    .risk-card .card-body > .d-flex h3 {
        font-size: 0.75rem;
        font-weight: 700;
        margin: 0 8px 0 0;
        white-space: nowrap;
        flex-shrink: 0;
    }
    /* Fix 2 (card name): title follows code, truncates with ellipsis */
    .risk-card .risk-card-title {
        flex: 1;
        min-width: 0;
        font-size: 0.875rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: unset !important;
        display: block !important;
        margin: 0;
        line-height: 1.3;
    }
    .risk-card .card-body > p { display: none; }
    /* Progress bar forces onto new line */
    .risk-card .progress {
        flex-basis: 100%;
        margin-top: 6px !important;
        height: 4px;
    }
    .risk-card .card-body > small { display: none; }

    /* Controls table: card layout */
    .controls-section .table-responsive { overflow: visible; }
    .controls-section .table thead { display: none !important; }
    .controls-section .table,
    .controls-section .table tbody { display: block; width: 100%; }
    .controls-section .table tr {
        display: block;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-bottom: 16px;
        padding: 12px 12px 16px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,.04);
    }
    .controls-section .table td {
        display: block;
        padding: 8px 0;
        border: none !important;
    }
    .controls-section .table td:first-child { padding-top: 0; }
    .controls-section .table td[data-label="Code"] {
        font-family: monospace;
        font-size: 0.875rem;
        font-weight: 600;
        color: #004EEB;
    }
    .controls-section .table td[data-label="Code"]::before,
    .controls-section .table td[data-label="Description"]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.6875rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: #9ca3b8;
        margin-bottom: 2px;
    }
    .controls-section .src-col { width: 100%; box-sizing: border-box; }
    .controls-section .src-col .src-tags { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .controls-section .comments-cell { padding-top: 8px; }
    /* height:100% from Bootstrap h-100 resolves to 0 in block layout — override on mobile */
    .controls-section .comments-cell .h-100 { padding: 0 !important; height: auto !important; }
    .controls-section .comments-cell textarea {
        width: 100%;
        display: block;
        box-sizing: border-box;
        margin: 0;
        min-height: 80px;
        height: auto !important;
    }

    /* Filter bar: ensure row gap when wrapping */
    .filter-bar { row-gap: 8px; }

    /* Restore comments div to normal flow (desktop uses position:absolute to fill the cell;
       that takes it out of flow on mobile causing overlap and clipping) */
    .controls-section .comments-cell > div {
        position: static;
        height: auto;
    }

    /* Let the page grow to fit all content on mobile */
    .page-body {
        overflow-y: auto;
    }

    /* Bottom breathing room so the last control card is never cut off */
    .controls-section .table tbody tr:last-child {
        margin-bottom: 32px;
    }

    /* Report page: ps-table → card-per-row on mobile */
    .ps-table thead { display: none !important; }
    .ps-table,
    .ps-table tbody { display: block; width: 100%; }
    .ps-table tr {
        display: block;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-bottom: 16px;
        padding: 12px 12px 16px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,.04);
    }
    .ps-table td {
        display: block;
        padding: 4px 0;
        border: none !important;
        width: 100%;
        box-sizing: border-box;
    }
    .ps-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.6875rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: #9ca3b8;
        margin-bottom: 2px;
    }
    .ps-table .ps-col-desc { word-break: normal; white-space: normal; }
    .ps-table .ps-col-src { display: none; }
    .ps-table .ps-col-comments { padding-top: 4px; }
    .ps-comment-body {
        font-size: 0.8125rem;
        color: #495057;
        line-height: 1.5;
    }

    /* Report page: wrap grids instead of crushing, scroll principle tables */
    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
    .mini-donut-grid { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
    .ps-table-wrap { overflow-x: auto; }
}

/* ─── Tablet layout (768px–1180px, compliance page): table preserved, columns adjusted + horizontal scroll ─── */
@media (min-width: 768px) and (max-width: 1180px) {
    html { overflow-x: hidden; }
    /* Report tracker: hidden by default, slides in as fixed overlay */
    .report-tracker {
        position: fixed;
        top: 52px;
        left: 0;
        height: calc(100vh - 52px);
        max-height: none;
        width: 0;
        overflow: hidden;
        z-index: 300;
        border-right: none;
        padding: 0;
        transition: width .25s ease;
    }
    .report-tracker.open {
        width: 260px;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 16px 12px;
        border-right: 1px solid #dee2e6;
    }
    .rt-toggle { display: flex; }
    .rt-close { display: flex; }
    .report-content { flex-basis: 100%; }
    .report-layout { overflow-x: clip; }

    /* Horizontal scroll instead of column crushing */
    .controls-section .table-responsive { overflow-x: auto; }

    /* Table expands to fill available width but never collapses below 620px */
    .controls-section .table {
        table-layout: fixed;
        width: 100%;
        min-width: 620px;
    }

    /* Code, Source, Observed, Comments get fixed widths;
       Control Description (no explicit width) absorbs the rest */
    .controls-section .table .col-1        { width: 80px; }
    .controls-section .table .src-col      { width: 120px; }
    .controls-section .table .col-3        { width: 100px; }
    .controls-section .table .comments-col { width: 120px; }

    /* Comments cell: static flow so rows grow with content instead of overflowing */
    .controls-section .comments-cell > div {
        position: static;
        height: auto;
    }
    .controls-section .comments-cell textarea.form-control {
        height: auto !important;
        min-height: 80px;
    }

    /* Report page: wrap grids instead of crushing, scroll principle tables */
    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
    .mini-donut-grid { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
    .ps-table-wrap { overflow-x: auto; }
    .ps-table .ps-col-src { display: none; }
}