:root {
    --trw-green: #0b513d;
    --trw-green-dark: #063b2d;
    --trw-green-bright: #0f7a4a;
    --trw-green-soft: #e8f4ee;
    --trw-gold: #d4a017;
    --trw-gold-bright: #f2bd22;
    --trw-gold-soft: #fff6d8;
    --trw-red: #b42318;
    --trw-red-dark: #8f1d15;
    --trw-red-soft: #fff0ed;
    --trw-ink: #17221f;
    --trw-muted: #60706a;
    --trw-border: #cdded6;
    --trw-surface: #ffffff;
    --trw-canvas: #f3f8f5;
}

body.trw-brand-system {
    --navy: var(--trw-green);
    --navy-2: var(--trw-green-dark);
    --gold: var(--trw-gold);
    --gold-2: var(--trw-gold-bright);
    --light: var(--trw-canvas);
    --card: var(--trw-surface);
    --text: var(--trw-ink);
    --muted: var(--trw-muted);
    --bs-primary: var(--trw-green);
    --bs-primary-rgb: 11, 81, 61;
    --bs-warning: var(--trw-gold);
    --bs-warning-rgb: 212, 160, 23;
    --bs-danger: var(--trw-red);
    --bs-danger-rgb: 180, 35, 24;
    --trw-portal-accent: var(--trw-gold);
    background: var(--trw-canvas);
    color: var(--trw-ink);
}

body.trw-brand-system.trw-role-super_admin,
body.trw-brand-system.trw-role-school_admin {
    --trw-portal-accent: var(--trw-red);
}

body.trw-brand-system.trw-role-teacher,
body.trw-brand-system.trw-portal-parent {
    --trw-portal-accent: var(--trw-gold);
}

body.trw-brand-system :where(.btn-primary, .btn-navy) {
    background: var(--trw-green) !important;
    border-color: var(--trw-green) !important;
    color: #fff !important;
}

body.trw-brand-system :where(.btn-primary, .btn-navy):hover,
body.trw-brand-system :where(.btn-primary, .btn-navy):focus {
    background: var(--trw-green-dark) !important;
    border-color: var(--trw-gold) !important;
    color: #fff !important;
}

body.trw-brand-system .btn-warning,
body.trw-brand-system .btn-gold {
    background: var(--trw-gold) !important;
    border-color: var(--trw-gold) !important;
    color: #17221f !important;
}

body.trw-brand-system :where(.btn-danger, .portal-btn-student) {
    background: var(--trw-red) !important;
    border-color: var(--trw-red) !important;
    color: #fff !important;
}

body.trw-brand-system :where(.btn-outline-primary, .btn-outline-success) {
    border-color: var(--trw-green) !important;
    color: var(--trw-green) !important;
}

body.trw-brand-system :where(.btn-outline-primary, .btn-outline-success):hover,
body.trw-brand-system :where(.btn-outline-primary, .btn-outline-success):focus {
    background: var(--trw-green) !important;
    border-color: var(--trw-green) !important;
    color: #fff !important;
}

body.trw-brand-system :where(.form-control, .form-select):focus {
    border-color: var(--trw-gold) !important;
    box-shadow: 0 0 0 .2rem rgba(212, 160, 23, .16) !important;
}

body.trw-brand-system :where(.card, .card-soft, .table-card, .panel-card) {
    border-color: var(--trw-border);
}

body.trw-brand-system :where(.card-header, .modal-header):not(.bg-danger):not(.bg-warning):not(.bg-success) {
    border-bottom-color: var(--trw-border);
}

body.trw-brand-system .modal-content {
    background: var(--trw-surface);
    border: 1px solid rgba(6, 59, 45, .2);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(6, 59, 45, .24);
    max-height: calc(100dvh - 2rem);
    overflow: hidden;
}

body.trw-brand-system .modal-header:not(.bg-danger):not(.bg-warning):not(.bg-success) {
    background: var(--trw-green-dark) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .14) !important;
    border-top: 4px solid var(--trw-gold) !important;
    color: #fff !important;
}

body.trw-brand-system .modal-dialog {
    margin-bottom: 1rem;
    margin-top: 1rem;
}

body.trw-brand-system .modal-header {
    align-items: center;
    flex: 0 0 auto;
    gap: .75rem;
    min-height: 68px;
    padding: .9rem 1rem;
    position: relative;
    z-index: 3;
}

body.trw-brand-system .modal-header :where(.modal-title, h1, h2, h3, h4, h5, h6),
body.trw-brand-system .modal-header :where(.modal-title, h1, h2, h3, h4, h5, h6) * {
    color: inherit !important;
    letter-spacing: 0 !important;
}

body.trw-brand-system .modal-header .section-eyebrow,
body.trw-brand-system .modal-header [class*="kicker"] {
    color: #ffe28a !important;
}

body.trw-brand-system .modal-header .text-muted,
body.trw-brand-system .modal-header p,
body.trw-brand-system .modal-header small {
    color: rgba(255, 255, 255, .82) !important;
}

body.trw-brand-system .modal-header .btn-close {
    background-color: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 50%;
    box-sizing: content-box;
    filter: brightness(0) invert(1);
    flex: 0 0 auto;
    margin: 0 0 0 auto;
    opacity: 1;
    padding: .55rem;
}

body.trw-brand-system .modal-header .btn-close:hover,
body.trw-brand-system .modal-header .btn-close:focus {
    background-color: rgba(255, 255, 255, .28);
    box-shadow: 0 0 0 .2rem rgba(242, 189, 34, .28);
}

body.trw-brand-system .modal-header.bg-primary,
body.trw-brand-system .modal-header.bg-info,
body.trw-brand-system .modal-header.bg-success {
    background: var(--trw-green) !important;
    border-bottom-color: rgba(255, 255, 255, .14) !important;
    border-top: 4px solid var(--trw-gold) !important;
    color: #fff !important;
}

body.trw-brand-system .modal-header.bg-warning {
    background: var(--trw-gold) !important;
    border-bottom-color: rgba(6, 59, 45, .18) !important;
    border-top: 4px solid var(--trw-green-dark) !important;
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system .modal-header.bg-warning :where(.modal-title, h1, h2, h3, h4, h5, h6, p, small, .text-muted),
body.trw-brand-system .modal-header.bg-warning [class*="kicker"] {
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system .modal-header.bg-warning .btn-close {
    border-color: rgba(6, 59, 45, .34);
    filter: none;
}

body.trw-brand-system .modal-header.bg-danger {
    background: var(--trw-red) !important;
    border-bottom-color: rgba(255, 255, 255, .14) !important;
    border-top: 4px solid var(--trw-gold) !important;
    color: #fff !important;
}

body.trw-brand-system .modal-content > :where([class$="-modal-head"], [class*="-modal-head "], [class$="-modal-heading"], [class*="-modal-heading "]) {
    background: var(--trw-green-dark) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .14) !important;
    border-top: 4px solid var(--trw-gold) !important;
    color: #fff !important;
}

body.trw-brand-system .modal-content > :where([class$="-modal-head"], [class*="-modal-head "], [class$="-modal-heading"], [class*="-modal-heading "]) :where(h1, h2, h3, h4, h5, h6, p, span, small, strong, .text-muted) {
    color: inherit !important;
}

body.trw-brand-system .modal-content :where([class*="modal-head"], [class*="modal-heading"]) .btn-close {
    filter: brightness(0) invert(1);
    opacity: 1;
}

body.trw-brand-system .modal-body {
    background: #fff;
    color: var(--trw-ink);
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    scrollbar-color: var(--trw-green) var(--trw-green-soft);
    scrollbar-width: auto;
}

body.trw-brand-system .modal-body::-webkit-scrollbar {
    width: 11px;
}

body.trw-brand-system .modal-body::-webkit-scrollbar-track {
    background: var(--trw-green-soft);
}

body.trw-brand-system .modal-body::-webkit-scrollbar-thumb {
    background: var(--trw-green);
    border: 2px solid var(--trw-green-soft);
    border-radius: 8px;
}

body.trw-brand-system .modal-body :where(.form-control, .form-select, .input-group-text, textarea) {
    background-color: #f8fcfa;
    border-color: var(--trw-border);
    color: var(--trw-ink);
}

body.trw-brand-system .modal-body :where(.form-label, label) {
    color: var(--trw-green-dark);
    font-weight: 800;
}

body.trw-brand-system .modal-body :where(.card, .card-soft, .panel, [class*="-panel"]):not(.alert) {
    border-color: var(--trw-border);
}

body.trw-brand-system .modal-body :where(.card-header, [class*="section-head"]):not(.bg-danger):not(.bg-warning):not(.bg-success) {
    background: var(--trw-green-soft);
    color: var(--trw-green-dark);
}

body.trw-brand-system .modal-footer {
    background: #fff;
    border-top: 1px solid var(--trw-border);
    box-shadow: 0 -8px 22px rgba(6, 59, 45, .06);
    flex: 0 0 auto;
    gap: .5rem;
    padding: .8rem 1rem;
    position: relative;
    z-index: 3;
}

body.trw-brand-system .modal-footer :where(.btn-secondary, .btn-outline-secondary, .btn-light) {
    background: #fff !important;
    border-color: #91a69d !important;
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system .modal-footer :where(.btn-secondary, .btn-outline-secondary, .btn-light):hover,
body.trw-brand-system .modal-footer :where(.btn-secondary, .btn-outline-secondary, .btn-light):focus {
    background: var(--trw-green-soft) !important;
    border-color: var(--trw-green) !important;
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system .modal-footer .btn-danger,
body.trw-brand-system .modal-body .btn-danger {
    background: var(--trw-red) !important;
    border-color: var(--trw-red) !important;
    color: #fff !important;
}

body.trw-brand-system .modal :where(.official-btn-student, .portal-btn-student) {
    background: var(--trw-red) !important;
    border-color: var(--trw-red) !important;
    color: #fff !important;
}

body.trw-brand-system .modal :where(.official-btn-parent, .portal-btn-parent) {
    background: var(--trw-gold) !important;
    border-color: var(--trw-gold) !important;
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system .modal :where(.official-btn-staff, .portal-btn-staff) {
    background: var(--trw-green) !important;
    border-color: var(--trw-green) !important;
    color: #fff !important;
}

body.trw-brand-system .modal-footer > .btn:not(.btn-danger):not(.btn-warning):not(.btn-secondary):not(.btn-light):not([class*="btn-outline"]):not(.official-btn-student):not(.official-btn-parent):not(.official-btn-staff) {
    background: var(--trw-green) !important;
    border-color: var(--trw-green) !important;
    color: #fff !important;
}

body.trw-brand-system .modal-backdrop.show {
    opacity: .62;
}

body.trw-brand-system .badge.bg-primary,
body.trw-brand-system .text-bg-primary {
    background: var(--trw-green) !important;
}

body.trw-brand-system .text-primary {
    color: var(--trw-green) !important;
}

body.trw-brand-system .link-primary {
    color: var(--trw-green) !important;
}

/* Shared staff, leadership, administration, and super-admin shell. */
body.trw-brand-system.trw-portal-staff .sidebar {
    background: var(--trw-green-dark) !important;
    border-right: 4px solid var(--trw-gold);
    box-shadow: 14px 0 36px rgba(6, 59, 45, .16);
}

body.trw-brand-system.trw-portal-staff .brand-block {
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}

body.trw-brand-system.trw-portal-staff .brand-logo {
    background: #fff !important;
    border: 2px solid var(--trw-gold);
    border-radius: 8px;
}

body.trw-brand-system.trw-portal-staff .sidebar-section-icon,
body.trw-brand-system.trw-portal-staff .sidebar-link .sidebar-link-icon {
    color: #ffe28a;
}

body.trw-brand-system.trw-portal-staff .sidebar-section-toggle {
    border-left-color: rgba(242, 189, 34, .7);
}

body.trw-brand-system.trw-portal-staff .sidebar-section-toggle.active,
body.trw-brand-system.trw-portal-staff .sidebar-section-toggle:not(.collapsed),
body.trw-brand-system.trw-portal-staff .sidebar-link.active {
    background: rgba(212, 160, 23, .18) !important;
    border-left-color: var(--trw-gold-bright) !important;
}

body.trw-brand-system.trw-portal-staff .sidebar-link:hover {
    background: rgba(255, 255, 255, .09);
    border-left-color: var(--trw-gold);
}

body.trw-brand-system.trw-portal-staff .content-area {
    background: var(--trw-canvas);
}

body.trw-brand-system.trw-portal-staff .topbar {
    background: #fff;
    border: 1px solid var(--trw-border);
    border-top: 4px solid var(--trw-portal-accent);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(6, 59, 45, .08);
}

body.trw-brand-system.trw-portal-staff .page-title,
body.trw-brand-system.trw-portal-staff .page-identity-title-row h3 {
    color: var(--trw-green-dark);
}

body.trw-brand-system.trw-portal-staff .page-identity-kicker,
body.trw-brand-system.trw-portal-staff .section-eyebrow {
    color: var(--trw-red);
}

body.trw-brand-system.trw-portal-staff .page-identity-chip {
    background: var(--trw-green-soft);
    border-color: var(--trw-border);
    color: var(--trw-green-dark);
}

body.trw-brand-system.trw-portal-staff .staff-theme-toggle,
body.trw-brand-system.trw-portal-staff .sidebar-toggle-btn {
    background: var(--trw-green-soft);
    border-color: var(--trw-border);
    color: var(--trw-green-dark);
}

body.trw-brand-system.trw-portal-staff .sidebar-mobile-btn {
    background: var(--trw-green);
}

body.trw-brand-system.trw-portal-staff .content-area .table:not([class*="print"]) thead th {
    background: var(--trw-green-soft);
    color: var(--trw-green-dark);
}

body.trw-brand-system.trw-portal-staff .content-area .table-hover tbody tr:hover > * {
    background: #f8fcfa;
}

body.trw-brand-system.trw-portal-staff .footer-account-activity {
    background: var(--trw-green-dark);
    border-color: rgba(242, 189, 34, .35);
    color: #eefaf4;
}

/* Teacher portal. */
body.trw-brand-system.trw-role-teacher .teacher-dashboard-hero {
    background: var(--trw-green-dark) !important;
    border-top: 4px solid var(--trw-gold) !important;
}

body.trw-brand-system.trw-role-teacher .teacher-dashboard-kicker,
body.trw-brand-system.trw-role-teacher .teacher-responsibility-kicker {
    color: #ffe28a !important;
}

body.trw-brand-system.trw-role-teacher .teacher-responsibility-panel,
body.trw-brand-system.trw-role-teacher .teacher-work-card,
body.trw-brand-system.trw-role-teacher .teacher-tool-group,
body.trw-brand-system.trw-role-teacher .teacher-dashboard-panel,
body.trw-brand-system.trw-role-teacher .teacher-live-map-card {
    border-top: 3px solid var(--trw-gold) !important;
}

body.trw-brand-system.trw-role-teacher .teacher-responsibility-icon,
body.trw-brand-system.trw-role-teacher .teacher-tool-link i:first-child {
    color: var(--trw-green);
}

body.trw-brand-system.trw-role-teacher .teacher-tool-link:hover {
    background: var(--trw-green-soft) !important;
    border-color: var(--trw-green) !important;
}

/* Student portal. */
body.trw-brand-system.trw-portal-student {
    background: var(--trw-canvas);
}

body.trw-brand-system.trw-portal-student.trw-portal-login,
body.trw-brand-system.trw-portal-student.trw-portal-login:has(.student-login-page) {
    background: var(--trw-canvas) !important;
}

body.trw-brand-system.trw-portal-student .student-login-topbar,
body.trw-brand-system.trw-portal-student .student-login-panel,
body.trw-brand-system.trw-portal-student .student-login-help-card {
    border-color: var(--trw-border) !important;
}

body.trw-brand-system.trw-portal-student .student-login-topbar {
    border-top: 4px solid var(--trw-red) !important;
}

body.trw-brand-system.trw-portal-student .student-login-hero {
    background: var(--trw-green-dark) !important;
    border-top: 4px solid var(--trw-gold) !important;
}

body.trw-brand-system.trw-portal-student .student-login-hero::after {
    background: rgba(6, 59, 45, .78) !important;
}

body.trw-brand-system.trw-portal-student .student-login-eyebrow,
body.trw-brand-system.trw-portal-student .student-login-panel .section-eyebrow {
    color: var(--trw-gold) !important;
}

body.trw-brand-system.trw-portal-student .student-login-panel {
    border-top: 4px solid var(--trw-red) !important;
}

body.trw-brand-system.trw-portal-student .student-login-submit {
    background: var(--trw-red) !important;
    border-color: var(--trw-red) !important;
    color: #fff !important;
}

body.trw-brand-system.trw-portal-student .student-login-submit:hover,
body.trw-brand-system.trw-portal-student .student-login-submit:focus {
    background: var(--trw-red-dark) !important;
    border-color: var(--trw-gold) !important;
}

body.trw-brand-system.trw-portal-student .student-sidebar,
body.trw-brand-system.trw-portal-student .student-dashboard-shell .student-sidebar {
    background: var(--trw-green-dark) !important;
    border: 1px solid rgba(255, 255, 255, .16) !important;
    border-top: 4px solid var(--trw-gold) !important;
    box-shadow: 0 18px 34px rgba(6, 59, 45, .2) !important;
}

body.trw-brand-system.trw-portal-student .student-sidebar-badge {
    background: var(--trw-gold) !important;
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system.trw-portal-student .student-sidebar-link.active {
    background: var(--trw-gold) !important;
    border-color: var(--trw-gold) !important;
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system.trw-portal-student .student-sidebar-link:hover {
    background: rgba(255, 255, 255, .12) !important;
    border-color: rgba(242, 189, 34, .7) !important;
}

body.trw-brand-system.trw-portal-student .student-dashboard-hero,
body.trw-brand-system.trw-portal-student .student-portal-hero,
body.trw-brand-system.trw-portal-student .hero-panel {
    background: var(--trw-green) !important;
    border-top: 4px solid var(--trw-red) !important;
}

body.trw-brand-system.trw-portal-student .student-dashboard-primary-cta {
    background: var(--trw-gold) !important;
    border-color: var(--trw-gold) !important;
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system.trw-portal-student .student-dashboard-panel,
body.trw-brand-system.trw-portal-student .student-dashboard-kpi,
body.trw-brand-system.trw-portal-student .action-tile {
    border-color: var(--trw-border) !important;
}

body.trw-brand-system.trw-portal-student .student-dashboard-section-label,
body.trw-brand-system.trw-portal-student .student-dashboard-eyebrow {
    color: var(--trw-red) !important;
}

/* Parent portal. */
body.trw-brand-system.trw-portal-parent .parent-portal-login,
body.trw-brand-system.trw-portal-parent .parent-portal-login.parent-public-login-bg {
    background-color: var(--trw-green-dark) !important;
}

body.trw-brand-system.trw-portal-parent .parent-portal-login::before {
    background: rgba(6, 59, 45, .82) !important;
}

body.trw-brand-system.trw-portal-parent .parent-login-official-panel {
    background: var(--trw-green) !important;
    border-top: 5px solid var(--trw-gold) !important;
}

body.trw-brand-system.trw-portal-parent .parent-login-badge,
body.trw-brand-system.trw-portal-parent .parent-login-trust-badges span {
    background: rgba(212, 160, 23, .2) !important;
    border-color: rgba(255, 226, 138, .4) !important;
}

body.trw-brand-system.trw-portal-parent .parent-login-card {
    border-top: 5px solid var(--trw-red) !important;
}

body.trw-brand-system.trw-portal-parent .parent-portal-dashboard .student-sidebar {
    background: var(--trw-green-dark) !important;
    border-top: 4px solid var(--trw-gold) !important;
}

body.trw-brand-system.trw-portal-parent .parent-portal-topbar {
    background: #fff !important;
    border: 1px solid var(--trw-border) !important;
    border-top: 4px solid var(--trw-gold) !important;
}

body.trw-brand-system.trw-portal-parent .parent-portal-brand-text strong,
body.trw-brand-system.trw-portal-parent .parent-portal-identity-main h1 {
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system.trw-portal-parent .parent-portal-identity-card {
    border-top: 4px solid var(--trw-red) !important;
}

body.trw-brand-system.trw-portal-parent .parent-portal-action-card {
    border-top: 3px solid var(--trw-gold) !important;
}

body.trw-brand-system.trw-portal-parent .parent-portal-action-card:hover,
body.trw-brand-system.trw-portal-parent .parent-portal-action-card:focus {
    border-color: var(--trw-green) !important;
    box-shadow: 0 12px 24px rgba(6, 59, 45, .1) !important;
}

body.trw-brand-system.trw-portal-parent .parent-portal-action-card i {
    background: var(--trw-green-soft) !important;
    color: var(--trw-green) !important;
}

/* Staff login. */
body.trw-brand-system.trw-portal-staff-login .login-wrap.staff-login-photo-bg {
    background: var(--trw-green-dark) !important;
}

body.trw-brand-system.trw-portal-staff-login .login-wrap.staff-login-photo-bg::after {
    background: rgba(6, 59, 45, .86) !important;
}

body.trw-brand-system.trw-portal-staff-login .staff-login-official-panel {
    background: var(--trw-green-dark) !important;
    border-top: 5px solid var(--trw-gold) !important;
}

body.trw-brand-system.trw-portal-staff-login .staff-login-card,
body.trw-brand-system.trw-portal-staff-login .staff-login-form-panel {
    border-top: 5px solid var(--trw-red) !important;
}

body.trw-brand-system.trw-portal-staff-login .portal-btn-staff {
    background: var(--trw-green) !important;
    border-color: var(--trw-green) !important;
    color: #fff !important;
}

/* Individual school public portal. */
body.trw-brand-system.trw-portal-public:has(.school-public) {
    background: var(--trw-canvas) !important;
}

body.trw-brand-system.trw-portal-public .school-public {
    --school-primary-local: var(--trw-green);
    --school-primary-dark-local: var(--trw-green-dark);
    --school-secondary-local: var(--trw-gold);
    background: var(--trw-canvas) !important;
}

body.trw-brand-system.trw-portal-public .school-topbar,
body.trw-brand-system.trw-portal-public .school-action-panel,
body.trw-brand-system.trw-portal-public .school-stat-strip,
body.trw-brand-system.trw-portal-public .school-route,
body.trw-brand-system.trw-portal-public .school-section,
body.trw-brand-system.trw-portal-public .school-help-card {
    border-color: var(--trw-border) !important;
}

body.trw-brand-system.trw-portal-public .school-topbar {
    border-top: 4px solid var(--trw-red) !important;
}

body.trw-brand-system.trw-portal-public .school-hero {
    background: var(--trw-green-dark) !important;
    border-top: 4px solid var(--trw-gold) !important;
}

body.trw-brand-system.trw-portal-public .school-hero::after {
    background: rgba(6, 59, 45, .8) !important;
}

body.trw-brand-system.trw-portal-public .school-eyebrow,
body.trw-brand-system.trw-portal-public .school-section-head .section-eyebrow {
    color: var(--trw-gold) !important;
}

body.trw-brand-system.trw-portal-public .school-primary-action {
    background: var(--trw-green) !important;
    border-color: var(--trw-green) !important;
    color: #fff !important;
}

body.trw-brand-system.trw-portal-public .school-route-icon,
body.trw-brand-system.trw-portal-public .school-process-step > span {
    background: var(--trw-green-soft) !important;
    color: var(--trw-green) !important;
}

body.trw-brand-system.trw-portal-public .school-staff-modal-identity {
    background: var(--trw-green-dark) !important;
    border-top: 4px solid var(--trw-gold) !important;
}

/* Shared footer identity. */
body.trw-brand-system .footer-bar {
    background: var(--trw-green-dark);
    border-top: 4px solid var(--trw-gold);
    color: #dceee7;
}

body.trw-brand-system .footer-bar a,
body.trw-brand-system .footer-company-link,
body.trw-brand-system .footer-developer-credit {
    color: #ffe28a;
}

body.trw-brand-system .footer-bar a:hover,
body.trw-brand-system .footer-company-link:hover {
    color: #fff;
}

/* Account security uses the company palette while preserving clear danger actions. */
body.trw-brand-system .footer-account-activity {
    background: var(--trw-green-dark) !important;
    border-color: rgba(242, 189, 34, .42) !important;
    color: #eefaf4 !important;
}

body.trw-brand-system .footer-account-activity-icon {
    color: #ffe28a !important;
}

body.trw-brand-system .footer-account-details-btn {
    background: var(--trw-gold) !important;
    border-color: var(--trw-gold-bright) !important;
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system .footer-account-details-btn:hover,
body.trw-brand-system .footer-account-details-btn:focus {
    background: var(--trw-gold-bright) !important;
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system .account-activity-modal .modal-content {
    background: #fff !important;
    border: 1px solid var(--trw-border) !important;
    border-radius: 10px !important;
    box-shadow: 0 28px 90px rgba(6, 59, 45, .34) !important;
    color: var(--trw-ink) !important;
}

body.trw-brand-system .account-activity-modal .modal-header {
    background: var(--trw-green-dark) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .16) !important;
    border-top: 5px solid var(--trw-gold-bright) !important;
    color: #fff !important;
    min-height: 86px;
}

body.trw-brand-system .account-activity-modal-mark {
    background: var(--trw-gold-soft) !important;
    border-color: var(--trw-gold-bright) !important;
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system .account-activity-kicker {
    color: #ffe28a !important;
    font-size: .76rem !important;
}

body.trw-brand-system .account-activity-modal .modal-title {
    color: #fff !important;
    font-size: clamp(1.12rem, 2.2vw, 1.38rem) !important;
    font-weight: 950 !important;
}

body.trw-brand-system .account-activity-modal .modal-body {
    background: #f7fbf9 !important;
    color: var(--trw-ink) !important;
}

body.trw-brand-system .account-activity-summary {
    background: var(--trw-green-soft) !important;
    border-color: var(--trw-border) !important;
}

body.trw-brand-system .account-activity-summary > div {
    background: #fff !important;
    border-color: rgba(11, 81, 61, .2) !important;
}

body.trw-brand-system .account-activity-summary span {
    color: var(--trw-muted) !important;
}

body.trw-brand-system .account-activity-summary strong {
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system .account-activity-summary p {
    color: #465b54 !important;
}

body.trw-brand-system .account-session-card,
body.trw-brand-system .account-session-empty {
    background: #fff !important;
    border-color: var(--trw-border) !important;
    color: var(--trw-muted) !important;
}

body.trw-brand-system .account-session-card.is-current {
    background: var(--trw-gold-soft) !important;
    border-color: var(--trw-gold) !important;
}

body.trw-brand-system .account-session-device {
    background: var(--trw-green-soft) !important;
    border-color: rgba(11, 81, 61, .2) !important;
    color: var(--trw-green) !important;
}

body.trw-brand-system .account-session-title-row strong,
body.trw-brand-system .account-session-empty strong {
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system .account-session-meta,
body.trw-brand-system .account-session-main small {
    color: var(--trw-muted) !important;
}

body.trw-brand-system .account-session-meta i,
body.trw-brand-system .account-session-empty i,
body.trw-brand-system .account-current-device-label {
    color: var(--trw-green) !important;
}

body.trw-brand-system .account-session-badge {
    background: var(--trw-gold-soft) !important;
    border-color: rgba(212, 160, 23, .48) !important;
    color: #725006 !important;
}

body.trw-brand-system .account-session-badge.is-current {
    background: var(--trw-green-soft) !important;
    border-color: rgba(11, 81, 61, .28) !important;
    color: var(--trw-green-dark) !important;
}

body.trw-brand-system .account-activity-modal .modal-footer {
    background: #edf6f1 !important;
    border-top: 1px solid var(--trw-border) !important;
}

body.trw-brand-system .account-session-close-btn {
    background: var(--trw-green) !important;
    border-color: var(--trw-green) !important;
    color: #fff !important;
}

body.trw-brand-system .account-session-close-btn:hover,
body.trw-brand-system .account-session-close-btn:focus {
    background: var(--trw-green-dark) !important;
    border-color: var(--trw-gold) !important;
    color: #fff !important;
}

body.trw-brand-system .account-session-end-btn,
body.trw-brand-system .account-session-end-all-btn {
    background: var(--trw-red) !important;
    border-color: var(--trw-red) !important;
    color: #fff !important;
}

html[data-staff-theme="dark"] body.trw-brand-system #accountActivityModal .modal-content,
html[data-staff-theme="dark"] body.trw-brand-system #accountActivityModal .modal-body {
    background: #f7fbf9 !important;
    border-color: var(--trw-border) !important;
    color: var(--trw-ink) !important;
}

html[data-staff-theme="dark"] body.trw-brand-system #accountActivityModal .modal-header {
    background: var(--trw-green-dark) !important;
    border-bottom-color: rgba(255, 255, 255, .16) !important;
    border-top-color: var(--trw-gold-bright) !important;
    color: #fff !important;
}

html[data-staff-theme="dark"] body.trw-brand-system #accountActivityModal .modal-footer {
    background: #edf6f1 !important;
    border-color: var(--trw-border) !important;
}

html[data-staff-theme="dark"] body.trw-brand-system #accountActivityModal .modal-title {
    color: #fff !important;
}

html[data-staff-theme="dark"] body.trw-brand-system #accountActivityModal .account-activity-summary p,
html[data-staff-theme="dark"] body.trw-brand-system #accountActivityModal .account-session-meta,
html[data-staff-theme="dark"] body.trw-brand-system #accountActivityModal .account-session-main small,
html[data-staff-theme="dark"] body.trw-brand-system #accountActivityModal .account-session-empty {
    color: var(--trw-muted) !important;
}

html[data-staff-theme="dark"] body.trw-brand-system #accountActivityModal .account-activity-summary strong,
html[data-staff-theme="dark"] body.trw-brand-system #accountActivityModal .account-session-title-row strong,
html[data-staff-theme="dark"] body.trw-brand-system #accountActivityModal .account-session-empty strong {
    color: var(--trw-green-dark) !important;
}

/* Company information keeps one high-contrast treatment in every portal theme. */
body.trw-brand-system .trwsoft-legal-modal .modal-header,
html[data-staff-theme="dark"] body.trw-brand-system .trwsoft-legal-modal .modal-header {
    background: #063b2d !important;
    border-bottom: 1px solid rgba(255, 255, 255, .16) !important;
    border-top: 5px solid #f2bd22 !important;
    color: #fff !important;
    min-height: 86px;
    padding: 1rem 1.15rem !important;
}

body.trw-brand-system .trwsoft-legal-modal .trwsoft-legal-kicker,
html[data-staff-theme="dark"] body.trw-brand-system .trwsoft-legal-modal .trwsoft-legal-kicker {
    color: #ffe28a !important;
    font-size: .76rem !important;
    font-weight: 950 !important;
    line-height: 1.25;
}

body.trw-brand-system .trwsoft-legal-modal .modal-title,
html[data-staff-theme="dark"] body.trw-brand-system .trwsoft-legal-modal .modal-title {
    color: #fff !important;
    font-size: clamp(1.12rem, 2.2vw, 1.38rem) !important;
    font-weight: 950 !important;
    line-height: 1.28 !important;
    margin-top: .2rem !important;
}

body.trw-brand-system .trwsoft-legal-modal .modal-header .btn-close,
html[data-staff-theme="dark"] body.trw-brand-system .trwsoft-legal-modal .modal-header .btn-close {
    background-color: rgba(255, 255, 255, .2) !important;
    border: 2px solid rgba(255, 255, 255, .76) !important;
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
}

body.trw-brand-system .trwsoft-legal-modal .modal-body,
html[data-staff-theme="dark"] body.trw-brand-system .trwsoft-legal-modal .modal-body {
    background: #fff !important;
    color: #1e293b !important;
}

@media (max-width: 767.98px) {
    body.trw-brand-system.trw-portal-staff .topbar {
        border-radius: 8px;
    }

    body.trw-brand-system.trw-portal-staff .content-area {
        padding: 14px;
    }

    body.trw-brand-system .footer-bar {
        padding-inline: 14px;
    }
}

@media print {
    body.trw-brand-system {
        --navy: #111827;
        --navy-2: #111827;
        --gold: #6b7280;
        --gold-2: #9ca3af;
        background: #fff !important;
    }
}
