/* CSYS: shared workspace finish. No operational states or data are changed. */
:root {
    --csys-sidebar-width: 280px;
    --csys-nav-bg: #101c2d;
    --csys-nav-text: #c6d0df;
    --csys-nav-muted: #8a9ab0;
    --csys-nav-accent: #86b2ff;
    --csys-ink: #162842;
    --csys-line: #e1e7f0;
    --csys-canvas: #f3f5f9;
    --csys-brand-halo: radial-gradient(ellipse at 38% 48%, #438cf314 0, #438cf306 36%, transparent 65%);
    --csys-brand-glow: drop-shadow(0 0 3px #a6ccff12);
}
html, body { background: var(--csys-canvas); }
.csys-sidebar { border-right: 1px solid #0b1524; box-shadow: 8px 0 28px #1425410a; }
.csys-sidebar-header { min-height: 72px; justify-content: center; padding: 16px 0; border-bottom: 0; overflow: hidden; isolation: isolate; }
.csys-sidebar-header::before { content: ''; pointer-events: none; position: absolute; z-index: 0; width: 240px; height: 110px; left: -5px; top: 0; background: var(--csys-brand-halo); }
.csys-sidebar-header::after { content: ''; pointer-events: none; position: absolute; width: 93px; height: 93px; border: 1px solid #b6d0ff0c; border-radius: 22px; transform: rotate(-24deg); right: -41px; bottom: -53px; }
.csys-brand { width: 204px; flex: 0 0 204px; flex-direction: row; align-items: center; gap: 8px; position: relative; z-index: 1; }
.csys-brand-logo { width: 128px; flex: 0 0 128px; filter: var(--csys-brand-glow); }
.csys-sidebar-toggle, .csys-sidebar-mobile-toggle { z-index: 2; }
.csys-brand-caption { display: block; box-sizing: border-box; flex: 0 0 68px; min-width: 0; max-width: 68px; padding-left: 8px; border-left: 1px solid #b6d0ff38; font-size: 10px; line-height: 1.5; color: #c0cfe3; letter-spacing: .08em; }
.csys-sidebar-toggle { right: 5px; width: 28px; min-width: 28px; background: #ffffff05; color: #a6b8d2; border-color: #ffffff0c; }
.csys-nav-search { margin: 8px 18px 8px; }
.csys-nav-search input { height: 40px; background: #ffffff06; border-color: #ffffff13; border-radius: 9px; font-size: 12.5px; }
.csys-nav-search > svg { top: 12px; }
.csys-nav-section + .csys-nav-section { margin-top: 17px; }
.csys-sidebar .csys-section-title { display: flex; align-items: center; gap: 10px; margin: 15px 25px 8px; font-size: 9.5px; letter-spacing: .15em; color: #879bb9; }
.csys-sidebar .csys-section-title::after { content: ''; flex: 1; height: 1px; background: #ffffff0b; }
.csys-sidebar .nav-link, .csys-nav-group summary { min-height: 43px; padding: 6px 10px; margin: 3px 15px; gap: 11px; border-radius: 9px; font-size: 13.5px; font-weight: 500; }
.csys-sidebar .nav-link-icon { width: 29px; height: 29px; flex-basis: 29px; border-radius: 7px; background: #ffffff04; color: #9bafcb; }
.csys-sidebar .nav-link-icon svg { width: 18px; height: 18px; }
.csys-sidebar .nav-link:hover, .csys-nav-group summary:hover { background: #ffffff08; }
.csys-sidebar .nav-link.active { color: #172f52; background: #f0f5ff; border-color: #fff; box-shadow: 0 3px 12px #040d1d28; font-weight: 650; }
.csys-sidebar .nav-link.active::before { display: none; }
.csys-sidebar .nav-link.active .nav-link-icon { color: #275bb0; background: #dfeaff; }
.csys-nav-group details[open] > summary { background: #ffffff04; }
.csys-nav-group details:has(.nav-link.active) > summary { color: #eaf1fc; }
.csys-group-arrow { margin-right: 3px; }
.csys-group-links { margin: 5px 16px 8px 38px; padding-left: 11px; border-color: #9bb1d52b; }
.csys-sidebar .csys-group-links .nav-link { margin: 3px 0; min-height: 36px; padding: 8px 10px; font-size: 12.5px; font-weight: 450; border-radius: 7px; }
.csys-sidebar .csys-group-links .nav-link-icon { display: none; }
.csys-nav-footer { background: #0b162680; padding: 16px 25px; color: #8298b8; }
.csys-nav-footer strong { color: #bbcae0; }
.csys-mobile-account { display: none; }

.csys-topbar { border-bottom-color: #dfe6ef; box-shadow: 0 3px 14px #142f5007; }
.csys-topbar-inner { min-height: 72px; padding-inline: 28px; }
.csys-topbar-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.csys-context-mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: 0 0 38px; color: #eef4ff; border: 1px solid #294362; background: #1c3555; border-radius: 11px; box-shadow: 0 3px 8px #1c355518; }
.csys-topbar-context { display: grid; align-content: center; gap: 3px; min-width: 0; max-width: 100%; }
.csys-topbar-kicker { font-size: 9px; line-height: 1.3; color: #6c7f97; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csys-context-separator { display: none; }
.csys-topbar-title { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.025em; line-height: 1.3; color: #203b5e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csys-topbar-user { gap: 11px; padding-left: 0; border-left: 0; }
body:not(.csys-portal) .csys-topbar-user, body.csys-portal .csys-portal-account-dropdown { padding: 7px 10px 7px 8px; border: 1px solid #e0e7f0; border-radius: 12px; background: #f8fafd; box-shadow: 0 2px 5px #1d355706; }
.csys-user-symbol { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid #d4e1f2; border-radius: 10px; color: #315986; background: #eaf1fb; }
.csys-user-block { text-align: left; min-width: 0; }
.csys-user-name { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2d4564; font-weight: 650; font-size: 12px; line-height: 1.3; }
.csys-user-role { display: inline-block; width: fit-content; max-width: 200px; margin-top: 4px; padding: 3px 6px; border: 1px solid #dce5f0; border-radius: 4px; background: #edf2f8; color: #526b8b; font-size: 8px; font-weight: 650; letter-spacing: .08em; line-height: 1; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csys-topbar-user > .btn { min-height: 34px; margin-left: 4px; padding: 6px 10px; border-color: #dce5ef; border-radius: 7px; color: #526b89; background: #fff; font-size: 11px; }
.csys-topbar-user > .btn:hover { border-color: #b9cbe2; background: #eef3fa; color: #203b5e; }
.csys-topbar-user > .btn:focus-visible { outline: 2px solid #557cb4; outline-offset: 3px; }

/* Shared page chrome only; monitoring and TV card states remain untouched. */
.page-wrapper > .page-header { margin-top: 30px; margin-bottom: 0; }
.page-header :is(.page-title, .csys-page-title) { color: var(--csys-ink); font-size: clamp(25px, 2.3vw, 30px); font-weight: 650; letter-spacing: -.045em; line-height: 1.2; }
.page-header :is(.page-pretitle, .csys-page-eyebrow) { color: #60718a; font-size: 9.5px; font-weight: 650; letter-spacing: .13em; line-height: 1.5; margin-bottom: 7px; }
.page-header :is(.text-secondary, p) { font-size: 13px; line-height: 1.6; margin-top: 7px; }
.page-header :is(.text-secondary, .csys-page-subtitle) { color: #60718a; }
.page-header .container-xl { padding-bottom: 25px; border-bottom: 1px solid #dfe6f0; }
.page-header .btn { font-size: 12px; font-weight: 600; min-height: 38px; border-radius: 8px; box-shadow: 0 2px 3px #1a335408; }
.page-header :is(.btn-primary, .cc-agenda-main) { background: #234876; border-color: #234876; color: #fff; box-shadow: 0 3px 8px #2348761c; }
.page-header :is(.btn-primary, .cc-agenda-main):hover { background: #19395f; border-color: #19395f; }
.page-header .btn:not(:is(.btn-primary, .cc-agenda-main, .btn-danger, .btn-warning, .btn-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-success)) { border-color: #dce4ef; color: #4a617e; background: #fff; }
.page-body > .container-xl > .card:not([class*="border-"]) { border-color: var(--csys-line); border-radius: 12px; box-shadow: 0 4px 12px #263e6207; }
.page-body > .container-xl > .card > .card-header { min-height: 62px; padding: 18px 22px; border-bottom-color: #e8edf4; background: #fff; }
.page-body > .container-xl > .card > .card-body { padding: 22px; }
.page-body > .container-xl > .card > :is(.card-header,.card-body) > .card-title { color: #29415f; font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.page-body > .container-xl > .card :is(.form-control, .form-select):not(.is-invalid):not(.is-valid):not(.was-validated *) { border-color: #dce4ef; border-radius: 8px; box-shadow: 0 1px 2px #213a5804; font-size: 14px; }
.page-body > .container-xl > .card .form-label { color: #405673; font-weight: 550; font-size: 12px; margin-bottom: 9px; }
.page-body > .container-xl > .card :is(.form-control, .form-select):not(.is-invalid):not(.is-valid):not(.was-validated *):focus { border-color: #87a7d3; box-shadow: 0 0 0 3px #356fba12; }
.page-body > .container-xl > .card > .card-footer { background: #f9fbfd; border-top-color: #e8edf4; }
.page-wrapper.cc-agenda .cc-agenda-metric { border-color: #e0e7f1; border-radius: 12px; box-shadow: 0 4px 12px #20385a06; padding: 18px 20px; gap: 14px; }
.page-wrapper.cc-agenda .cc-agenda-metric-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 11px; }
.page-wrapper.cc-agenda .cc-agenda-metric-copy { gap: 5px; }
.page-wrapper.cc-agenda .cc-agenda-metric-copy strong { color: #203958; font-weight: 600; }
.page-wrapper.cc-agenda .cc-agenda-metric-copy small { color: #64748b; }
.page-wrapper.cc-agenda .cc-agenda-tabs { margin-top: 7px; gap: 13px; border-bottom-color: #dfe6f0; }
.page-wrapper.cc-agenda .cc-agenda-tabs a { color: #60718a; font-size: 12px; font-weight: 500; padding: 13px 3px; border-bottom-width: 2px; }
.page-wrapper.cc-agenda .cc-agenda-tabs a[aria-current=page] { color: #244f85; font-weight: 650; border-color: #315f9c; }
.page-wrapper.cc-agenda .cc-agenda-panel { border-color: #e0e7f1; border-radius: 12px; box-shadow: 0 4px 12px #20385a06; }
.page-wrapper.cc-agenda .cc-agenda-panel-head { padding: 22px 22px 15px; }
.page-wrapper.cc-agenda .cc-agenda-panel-head h3 { color: #29415f; font-size: 16px; font-weight: 600; letter-spacing: -.025em; }
.page-wrapper.cc-agenda .cc-agenda-panel-head p { color: #64748b; font-size: 12px; margin-top: 6px; }
.page-wrapper.cc-agenda .cc-agenda-calendar { padding: 10px 22px 22px; }
.page-wrapper.cc-agenda .cc-agenda-calendar .fc-toolbar-title { color: #2c4464; font-weight: 600; letter-spacing: -.025em; }
.page-wrapper.cc-agenda .cc-agenda-calendar .fc .fc-button-primary { background: #264b78; border-color: #264b78; border-radius: 6px; font-size: 12px; }

@media (min-width: 992px) {
    .csys-topbar { height: 72px; }
    .page-wrapper { padding-top: 72px; }
    .page-header .container-xl, .page-body .container-xl { padding-left: 28px; padding-right: 28px; }
    body.csys-sidebar-collapsed .csys-sidebar-header { min-height: 72px; }
    body.csys-sidebar-collapsed .csys-nav-search-toggle { margin-top: 8px; }
    body.csys-sidebar-collapsed .csys-sidebar-header::before { display: none; }
    body.csys-sidebar-collapsed .csys-sidebar-toggle { right: 26px; }
    body.csys-sidebar-collapsed .csys-sidebar .nav-link, body.csys-sidebar-collapsed .csys-nav-group summary { padding: 6px 4px; margin-inline: 13px; }
    body.csys-sidebar-collapsed .csys-nav-section { margin-top: 13px; }
    body.csys-sidebar-collapsed .csys-group-links .nav-link-icon { display: inline-flex; }
    body.csys-sidebar-collapsed .csys-group-links .nav-link { margin-inline: 13px; padding: 6px 4px; }
}
@media (max-width: 991.98px) {
    .csys-sidebar-header { min-height: 64px; padding: 14px 0; }
    .csys-sidebar-header::before { width: 205px; height: 88px; top: -10px; left: -9px; }
    .csys-brand-logo { width: 128px; }
    .csys-brand-caption { display: block; }
    .csys-topbar-inner { min-height: 62px; padding-inline: 18px; }
    .csys-context-mark { display: none; }
    .csys-topbar-context { gap: 3px; }
    .csys-topbar-kicker { font-size: 10px; }
    .csys-topbar-title { font-size: 14px; }
    .csys-user-symbol { display: none; }
    .csys-topbar-user { border: 0; padding-left: 0; }
    body:not(.csys-portal) .csys-topbar-user { display: none; }
    body:not(.csys-portal) .csys-topbar { display: none; }
    body:not(.csys-portal) .page-wrapper { padding-top: 0; }
    body:not(.csys-portal) .csys-topbar-user > a[href="/logout.php"] { display: none; }
    .csys-sidebar .csys-nav-footer { display: none; }
    .csys-mobile-account { display: block; flex: 0 0 auto; padding: 12px 18px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid #ffffff0c; background: #0b162680; }
    .csys-mobile-logout { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; border: 1px solid #ffffff18; border-radius: 8px; background: #ffffff04; color: #d5e0ee; font-size: 13px; font-weight: 550; text-decoration: none; }
    .csys-mobile-logout:hover { background: #ffffff0c; color: #fff; text-decoration: none; }
    .csys-mobile-logout svg { flex: 0 0 19px; }
    .csys-sidebar .nav-link, .csys-nav-group summary { min-height: 46px; font-size: 14px; }
    .csys-sidebar .csys-group-links .nav-link { min-height: 44px; }
    .page-wrapper > .page-header { margin-top: 25px; }
    .page-header .container-xl { padding-bottom: 21px; }
    .page-header .page-title { font-size: 27px; }
}
@media (max-width: 575px) {
    .csys-topbar-kicker, .csys-context-separator { display: none; }
    .csys-topbar-title { font-size: 14px; }
    .csys-topbar-inner { gap: 10px; }
    .csys-user-name { font-size: 11px; max-width: 112px; }
    .csys-user-role { font-size: 8px; max-width: 112px; }
    .csys-topbar-user > .btn { margin-left: 0; min-width: 44px; min-height: 36px; }
    .page-header .row { row-gap: 16px !important; }
    .page-header :is(.text-secondary,p) { font-size: 12px; }
    .page-wrapper.cc-agenda .cc-agenda-metric { padding: 13px; gap: 10px; }
    .page-wrapper.cc-agenda .cc-agenda-metric-icon { width: 33px; height: 33px; flex-basis: 33px; }
    .page-wrapper.cc-agenda .cc-agenda-tabs { gap: 9px; }
    .page-wrapper.cc-agenda .cc-agenda-tabs a { font-size: 11px; }
    .page-wrapper.cc-agenda .cc-agenda-calendar { padding-inline: 12px; }
}

/* Portal adapters: same visual tokens and navigation, tenant-specific content. */
body.csys-portal .page-wrapper { background: var(--csys-canvas); }
body.csys-portal .page-header { position: static; z-index: auto; }
body.csys-portal :is(.page-header,.page-body) > .container-fluid { width: 100%; max-width: 1800px; margin-inline: auto; padding-inline: 28px; }
body.csys-portal .page-header > .container-fluid { padding-bottom: 25px; border-bottom: 1px solid #dfe6f0; }
body.csys-portal .csys-dashboard-header { padding: 0; border: 0; align-items: center; }
body.csys-portal .csys-sidebar .nav-main-title { display: block; }
body.csys-portal .csys-sidebar .nav-description { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.csys-portal .csys-topbar { z-index: 1020; }
body.csys-portal .csys-portal-account { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 44px; text-decoration: none; }
body.csys-portal .csys-portal-account-dropdown { overflow: visible; }
body.csys-portal .csys-portal-account:focus-visible { outline: 2px solid #557cb4; outline-offset: 5px; border-radius: 6px; }
body.csys-portal .csys-portal-actions .btn-list { gap: 7px; }
body.csys-portal .csys-topbar-action { border-radius: 7px; font-size: 11px; }
body.csys-portal .csys-topbar-action.btn-primary { background: #234876; border-color: #234876; }
body.csys-portal .csys-topbar-action:not(.btn-primary) { border-color: #e1e7f0; color: #546b89; background: #fff; }
body.csys-portal .csys-portal-account-dropdown .dropdown-menu { min-width: 220px; border: 1px solid var(--csys-line); border-radius: 10px; box-shadow: 0 12px 35px #152a4a17; }
body.csys-portal .page-wrapper :is(.csys-panel,.csys-kpi-card) { border-radius: 12px; box-shadow: 0 4px 12px #263e6207; }
body.csys-portal .page-wrapper .csys-panel > .card-header { background: #fff; border-bottom-color: #e8edf4; }
body.csys-portal .page-header .csys-client-action { border-radius: 8px; min-height: 38px; border-color: #dce4ef; box-shadow: 0 2px 3px #1a335408; }
body.csys-portal .page-header .csys-client-action-primary { color: #fff; background: #234876; border-color: #234876; }
@media (max-width: 1199.98px) {
    body.csys-portal .csys-portal-actions.d-lg-flex { display: none !important; }
}
@media (max-width: 991.98px) {
    body.csys-portal .csys-topbar { position: relative; }
    body.csys-portal .csys-topbar-inner { min-height: 62px; }
    body.csys-portal :is(.page-header,.page-body) > .container-fluid { padding-inline: 14px; }
    body.csys-portal .csys-dashboard-header { flex-wrap: wrap; align-items: flex-start; gap: 18px; }
    body.csys-portal .csys-client-actions { flex-wrap: wrap; justify-content: flex-start; }
    body.csys-portal .csys-user-symbol { display: inline-flex; }
}
@media (max-width: 575px) {
    body.csys-portal .csys-portal-company { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
    body.csys-portal .csys-topbar-context { display: grid; gap: 3px; }
    body.csys-portal .csys-portal-account-dropdown { padding: 3px 5px; border-radius: 10px; }
    body.csys-portal .csys-portal-account .csys-user-block { display: none; }
    body.csys-portal .csys-topbar-user { padding-left: 0; }
    body.csys-portal .csys-user-symbol { width: 32px; height: 32px; flex-basis: 32px; }
    body.csys-portal .page-header .csys-page-title { font-size: 27px; }
}

/* The same brand light is used on both staff and client sign-in screens. */
.csys-auth .csys-logo { position: relative; isolation: isolate; }
.csys-auth .csys-logo::before { content: ''; position: absolute; z-index: 0; pointer-events: none; top: -28px; bottom: -28px; left: -25px; width: min(410px, 100%); background: var(--csys-brand-halo); }
.csys-auth .csys-logo img { position: relative; z-index: 1; }
.csys-auth .csys-logo img, .csys-auth :is(.assessment-logo,.result-logo) { filter: var(--csys-brand-glow); }
@media (max-width: 991.98px) {
    .csys-auth .csys-logo::before { left: 50%; transform: translateX(-50%); width: min(340px, 100%); }
}
