:root {
  --portal-yellow: #ffc451;
  --portal-black: #000;
  --portal-white: #fff;
  --portal-ink: #171717;
  --portal-muted: #626262;
  --portal-line: #dedbd2;
  --portal-surface: #f7f6f1;
  --portal-soft: #fff7df;
  --portal-radius: 18px;
  --portal-shadow: 0 12px 34px rgba(0, 0, 0, .08);
  --ci: #ffc451;
  --yellow: #ffc451;
  --ink: #171717;
  --soft: #fff7df;
  --bs-warning: #ffc451;
  --bs-warning-rgb: 255, 196, 81;
  --bs-body-color: #171717;
  --bs-body-bg: #f7f6f1;
  --bs-border-radius: .75rem;
  color-scheme: light;
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; }
body.portal-ui {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 2%, rgba(255,196,81,.13), transparent 25rem),
    var(--portal-surface) !important;
  color: var(--portal-ink) !important;
  font-family: Inter, "Segoe UI", Arial, sans-serif !important;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.portal-ui a:not(.btn) { color: #191919; text-decoration-color: var(--portal-yellow); text-decoration-thickness: 2px; text-underline-offset: 3px; }
body.portal-ui a:not(.btn):hover { color: #000; text-decoration-color: #000; }
body.portal-ui h1, body.portal-ui h2, body.portal-ui h3 { color: #080808; font-weight: 780; letter-spacing: -.025em; line-height: 1.15; }
body.portal-ui header h1, body.portal-ui header h2, body.portal-ui header h3,
body.portal-ui .top h1, body.portal-ui .top h2, body.portal-ui .top h3,
body.portal-ui .topbar h1, body.portal-ui .topbar h2, body.portal-ui .topbar h3 { color: #fff !important; }
body.portal-ui h1 { font-size: clamp(2.25rem, 5vw, 4.9rem); margin-bottom: .6em; }
body.portal-ui h2 { font-size: clamp(1.55rem, 2.5vw, 2.35rem); }
body.portal-ui h3 { font-size: clamp(1.1rem, 1.7vw, 1.4rem); }
body.portal-ui p, body.portal-ui li { max-width: 78ch; }
body.portal-ui .lead { color: var(--portal-muted); font-size: clamp(1.08rem, 1.5vw, 1.3rem); }

body.portal-ui header,
body.portal-ui .top,
body.portal-ui .topbar {
  background: #000 !important;
  color: #fff !important;
  border: 0 !important;
  border-bottom: 5px solid var(--portal-yellow) !important;
  box-shadow: none !important;
}
body.portal-ui header > .container,
body.portal-ui .top > .container,
body.portal-ui .topbar > .container { min-height: 62px; }
body.portal-ui header a:not(.btn),
body.portal-ui .top a:not(.btn),
body.portal-ui .topbar a:not(.btn) { color: #fff !important; text-decoration-color: transparent; }
body.portal-ui header a:hover,
body.portal-ui header a:focus-visible,
body.portal-ui .top a:hover,
body.portal-ui .topbar a:hover { color: var(--portal-yellow) !important; text-decoration-color: var(--portal-yellow); }
body.portal-ui .brand,
body.portal-ui .portal-mini-brand,
body.portal-ui header strong {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
body.portal-ui .brand-favicon {
  width: 38px !important;
  height: 38px !important;
  object-fit: contain;
  flex: 0 0 38px;
  box-sizing: border-box;
  padding: 3px;
  border-radius: 9px;
  background: #fff;
}

body.portal-ui .brand-logo,
body.portal-ui .portal-logo {
  width: 64px !important;
  height: 60px !important;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  flex: 0 0 64px !important;
  background: transparent;
}

body.portal-ui .portal-mini-brand {
  margin: 0 0 1.75rem;
  padding: .55rem .85rem .55rem .6rem;
  border-radius: 12px;
  background: #000;
  color: #fff;
  width: fit-content;
}
body.portal-ui .portal-mini-brand .portal-logo { width: 32px !important; height: 32px !important; flex-basis: 32px; }

body.portal-ui main,
body.portal-ui .wrap,
body.portal-ui main.container { width: min(1440px, calc(100% - 40px)); margin-inline: auto; }
body.portal-ui main { padding-top: clamp(2rem, 5vw, 4.75rem); padding-bottom: 5rem; }
body.portal-ui .hero,
body.portal-ui .intro {
  position: relative;
  overflow: hidden;
  background: #fff !important;
  border: 1px solid var(--portal-line) !important;
  border-left: 8px solid var(--portal-yellow) !important;
  border-radius: var(--portal-radius) !important;
  padding: clamp(1.5rem, 4vw, 4rem) !important;
  box-shadow: var(--portal-shadow);
}
body.portal-ui .hero::after,
body.portal-ui .intro::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -110px;
  top: -125px;
  border-radius: 50%;
  background: var(--portal-yellow);
  opacity: .18;
  pointer-events: none;
}
body.portal-ui .kicker,
body.portal-ui .muted:first-child {
  color: #5b4700 !important;
  font-size: .77rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

body.portal-ui .panel,
body.portal-ui .card,
body.portal-ui .kpi,
body.portal-ui section.panel,
body.portal-ui .action-row,
body.portal-ui .criterion,
body.portal-ui .question {
  background: #fff !important;
  border: 1px solid var(--portal-line) !important;
  border-radius: var(--portal-radius) !important;
  box-shadow: 0 7px 24px rgba(0,0,0,.055) !important;
}
body.portal-ui .panel,
body.portal-ui section.panel { padding: clamp(1.25rem, 2.6vw, 2rem) !important; }
body.portal-ui .card { overflow: hidden; }
body.portal-ui .kpi { border-top: 5px solid var(--portal-yellow) !important; }
body.portal-ui .nav-tabs,
body.portal-ui .tabs,
body.portal-ui .module-tabs {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  border: 0 !important;
  padding: .6rem !important;
  margin: 0 0 1.5rem !important;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,.05);
}
body.portal-ui .nav-tabs a,
body.portal-ui .tabs a,
body.portal-ui .tabs button,
body.portal-ui .module-tabs a,
body.portal-ui .nav-link {
  border: 1px solid #d8d4ca !important;
  border-radius: 999px !important;
  padding: .62rem 1rem !important;
  background: #fff !important;
  color: #111 !important;
  text-decoration: none !important;
  font-weight: 650;
}
body.portal-ui .nav-tabs .active,
body.portal-ui .tabs .active,
body.portal-ui .tabs button.active,
body.portal-ui .module-tabs .active,
body.portal-ui .nav-link.active {
  background: #000 !important;
  color: var(--portal-yellow) !important;
  border-color: #000 !important;
}

body.portal-ui button,
body.portal-ui .btn,
body.portal-ui input,
body.portal-ui select,
body.portal-ui textarea { font: inherit; }
body.portal-ui button,
body.portal-ui .btn {
  min-height: 44px;
  border-radius: 10px !important;
  font-weight: 720;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
body.portal-ui button:hover,
body.portal-ui .btn:hover { transform: translateY(-1px); }
body.portal-ui .btn-dark,
body.portal-ui .btn-primary,
body.portal-ui button.primary,
body.portal-ui .primary {
  background: #000 !important;
  color: #fff !important;
  border-color: #000 !important;
}
body.portal-ui .btn-warning,
body.portal-ui .btn-ci,
body.portal-ui button.yellow {
  background: var(--portal-yellow) !important;
  color: #000 !important;
  border-color: #a87500 !important;
}
body.portal-ui .btn-outline-dark,
body.portal-ui .btn-outline-secondary,
body.portal-ui .btn-outline-primary { background: #fff !important; color: #000 !important; border-color: #000 !important; }
body.portal-ui input:not([type="radio"]):not([type="checkbox"]),
body.portal-ui select,
body.portal-ui textarea,
body.portal-ui .form-control,
body.portal-ui .form-select {
  min-height: 46px;
  border: 1px solid #bcb8ae !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #111 !important;
}
body.portal-ui input:focus,
body.portal-ui select:focus,
body.portal-ui textarea:focus,
body.portal-ui button:focus-visible,
body.portal-ui a:focus-visible {
  outline: 3px solid var(--portal-yellow) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #000 !important;
}
body.portal-ui label { color: #171717; }

body.portal-ui table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
body.portal-ui thead th {
  background: #000 !important;
  color: #fff !important;
  border: 0 !important;
  padding: .85rem 1rem !important;
  font-size: .91rem;
}
body.portal-ui thead th:first-child { border-radius: 10px 0 0 0; }
body.portal-ui thead th:last-child { border-radius: 0 10px 0 0; }
body.portal-ui td { padding: .9rem 1rem !important; border-bottom: 1px solid var(--portal-line) !important; vertical-align: top; }
body.portal-ui tbody tr:hover { background: var(--portal-soft); }
body.portal-ui .badge { border-radius: 999px; }
body.portal-ui .alert,
body.portal-ui .notice { border: 1px solid #d6a72c !important; border-left: 6px solid var(--portal-yellow) !important; border-radius: 12px !important; background: var(--portal-soft) !important; color: #2a220d !important; }
body.portal-ui .text-muted,
body.portal-ui .muted { color: var(--portal-muted) !important; }

body.portal-ui footer {
  margin-top: 4rem;
  padding: 2.25rem max(24px, calc((100vw - 1400px)/2));
  background: #000;
  color: #fff;
  border-top: 5px solid var(--portal-yellow);
}

@media (max-width: 900px) {
  body.portal-ui main, body.portal-ui .wrap, body.portal-ui main.container { width: min(100% - 24px, 1440px); }
  body.portal-ui header > .container, body.portal-ui .top > .container, body.portal-ui .topbar > .container { align-items: flex-start !important; flex-direction: column; gap: .75rem; }
  body.portal-ui header nav, body.portal-ui .top nav, body.portal-ui .topbar nav { flex-wrap: wrap; gap: .75rem !important; }
  body.portal-ui .table-responsive, body.portal-ui .tablewrap { overflow-x: auto; border-radius: 12px; }
}
@media (max-width: 620px) {
  body.portal-ui { font-size: 15px; }
  body.portal-ui h1 { font-size: clamp(2rem, 11vw, 3rem); }
  body.portal-ui main { padding-top: 1.4rem; }
  body.portal-ui .hero, body.portal-ui .intro, body.portal-ui .panel, body.portal-ui section.panel { padding: 1.15rem !important; border-radius: 14px !important; }
  body.portal-ui .brand, body.portal-ui header strong { font-size: .96rem; }
  body.portal-ui header .container > :last-child,
  body.portal-ui .top .container > :last-child,
  body.portal-ui .topbar .container > :last-child {
    width: 100%;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .55rem .8rem !important;
    align-items: center !important;
  }
  body.portal-ui header .container > :last-child .btn,
  body.portal-ui .top .container > :last-child .btn,
  body.portal-ui .topbar .container > :last-child .btn { margin-left: 0 !important; }
  body.portal-ui .brand-logo, body.portal-ui .portal-logo { width: 52px !important; height: 48px !important; flex-basis: 52px; background: transparent; }
}

@media print {
  body.portal-ui { background: #fff !important; }
  body.portal-ui header, body.portal-ui .top, body.portal-ui .topbar, body.portal-ui footer, body.portal-ui .float, body.portal-ui .back-to-top { display: none !important; }
  body.portal-ui .panel, body.portal-ui .card { box-shadow: none !important; break-inside: avoid; }
}

/* ==========================================================================
   Unified topbar (canonical header, matches index.html) — self-contained,
   does not require Bootstrap. Used identically across every page.
   ========================================================================== */
.topbar { background: #000 !important; border-bottom: 4px solid var(--ci); }
.topbar .container { display: flex !important; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 62px; padding-top: 10px; padding-bottom: 10px; }
/* Reset against page-level bare `a{...}` / `button,a{...}` selectors some
   standalone pages use for their own call-to-action links. */
.topbar a { margin: 0; }
.topbar .brand { display: flex !important; align-items: center; gap: 10px; text-decoration: none; color: #fff; background: transparent !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; font-weight: inherit !important; }
.topbar .brand-favicon { width: 32px; height: 32px; object-fit: contain; box-sizing: border-box; padding: 3px; border-radius: 7px; background: #fff; flex: 0 0 32px; }
.topbar .brand-copy { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; }
.topbar .brand-title { font-size: .95rem; font-weight: 400; letter-spacing: 0; color: #fff; }
.topbar .brand-copy .topbar-user { display: block; margin-top: 3px; font-size: .72rem; font-weight: 700; color: #fff; letter-spacing: .01em; white-space: nowrap; }
.topbar .brand-copy .topbar-user:empty { display: none; }
.topbar .brand-meta { margin-top: 1px; font-size: .67rem; font-weight: 400; color: #bdbdbd; letter-spacing: .01em; }
.topbar .ci { color: var(--ci); }
.topbar-actions { display: flex !important; align-items: center; gap: 14px; font-size: .85rem; flex-wrap: wrap; }
/* Reset against page-level bare `a{...}` / `button,a{...}` selectors some
   standalone pages use for their own call-to-action links. */
.topbar-actions a:not(.btn) { background: transparent !important; padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; font-weight: inherit !important; color: #fff !important; text-decoration: none; display: inline-flex !important; align-items: center; gap: 6px; position: relative; white-space: nowrap; }
.topbar-actions a.btn { position: relative; }
.topbar-actions a:not(.btn):hover, .topbar-actions a:not(.btn):focus-visible { color: var(--ci) !important; }
.topbar-actions svg { width: 15px; height: 15px; flex: 0 0 15px; }
.topbar-badge { position: absolute; top: -7px; right: -11px; background: #dc3545; color: #fff; border-radius: 999px; font-size: .62rem; line-height: 1; padding: 3px 5px; display: none; font-weight: 700; }
.topbar-actions{position:relative}.topbar-chat-menu{position:absolute;z-index:1200;top:42px;right:90px;min-width:250px;padding:8px;background:#fff!important;border:1px solid #8b8170;border-radius:12px;box-shadow:0 12px 32px #0003;color:#111!important}.topbar-chat-menu[hidden]{display:none!important}.topbar .topbar-chat-menu a:not(.btn){display:flex!important;justify-content:space-between!important;gap:16px!important;padding:10px 12px!important;background:#fff!important;color:#111!important;-webkit-text-fill-color:#111!important;border-radius:8px!important;font-weight:700!important}.topbar .topbar-chat-menu a:not(.btn):hover,.topbar .topbar-chat-menu a:not(.btn):focus-visible{background:#ffe39a!important;color:#000!important;-webkit-text-fill-color:#000!important;outline:2px solid #111!important;outline-offset:-2px}.topbar-chat-menu a span{min-width:25px;text-align:center;border-radius:99px;background:#c82333;color:#fff!important;-webkit-text-fill-color:#fff!important;font-weight:800;padding:2px 7px}
.topbar-badge.is-visible { display: inline-block; }
.topbar-logout { background: transparent; border: 1px solid #fff; color: #fff; border-radius: 7px; padding: .4rem .75rem; font-size: .83rem; cursor: pointer; font-weight: 700; font-family: inherit; }
.topbar-logout:hover { background: #fff; color: #000; }
@media (max-width: 760px) {
  .topbar .container { flex-direction: column; align-items: flex-start; }
  .topbar-actions { width: 100%; }
}
@media print { .topbar { display: none !important; } }
.portal-legal-footer{display:flex;justify-content:center;align-items:center;gap:12px;flex-wrap:wrap;padding:20px 16px;margin-top:28px;border-top:1px solid #d7dee3;background:#fff;color:#56606b;font-size:.875rem}.portal-legal-footer a{color:#17324d;text-decoration:underline;text-underline-offset:3px}.portal-legal-footer a:focus-visible{outline:3px solid #ffc451;outline-offset:3px}
.portal-legal-footer-inline{margin-top:16px;padding:16px 0 0;border-top:1px solid #555;background:transparent;color:inherit}.portal-legal-footer-inline a{color:inherit}
body.portal-ui footer.portal-legal-footer{border-top:1px solid #d7dee3;background:#fff;color:#56606b}
