:root {
  --navy: #0f1f4b;
  --text: #1f2a44;
  --muted: #5b6782;
  --line: #e6eaf2;
  --bg: #f7f9fc;
  --white: #ffffff;
  --brand: #1d63d8;
  --brand-soft: #e7f0fd;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 72, .04), 0 6px 18px rgba(16, 32, 72, .05);

  /* card themes: accent, icon background, soft wash */
  --blue: #1660d4;    --blue-icon: #9cc4f7;   --blue-wash: #eaf2fe;
  --green: #0f9a5a;   --green-icon: #8ddcb0;  --green-wash: #e7f7ee;
  --purple: #7347e0;  --purple-icon: #c7b4f6; --purple-wash: #f1ecfd;
  --orange: #ef7d16;  --orange-icon: #fbc391; --orange-wash: #fff1e5;
  --teal: #0e7c86;    --teal-icon: #8fd6d6;   --teal-wash: #e5f6f6;
  --pink: #e64a7b;    --pink-icon: #f6a9c1;   --pink-wash: #fdebf1;
  --indigo: #3949ab;  --indigo-icon: #b4bcf0; --indigo-wash: #eceffd;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 72px; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 40px; width: auto; display: block; }

.topbar-right { display: flex; align-items: center; gap: 22px; }

.icon-btn { position: relative; border: 0; background: none; padding: 6px; color: #34405c; display: inline-flex; }
.icon-btn svg { width: 22px; height: 22px; }
.user { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--text); padding: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--white); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.user-name { font-size: 14px; font-weight: 500; }
.user .chev { width: 16px; height: 16px; color: #6b7590; }
.menu-toggle { display: none; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: calc(100vh - 72px); }
.sidebar {
  width: 238px; flex-shrink: 0; padding: 22px 12px;
  background: var(--white); border-right: 1px solid var(--line);
}
.nav-item {
  display: flex; align-items: center; gap: 16px;
  height: 43px; padding: 0 16px; margin-bottom: 2px;
  border-radius: 10px; font-size: 14.5px; font-weight: 500; color: #2a3550;
}
.nav-item svg { width: 21px; height: 21px; color: #3a4662; }
.nav-item svg.filled { fill: currentColor; stroke: none; }
.nav-item:hover { background: #f2f5fb; }
.nav-item.active { background: var(--brand-soft); color: var(--navy); }
.nav-item.active svg { color: var(--brand); }
.sidebar hr { border: 0; border-top: 1px solid var(--line); margin: 18px 12px 26px; }

.main { flex: 1; min-width: 0; padding: 22px 22px 40px 22px; }

/* ---------- portals ---------- */
.portals { padding: 4px 4px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--navy); }
.section-head p { margin: 0; font-size: 13.5px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.card {
  position: relative; overflow: hidden;
  padding: 20px 24px 26px; min-height: 262px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card::after { /* soft corner wash, as in the design */
  content: ""; position: absolute; right: -60px; bottom: -90px; width: 230px; height: 200px;
  border-radius: 50%; background: var(--wash); opacity: .9; pointer-events: none;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16,32,72,.05), 0 14px 30px rgba(16,32,72,.09); }
.card > * { position: relative; z-index: 1; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.card-icon { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--icon-bg); color: var(--accent); }
.card-icon svg { width: 30px; height: 30px; stroke-width: 1.7; }
.card-chevron {
  width: 36px; height: 36px; margin-top: 4px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.7); color: var(--navy); display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(16,32,72,.08);
}
.card-chevron svg { width: 18px; height: 18px; stroke-width: 2.2; }
.card h3 { margin: 22px 0 8px; font-size: 19px; font-weight: 700; color: var(--navy); }
.card p { margin: 0 0 22px; font-size: 14.2px; line-height: 1.65; color: #4b5672; max-width: 280px; }
.go {
  margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--white); font-size: 14px; font-weight: 600;
}
.go svg { width: 17px; height: 17px; stroke-width: 2.2; transition: transform .15s ease; }
.go:hover svg { transform: translateX(3px); }
.go:hover { filter: brightness(1.05); }

.theme-blue   { --accent: var(--blue);   --icon-bg: var(--blue-icon);   --wash: var(--blue-wash); }
.theme-green  { --accent: var(--green);  --icon-bg: var(--green-icon);  --wash: var(--green-wash); }
.theme-purple { --accent: var(--purple); --icon-bg: var(--purple-icon); --wash: var(--purple-wash); }
.theme-orange { --accent: var(--orange); --icon-bg: var(--orange-icon); --wash: var(--orange-wash); }
.theme-teal   { --accent: var(--teal);   --icon-bg: var(--teal-icon);   --wash: var(--teal-wash); }
.theme-pink   { --accent: var(--pink);   --icon-bg: var(--pink-icon);   --wash: var(--pink-wash); }
.theme-indigo { --accent: var(--indigo); --icon-bg: var(--indigo-icon); --wash: var(--indigo-wash); }
.theme-indigo .card-icon { color: #283593; }
.theme-blue .card-icon, .theme-purple .card-icon { color: var(--white); }
.theme-green .card-icon { color: #0b6b3f; }
.theme-orange .card-icon { color: #b85a06; }
.theme-teal .card-icon { color: #075e66; }
.theme-pink .card-icon { color: #b0244f; }
.card { background: linear-gradient(160deg, var(--white) 55%, color-mix(in srgb, var(--wash) 60%, white) 100%); }

/* ---------- inner pages (Profile, Authorisations, Audits) ---------- */
[hidden] { display: none !important; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 4px 4px 14px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -.3px; }
.page-head p { margin: 0; color: var(--muted); font-size: 14.5px; }
.page-actions { display: flex; gap: 10px; flex-shrink: 0; }
.sample-note {
  margin: 0 4px 18px; padding: 10px 14px; border-radius: 10px;
  background: #fff8e6; border: 1px solid #f6dfa4; color: #7a5a00; font-size: 13px;
}
.muted { color: var(--muted); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin: 0 4px 18px; }
.panel h3 { margin: 0 0 12px; font-size: 15.5px; color: var(--navy); }
.section-head.between { align-items: flex-end; margin: 26px 4px 14px; }
.section-head.between h2 { margin-bottom: 4px; }
.section-head a { color: var(--brand); font-weight: 600; }

.btn { height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font-size: 14px; font-weight: 600; white-space: nowrap; }
.btn.primary { background: var(--brand); color: var(--white); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.ghost { background: var(--white); border-color: var(--line); color: var(--text); }
.btn.ghost:hover:not(:disabled) { background: #f2f5fb; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }

.profile-card { display: flex; align-items: center; gap: 18px; }
.profile-card h2 { margin: 0 0 2px; font-size: 19px; color: var(--navy); }
.profile-card p { margin: 0; font-size: 13.5px; }
.profile-card .badge { margin-left: auto; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; flex-shrink: 0; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; font-weight: 600; font-size: 13.5px; color: var(--navy); }
.person small { color: var(--muted); font-size: 12px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.role-admin { background: #e7f0fd; color: #1450b8; }
.role-member { background: #eef1f6; color: #3d4966; }
.status-active { background: #e3f6ec; color: #0b7a45; }
.status-pending { background: #fff3dc; color: #9a6400; }
.status-disabled { background: #fde8e8; color: #b42318; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 0 4px 18px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 13px; color: var(--muted); box-shadow: var(--shadow); }
.stat span { display: block; font-size: 24px; font-weight: 800; color: var(--navy); margin-bottom: 2px; }
.stat[class*="theme-"] { border-top: 3px solid var(--accent); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar input, .toolbar select, .modal input, .modal select {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 13.5px; color: var(--text); background: var(--white);
}
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.table tbody tr:hover { background: #fafbfe; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn + .btn { margin-left: 6px; }
.empty { text-align: center; color: var(--muted); padding: 26px; }
.nowrap { white-space: nowrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }

/* authorisation levels */
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin: 0 4px 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.lvl { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.lvl-no { background: #eef1f6; } .lvl-viewer { background: #dbe9fd; } .lvl-user { background: #d5f2e2; } .lvl-admin { background: #e7dcfb; }
.matrix th:not(:first-child), .matrix td:not(:first-child) { text-align: center; }
.matrix th, .matrix td { padding-left: 8px; padding-right: 8px; }
.matrix th { font-size: 11px; letter-spacing: .2px; white-space: normal; min-width: 92px; line-height: 1.3; }
.matrix th .dot { display: block; margin: 0 auto 5px; }
.matrix td:first-child, .matrix th:first-child { position: sticky; left: 0; background: var(--white); z-index: 1; white-space: nowrap; min-width: 190px; }
.matrix tbody tr:hover td:first-child { background: #fafbfe; }
.lvl-select { height: 32px; border-radius: 8px; border: 1px solid transparent; padding: 0 8px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.lvl-select.lvl-no { color: #6b7590; } .lvl-select.lvl-viewer { color: #1450b8; } .lvl-select.lvl-user { color: #0b7a45; } .lvl-select.lvl-admin { color: #5b2fc0; }

/* audits */
.audit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 34px; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.bar-track { height: 10px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent, var(--brand)); border-radius: 999px; }
.bar-n { text-align: right; font-weight: 600; color: var(--navy); }

/* sign-in / setup */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, #f2f7fd, #e9f1fb); }
.auth-card { width: min(420px, 100%); background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 30px 30px 24px; box-shadow: 0 20px 50px rgba(16,32,72,.10); }
.auth-logo { display: block; height: 46px; width: auto; margin: 0 auto 18px; }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; color: var(--navy); text-align: center; }
.auth-card > p { margin: 0 0 20px; text-align: center; font-size: 13.5px; }
.auth-card label, .form-grid label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.auth-card input, .form-grid input {
  display: block; width: 100%; margin-top: 5px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; color: var(--text);
}
.auth-card input:focus, .form-grid input:focus, .modal input:focus, .modal select:focus { outline: 2px solid #b7cdf3; outline-offset: 0; border-color: #b7cdf3; }
.btn.block { width: 100%; height: 42px; margin-top: 6px; }
.form-error { color: #b42318; font-size: 13px; min-height: 18px; margin-top: 8px; }

/* account menu */
.user-wrap { position: relative; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; width: 230px;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 14px 34px rgba(16,32,72,.14);
}
.user-menu-head { padding: 10px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu-head b { display: block; font-size: 14px; color: var(--navy); }
.user-menu-head small { color: var(--muted); font-size: 12px; word-break: break-all; }
.user-menu a, .user-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 8px; font-size: 13.5px; color: var(--text); }
.user-menu a:hover, .user-menu button:hover { background: #f2f5fb; }
.user-menu .danger { color: #b42318; }

/* profile form */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.form-actions .form-error { margin: 0 auto 0 0; }
.btn.danger { background: #fff; border-color: #f3c5c5; color: #b42318; }
.btn.danger:hover { background: #fdecec; }
.row-off td { opacity: .55; }
.empty-state { text-align: center; color: var(--muted); grid-column: 1 / -1; padding: 30px; }
.info-note { margin: 0 4px 18px; padding: 10px 14px; border-radius: 10px; background: #eef5ff; border: 1px solid #cfe0fb; color: #1d4b8f; font-size: 13px; }
.pw-row { display: flex; gap: 8px; margin-top: 5px; }
.pw-row input { margin-top: 0 !important; font-family: ui-monospace, Consolas, monospace; letter-spacing: .3px; }
.share-box { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: #f6f8fc; border: 1px solid var(--line); }
.share-box small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.share-box b { font-size: 14.5px; color: var(--navy); word-break: break-all; }
#sharePw { font-family: ui-monospace, Consolas, monospace; font-size: 16px; }
.modal small.muted { display: block; font-weight: 400; margin-top: 4px; font-size: 12px; }

/* "Add person" with portal access (Authorisations) */
.modal:has(form.wide) { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
form.wide .pw-row { max-width: 100%; }
.access-pick { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 4px 0 6px; }
.access-pick legend { font-size: 13px; font-weight: 700; color: var(--navy); padding: 0 6px; }
.access-pick legend small { font-weight: 400; }
.modal .access-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 6px 0; border-bottom: 1px solid #eef1f6; font-weight: 500; }
.modal .access-row select { width: 150px; margin-top: 0; height: 34px; }
.access-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }

/* Authorisations: real portal levels, check result */
.lvl-select.lvl-lead { color: #9a5b00; background: #fff1dc; }
.lvl-select.lvl-no { background: #f2f4f8; } .lvl-select.lvl-viewer { background: #e4eefd; } .lvl-select.lvl-user { background: #dff4e8; } .lvl-select.lvl-admin { background: #ece4fc; }
.lvl-chip { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.lvl-chip.lvl-admin { background: #ece4fc; color: #5b2fc0; } .lvl-chip.lvl-lead { background: #fff1dc; color: #9a5b00; }
.nopw { color: #9a6400; font-weight: 600; }
.tmppw { color: #1d63d8; font-weight: 600; }
.theme-qcp { --accent: #1aa39a; }
.link-btn { display: block; margin-top: 2px; padding: 0; border: 0; background: none; color: var(--brand); font-size: 12px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.row-links { display: flex; gap: 12px; }
.row-links .link-btn { display: inline; }
.link-btn.danger-link { color: #b42318; }
.small-text { font-size: 13px; margin: 0 0 10px; }
.check-ok { border-left: 4px solid #12a150; }
.check-bad { border-left: 4px solid #d97706; }
.page-actions .btn { white-space: nowrap; }
.person .pick, .pick-all input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); cursor: pointer; flex: none; }
.pick-all { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.pick-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow: auto; }
.pick-list .chip { padding: 3px 9px; border-radius: 8px; background: #eef2f8; font-size: 12.5px; }
.modal:has(.pw-list) { width: min(680px, 100%); }
.pw-list { max-height: 50vh; overflow: auto; }
.pw-list code { font-size: 13.5px; font-weight: 600; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 60; transform: translate(-50%, 16px);
  padding: 10px 16px; border-radius: 10px; background: var(--navy); color: var(--white);
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #b42318; }

/* dialog */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(15, 31, 75, .35); display: grid; place-items: center; padding: 16px; }
.modal { width: min(440px, 100%); background: var(--white); border-radius: 16px; padding: 22px 24px; box-shadow: 0 24px 60px rgba(16,32,72,.25); }
.modal h3 { margin: 0 0 2px; font-size: 18px; color: var(--navy); }
.modal p { margin: 0 0 14px; font-size: 13px; }
.modal label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.modal input, .modal select { display: block; width: 100%; margin-top: 5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Audits & Activity ---------- */
.aud-filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.aud-filters label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 150px; }
.aud-filters label[hidden] { display: none; }
.aud-filters .aud-search { flex: 1; min-width: 220px; }
.aud-filters select, .aud-filters input { height: 38px; }
.aud-filters .aud-person-sel { min-width: 260px; }
.aud-person { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; background: linear-gradient(90deg, var(--brand-soft), var(--white) 70%); }
.aud-person-text { flex: 1; min-width: 200px; }
.aud-person h2 { margin: 0; font-size: 19px; color: var(--navy); }
.aud-person p { margin: 2px 0 0; font-size: 13px; }
/* KPI cards */
.aud-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 4px 18px; }
.aud-kpi { position: relative; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 12px; box-shadow: var(--shadow); }
.aud-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--k); }
.aud-kpi span { display: block; font-size: 26px; font-weight: 800; color: var(--k); line-height: 1.1; }
.aud-kpi b { display: block; font-size: 12.5px; color: var(--navy); margin-top: 4px; }
.aud-kpi small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
/* charts */
.aud-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; margin: 0 4px; }
.aud-grid .panel { margin: 0 0 18px; min-width: 0; }
.aud-grid .aud-wide { grid-column: 1 / -1; }
.aud-chart { min-height: 120px; }
.aud-svg { width: 100%; height: auto; display: block; }
/* the site's icon style outlines every svg shape — charts are filled shapes and plain text */
.aud-svg rect, .aud-svg text, .aud-donut text { stroke: none; }
.aud-donut path { stroke: var(--white); stroke-width: 2; }
.aud-svg text, .aud-donut text { font-weight: 500; }
.aud-svg .grid { stroke: #eef1f6; stroke-width: 1; }
.aud-svg .axis, .aud-donut .axis { font-size: 11px; fill: var(--muted); }
.aud-svg rect, .aud-donut path, [data-aud-portal], [data-aud-person] { cursor: pointer; }
.aud-svg rect:hover, .aud-donut path:hover { opacity: .8; }
.aud-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--text); }
.aud-legend span { display: inline-flex; align-items: center; gap: 6px; }
.aud-legend i, .aud-donut-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.aud-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.aud-donut { width: 180px; height: 180px; flex: none; }
.aud-donut path.dim { opacity: .25; }
.aud-donut .donut-n { font-size: 22px; font-weight: 800; fill: var(--navy); }
.aud-donut-legend { flex: 1; min-width: 180px; display: grid; gap: 4px; }
.aud-donut-legend div { display: grid; grid-template-columns: 12px 1fr auto 42px; align-items: center; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 7px; }
.aud-donut-legend div:hover, .aud-donut-legend div.on { background: #f2f5fa; }
.aud-donut-legend b { color: var(--navy); }
.aud-donut-legend small { color: var(--muted); text-align: right; }
.aud-bars { display: grid; gap: 10px; }
.aud-bar { display: grid; gap: 4px; }
.aud-bar[data-aud-person]:hover .aud-bar-label span { color: var(--brand); text-decoration: underline; }
.aud-bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.aud-bar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aud-bar-label b { color: var(--navy); }
.aud-bar-track { display: flex; height: 10px; background: #f0f3f8; border-radius: 999px; overflow: hidden; }
.aud-bar-track i { display: block; height: 100%; }
.aud-hint { margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.aud-empty { padding: 30px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.aud-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); }
.aud-table td { vertical-align: top; }
.aud-table small { line-height: 1.5; }
.aud-who { color: var(--brand); font-weight: 600; text-decoration: none; }
.aud-who:hover { text-decoration: underline; }
.aud-links { white-space: nowrap; }
.aud-links .btn { margin: 0 4px 4px 0; }
.aud-more { text-align: center; padding-top: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .aud-filters label { min-width: calc(50% - 8px); }
  .aud-filters .aud-search, .aud-filters .aud-person-sel { min-width: 100%; }
  .aud-grid { grid-template-columns: minmax(0, 1fr); }
  .aud-donut { width: 150px; height: 150px; }
  .topbar { padding: 0 16px; }
  .brand-logo { height: 32px; }
  .user-name, .user .chev { display: none; }
  .topbar-right { gap: 12px; }
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: 72px; left: 0; bottom: 0; z-index: 15;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: 4px 0 20px rgba(16,32,72,.08);
  }
  body.nav-open .sidebar { transform: none; }
  .main { padding: 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .section-head { flex-direction: column; gap: 4px; }
  .section-head.between { align-items: flex-start; gap: 10px; }
  .page-head { flex-direction: column; }
  .audit-grid { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: 110px 1fr 30px; }
  .profile-card { flex-wrap: wrap; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-actions { flex-wrap: wrap; }
  .row-actions { white-space: normal; }
  .row-actions .btn { margin: 2px 0; }
}
.aud-start { margin: -8px 6px 14px; }
