/* Extracted from index.html during the structural refactor. Keep selectors stable. */

        :root {
            --sidebar-width: 260px;
            --app-header-height: 72px;
        }

        /* Exclusion & Tenure Badges */
        .badge-excluded {
            background: linear-gradient(135deg, #78909c, #546e7a);
            color: white;
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 0.72rem;
            font-weight: 600;
        }
        .badge-under6m {
            background: linear-gradient(135deg, #ff9800, #ef6c00);
            color: white;
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 0.72rem;
            font-weight: 600;
        }
        .row-excluded {
            opacity: 0.55;
            background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.02) 10px, rgba(0,0,0,0.02) 20px);
        }
        .row-under6m {
            background: rgba(255, 152, 0, 0.04);
        }
        .btn-exclude {
            padding: 4px 10px;
            font-size: 0.75rem;
            border-radius: 6px;
            border: 1px solid #ef5350;
            background: rgba(239, 83, 80, 0.08);
            color: #ef5350;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 600;
        }
        .btn-exclude:hover {
            background: #ef5350;
            color: white;
        }
        .btn-include {
            padding: 4px 10px;
            font-size: 0.75rem;
            border-radius: 6px;
            border: 1px solid #43a047;
            background: rgba(67, 160, 71, 0.08);
            color: #43a047;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 600;
        }
        .btn-include:hover {
            background: #43a047;
            color: white;
        }
        .question-card {
            background: var(--bg-input);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            padding: 1.25rem;
            margin-bottom: 1.25rem;
            transition: all 0.2s;
        }
        .question-card:hover {
            border-color: var(--primary-light);
            box-shadow: 0 2px 8px rgba(0,75,135,0.08);
        }
        .question-number {
            display: inline-flex;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: var(--primary);
            color: white;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: 700;
            margin-right: 10px;
        }
        .question-text {
            font-weight: 600;
            color: var(--text-main);
            font-size: 0.9rem;
            margin-bottom: 0.75rem;
        }
        .question-category {
            font-size: 0.7rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 0.5rem;
        }
        .ai-assessment-card {
            background: linear-gradient(135deg, rgba(0,75,135,0.04), rgba(242,101,34,0.04));
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            padding: 1.5rem;
            margin-top: 1.5rem;
        }
        .ai-score-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 14px;
            border-radius: 20px;
            font-weight: 700;
            font-size: 0.85rem;
        }
        .ai-detail-item {
            padding: 0.75rem;
            border-bottom: 1px solid var(--border-color);
        }
        .ai-detail-item:last-child { border-bottom: none; }
        .ai-feedback {
            font-size: 0.78rem;
            color: var(--text-muted);
            font-style: italic;
            margin-top: 4px;
        }

        body {
            display: flex;
            flex-direction: column;
            width: 100%;
            height: 100vh;
            min-height: 100vh;
            overflow: hidden;
        }

        /* Keep the shell fixed; only the application content owns scrolling. */
        header {
            flex: 0 0 var(--app-header-height);
            min-height: var(--app-header-height);
        }

        #app-container {
            display: flex;
            flex: 1 1 auto;
            width: 100%;
            min-width: 0;
            min-height: 0;
            position: relative;
            overflow: hidden;
        }

        /* Sidebar Navigation */
        .sidebar {
            flex: 0 0 var(--sidebar-width);
            width: var(--sidebar-width);
            height: 100%;
            min-height: 0;
            background: var(--bg-header);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            overflow-x: hidden;
            overflow-y: auto;
            overscroll-behavior: contain;
            transition: all var(--transition-normal);
            z-index: 10;
        }

        .sidebar-menu {
            list-style: none;
            padding: 1rem 0;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .sidebar-item a {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 0.75rem 1.5rem;
            color: var(--text-muted);
            text-decoration: none;
            font-weight: 500;
            border-left: 4px solid transparent;
            transition: all var(--transition-fast);
        }

        .sidebar-item.active a, .sidebar-item a:hover {
            color: var(--primary);
            background: rgba(0, 75, 135, 0.05);
            border-left-color: var(--primary);
        }

        .sidebar-item i {
            font-size: 1.25rem;
        }

        /* Sidebar Submenu Styles */
        .sidebar-submenu {
            list-style: none;
            padding: 0;
            margin: 4px 0 0 0;
            display: flex;
            flex-direction: column;
            gap: 0;
            background: rgba(0, 75, 135, 0.03);
        }

        .sidebar-submenu .sidebar-item a {
            padding: 0.6rem 1.5rem 0.6rem 2.5rem;
            font-size: 0.9rem;
            border-left-color: transparent;
            color: var(--text-muted);
        }

        .sidebar-submenu .sidebar-item.active a,
        .sidebar-submenu .sidebar-item a:hover {
            border-left-color: var(--primary);
            background: rgba(0, 75, 135, 0.08);
        }

        .sidebar-submenu .sidebar-item i {
            font-size: 0.9rem;
        }

        /* Content Area */
        .main-content {
            flex: 1 1 auto;
            width: 0;
            min-width: 0;
            min-height: 0;
            height: 100%;
            padding: 2rem;
            overflow-y: auto;
            overflow-x: hidden;
            overscroll-behavior: contain;
            background-color: var(--bg-main);
        }

        #doc-back-button[hidden] {
            display: none !important;
        }

        #access-control-root .link-like {
            border: 0;
            background: transparent;
            color: var(--primary);
            cursor: pointer;
            font: inherit;
            padding: 0;
            text-decoration: underline;
            text-underline-offset: 2px;
        }

        #access-control-root .sr-only,
        .access-control-dialog .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        /* Keep the final row of access actions scrollable above the fixed support agent. */
        #access-control-root {
            padding-bottom: 10rem;
        }

        #access-control-root .access-control-intro,
        #access-control-root .access-control-section {
            margin-top: 1rem;
            padding: 1.25rem 1.5rem;
        }

        #access-control-root .access-control-intro {
            margin-top: 0;
            margin-bottom: 1rem;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 1rem;
            flex-wrap: wrap;
        }

        #access-control-root .access-control-intro h3,
        #access-control-root .access-section-header h4 {
            margin: 0;
            color: var(--primary);
        }

        #access-control-root .access-control-intro p,
        #access-control-root .access-section-header p {
            margin: 5px 0 0;
            color: var(--text-muted);
            font-size: 0.82rem;
            line-height: 1.45;
        }

        #access-control-root .access-scope-badge,
        #access-control-root .access-status-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            width: fit-content;
            border-radius: 999px;
            padding: 5px 9px;
            font-size: 0.75rem;
            font-weight: 700;
            white-space: nowrap;
        }

        #access-control-root .access-scope-badge.is-global {
            background: var(--primary-bg);
            color: var(--primary);
        }

        #access-control-root .access-scope-badge.is-scoped {
            background: rgba(242, 101, 34, 0.12);
            color: #9a4d16;
        }

        #access-control-root .access-section-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 1rem;
            margin-bottom: 1rem;
            flex-wrap: wrap;
        }

        #access-control-root .access-summary-table th:last-child,
        #access-control-root .access-summary-table td:last-child {
            text-align: right;
        }

        #access-control-root .access-row-detail,
        #access-control-root .access-row-muted {
            margin-top: 3px;
            color: var(--text-muted);
            font-size: 0.75rem;
            line-height: 1.35;
        }

        #access-control-root .access-row-muted {
            margin: 0;
        }

        #access-control-root .access-row-actions {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
        }

        #access-control-root .access-status-pill.is-public {
            background: rgba(57, 166, 106, 0.12);
            color: #216943;
        }

        #access-control-root .access-status-pill.is-restricted {
            background: rgba(0, 75, 135, 0.1);
            color: var(--primary);
        }

        #access-control-root .access-status-pill.is-system {
            background: rgba(92, 112, 128, 0.13);
            color: #52687a;
        }

        #access-control-root .access-status-pill.is-delegated {
            background: rgba(57, 166, 106, 0.12);
            color: #216943;
        }

        #access-control-root .access-icon-button,
        .access-control-dialog .access-icon-button {
            display: inline-grid;
            width: 32px;
            height: 32px;
            place-items: center;
            padding: 0;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            color: var(--primary);
            background: var(--bg-card);
            cursor: pointer;
        }

        #access-control-root .access-icon-button:hover,
        .access-control-dialog .access-icon-button:hover {
            border-color: var(--primary);
            background: var(--primary-bg);
        }

        #access-control-root .access-icon-button.is-danger,
        .access-control-dialog .access-icon-button.is-danger {
            color: #c93a35;
        }

        #access-control-root .access-empty-state,
        #access-control-root .access-loading-state,
        #access-control-root .access-error-state {
            display: flex;
            min-height: 110px;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 7px;
            color: var(--text-muted);
            text-align: center;
        }

        #access-control-root .access-empty-state i,
        #access-control-root .access-loading-state i {
            color: var(--primary);
            font-size: 1.5rem;
        }

        #access-control-root .access-error-state {
            min-height: auto;
            align-items: flex-start;
            color: #b33a36;
            text-align: left;
        }

        .access-control-dialog {
            width: min(720px, calc(100vw - 2rem));
            max-width: 720px;
            max-height: min(760px, calc(100vh - 2rem));
            margin: auto;
            padding: 0;
            overflow: hidden;
            border: 0;
            border-radius: var(--radius-md);
            color: var(--text-color);
            background: var(--bg-card);
            box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
        }

        .access-control-dialog::backdrop {
            background: rgba(9, 28, 44, 0.54);
            backdrop-filter: blur(2px);
        }

        .access-control-dialog-shell {
            display: flex;
            max-height: min(760px, calc(100vh - 2rem));
            flex-direction: column;
        }

        .access-control-dialog-header,
        .access-control-dialog-footer {
            display: flex;
            flex: 0 0 auto;
            align-items: flex-start;
            justify-content: space-between;
            gap: 1rem;
            padding: 1.1rem 1.25rem;
            border-color: var(--border-color);
            background: var(--bg-card);
        }

        .access-control-dialog-header {
            border-bottom: 1px solid var(--border-color);
        }

        .access-control-dialog-header h3 {
            margin: 0;
            color: var(--primary);
            font-size: 1.05rem;
        }

        .access-control-dialog-header p {
            margin: 5px 0 0;
            color: var(--text-muted);
            font-size: 0.82rem;
            line-height: 1.45;
        }

        .access-control-dialog-body {
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
            padding: 1.25rem;
        }

        .access-control-dialog-footer {
            align-items: center;
            border-top: 1px solid var(--border-color);
        }

        .access-dialog-note {
            max-width: 360px;
            color: var(--text-muted);
            font-size: 0.74rem;
            line-height: 1.4;
        }

        .access-dialog-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
            flex-wrap: wrap;
        }

        .access-mode-fieldset {
            margin: 0 0 1rem;
            padding: 0;
            border: 0;
        }

        .access-mode-fieldset legend {
            margin-bottom: 8px;
            color: var(--text-color);
            font-size: 0.82rem;
            font-weight: 700;
        }

        .access-mode-options {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }

        .access-mode-option {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            min-height: 76px;
            padding: 12px;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            cursor: pointer;
        }

        .access-mode-option:has(input:checked) {
            border-color: var(--primary);
            background: var(--primary-bg);
        }

        .access-mode-option input,
        .access-check-row input,
        .access-delegation-control input,
        .access-picker-result input {
            accent-color: var(--primary);
        }

        .access-mode-option strong,
        .access-picker-result strong {
            display: block;
            color: var(--text-color);
            font-size: 0.84rem;
        }

        .access-mode-option small,
        .access-picker-result small,
        .access-member-row small {
            display: block;
            margin-top: 4px;
            color: var(--text-muted);
            font-size: 0.75rem;
            line-height: 1.35;
        }

        .access-delegation-control,
        .access-check-row {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            margin: 0 0 1rem;
            color: var(--text-color);
            font-size: 0.82rem;
            line-height: 1.4;
        }

        .access-scope-notice,
        .access-members-summary {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            margin-bottom: 1rem;
            padding: 10px 12px;
            border-radius: var(--radius-sm);
            color: #80511c;
            background: rgba(242, 101, 34, 0.1);
            font-size: 0.8rem;
            line-height: 1.4;
        }

        .access-members-summary {
            align-items: center;
            justify-content: space-between;
            color: var(--text-color);
            background: var(--primary-bg);
        }

        .access-members-summary span {
            color: var(--text-muted);
            font-size: 0.75rem;
        }

        .access-dialog-tabs {
            display: flex;
            gap: 4px;
            margin: 1rem 0;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
        }

        .access-dialog-tab {
            padding: 7px 9px;
            border: 0;
            border-radius: var(--radius-sm);
            color: var(--text-muted);
            background: transparent;
            font: inherit;
            font-size: 0.82rem;
            cursor: pointer;
        }

        .access-dialog-tab.active {
            color: var(--primary);
            background: var(--primary-bg);
            font-weight: 700;
        }

        .access-dialog-tab span {
            color: inherit;
            opacity: 0.75;
        }

        .access-picker-panel {
            display: none;
        }

        .access-picker-panel.active {
            display: block;
        }

        .access-picker-summary {
            display: grid;
            grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
            gap: 12px;
            align-items: start;
            padding: 10px 12px;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            background: var(--bg-input);
        }

        .access-picker-summary.is-inactive {
            opacity: 0.62;
        }

        .access-picker-summary strong {
            display: block;
            color: var(--text-color);
            font-size: 0.8rem;
        }

        .access-picker-summary > div > span {
            display: block;
            margin-top: 3px;
            color: var(--text-muted);
            font-size: 0.72rem;
        }

        .access-chip-list {
            display: flex;
            justify-content: flex-end;
            gap: 6px;
            flex-wrap: wrap;
        }

        .access-picker-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            max-width: 100%;
            padding: 4px 6px 4px 8px;
            border-radius: 999px;
            color: var(--primary);
            background: var(--primary-bg);
            font-size: 0.73rem;
            font-weight: 600;
        }

        .access-picker-chip button {
            display: inline-grid;
            width: 18px;
            height: 18px;
            place-items: center;
            padding: 0;
            border: 0;
            border-radius: 50%;
            color: inherit;
            background: transparent;
            cursor: pointer;
        }

        .access-picker-chip button:hover:not(:disabled) {
            background: rgba(0, 75, 135, 0.12);
        }

        .access-picker-chip button:disabled {
            cursor: not-allowed;
        }

        .access-picker-search {
            position: relative;
            display: block;
            margin: 12px 0 8px;
            line-height: 0;
        }

        .access-picker-search i {
            position: absolute;
            top: 50%;
            left: 11px;
            display: inline-flex;
            width: 18px;
            height: 18px;
            align-items: center;
            justify-content: center;
            transform: translateY(-50%);
            color: var(--text-muted);
            font-size: 16px;
            line-height: 1;
            pointer-events: none;
        }

        .access-picker-search input {
            display: block;
            width: 100%;
            min-height: 40px;
            padding: 8px 12px 8px 34px;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            color: var(--text-color);
            background: var(--bg-card);
            font: inherit;
            font-size: 0.86rem;
            line-height: 1.4;
        }

        .access-picker-search input:focus {
            outline: 2px solid rgba(0, 75, 135, 0.3);
            outline-offset: 1px;
            border-color: var(--primary);
        }

        .access-picker-results,
        .access-member-list {
            max-height: 220px;
            overflow-y: auto;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            background: var(--bg-card);
        }

        .access-picker-result,
        .access-member-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            min-height: 46px;
            padding: 9px 11px;
            border-top: 1px solid var(--border-color);
            color: var(--text-color);
            cursor: pointer;
        }

        .access-picker-result:first-child,
        .access-member-row:first-child {
            border-top: 0;
        }

        .access-picker-result:hover {
            background: var(--primary-bg);
        }

        .access-picker-result > span {
            min-width: 0;
        }

        .access-picker-result em {
            flex: 0 0 auto;
            color: var(--text-muted);
            font-size: 0.72rem;
            font-style: normal;
            text-align: right;
        }

        .access-picker-empty {
            padding: 1rem;
            color: var(--text-muted);
            font-size: 0.82rem;
            text-align: center;
        }

        .access-member-list-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin: 16px 0 8px;
            color: var(--text-color);
            font-size: 0.82rem;
        }

        .access-member-list-heading span {
            color: var(--text-muted);
            font-size: 0.75rem;
        }

        .access-member-row {
            cursor: default;
        }

        .access-dialog-status {
            min-height: 1.2em;
            margin: 10px 0 0;
            color: var(--text-muted);
            font-size: 0.78rem;
        }

        .access-form-stack {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .access-form-stack .form-label {
            margin: 4px 0 0;
        }

        .access-loading-state,
        .access-error-state {
            padding: 1.5rem;
            color: var(--text-muted);
            text-align: center;
        }

        .access-error-state {
            color: #b33a36;
        }

        @media (max-width: 768px) {
            #access-control-root .access-control-intro,
            #access-control-root .access-control-section {
                padding: 1rem;
            }

            #access-control-root .access-summary-table th:nth-child(2),
            #access-control-root .access-summary-table td:nth-child(2) {
                display: none;
            }

            .access-control-dialog {
                width: 100vw;
                max-width: 100vw;
                max-height: 92vh;
                margin: auto 0 0;
                border-radius: var(--radius-md) var(--radius-md) 0 0;
            }

            .access-control-dialog-shell {
                max-height: 92vh;
            }

            .access-control-dialog-footer {
                align-items: stretch;
                flex-direction: column;
            }

            .access-dialog-actions {
                justify-content: stretch;
            }

            .access-dialog-actions .btn {
                flex: 1;
            }

            .access-mode-options,
            .access-picker-summary {
                grid-template-columns: 1fr;
            }

            .access-chip-list {
                justify-content: flex-start;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            .access-control-dialog,
            .access-control-dialog::backdrop {
                transition: none;
            }
        }

        .app-screen {
            display: none;
        }

        .app-screen.active {
            display: block;
            animation: fadeIn 0.4s ease;
        }

        /* Login Screen */
        .login-wrapper {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #002c52 0%, #004b87 50%, #f26522 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            padding: 1.5rem;
        }

        .login-card {
            width: 100%;
            max-width: 480px;
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.4);
            border-radius: var(--radius-lg);
            padding: 2.5rem;
            box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
            text-align: center;
        }

        [data-theme="dark"] .login-card {
            background: rgba(20, 28, 42, 0.9);
            border: 1px solid rgba(255, 255, 255, 0.05);
        }

        .login-logo {
            font-size: 2.5rem;
            font-weight: 800;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }

        .login-subtitle {
            color: var(--text-muted);
            margin-bottom: 2rem;
            font-size: 0.95rem;
        }

        .role-selector {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-bottom: 1.5rem;
        }

        .role-btn {
            padding: 12px 8px;
            border: 2px solid var(--border-color);
            border-radius: var(--radius-sm);
            background: var(--bg-input);
            color: var(--text-main);
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all var(--transition-fast);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .role-btn i {
            font-size: 1.5rem;
        }

        .role-btn:hover {
            border-color: var(--primary-light);
            background: rgba(13, 110, 253, 0.02);
        }

        .role-btn.active {
            border-color: var(--primary);
            background: rgba(0, 75, 135, 0.08);
            color: var(--primary);
        }

        .search-select-container {
            position: relative;
            text-align: left;
        }

        .search-input {
            width: 100%;
            position: relative;
        }

        .search-results {
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            max-height: 200px;
            overflow-y: auto;
            background: var(--bg-input);
            border: 1px solid var(--border-color);
            border-top: none;
            border-radius: 0 0 var(--radius-sm) var(--radius-sm);
            z-index: 100;
            display: none;
            box-shadow: var(--shadow-md);
        }

        .search-item {
            padding: 10px 14px;
            cursor: pointer;
            transition: background var(--transition-fast);
            font-size: 0.9rem;
        }

        .search-item:hover {
            background-color: var(--border-color);
        }

        .search-item .sub {
            font-size: 0.75rem;
            color: var(--text-muted);
            display: block;
        }

        .user-bar {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 0.95rem;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
        }

        /* Form Wizard */
        .wizard-steps {
            display: flex;
            justify-content: space-between;
            margin-bottom: 2rem;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 1rem;
        }

        .wizard-step {
            flex: 1;
            text-align: center;
            color: var(--text-muted);
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            padding-bottom: 0.5rem;
            border-bottom: 3px solid transparent;
            transition: all var(--transition-fast);
        }

        .wizard-step.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
        }

        .wizard-step.completed {
            color: var(--box-star-text);
        }

        .wizard-tab {
            display: none;
        }

        .wizard-tab.active {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        /* Scoring Indicator */
        .score-indicator-card {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
            padding: 1.5rem;
            border-radius: var(--radius-md);
            margin-bottom: 2rem;
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1.5rem;
            align-items: center;
            text-align: center;
        }

        .score-circle {
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            width: 75px;
            height: 75px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin: 0 auto;
        }

        .score-value {
            font-size: 1.35rem;
            font-weight: 700;
        }

        .score-label {
            font-size: 0.7rem;
            opacity: 0.8;
        }

        .box-badge {
            background: var(--accent);
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: 700;
            display: inline-block;
            margin-top: 8px;
            font-size: 0.85rem;
        }

        /* 9-Box Grid styles */
        .grid-9box {
            display: grid;
            grid-template-columns: 40px repeat(3, 1fr);
            grid-template-rows: repeat(3, 1fr) 40px;
            gap: 12px;
            aspect-ratio: 1.25;
            width: 100%;
            margin-bottom: 2rem;
        }

        .y-axis-label {
            grid-column: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            writing-mode: vertical-rl;
            transform: rotate(180deg);
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            font-size: 0.8rem;
        }

        .x-axis-label {
            grid-row: 4;
            grid-column: 2 / span 3;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            font-size: 0.8rem;
            margin-top: 8px;
        }

        .grid-cell {
            border: 2px solid var(--border-color);
            border-radius: var(--radius-sm);
            padding: 12px;
            display: flex;
            flex-direction: column;
            transition: all var(--transition-fast);
            position: relative;
            background: var(--bg-card);
            overflow-y: auto;
            min-height: 100px;
        }

        .grid-cell:hover {
            transform: translateY(-4px);
            box-shadow: var(--shadow-md);
            border-color: var(--primary);
        }

        .grid-cell-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
            border-bottom: 1px dashed var(--border-color);
            padding-bottom: 4px;
        }

        .grid-cell-title {
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
        }

        .grid-cell-action {
            font-size: 0.65rem;
            color: var(--text-muted);
        }

        .grid-cell-content {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            align-content: flex-start;
            flex: 1;
        }

        .employee-dot {
            padding: 4px 8px;
            border-radius: 12px;
            background: var(--primary);
            color: white;
            font-size: 0.72rem;
            font-weight: 600;
            cursor: pointer;
            transition: all var(--transition-fast);
        }

        .employee-dot:hover {
            transform: scale(1.1);
            background: var(--accent);
        }

        .employee-dot.dot-under6m {
            background: linear-gradient(135deg, #ff9800, #ef6c00);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        /* 9-box cell styling overrides */
        .cell-star { background: var(--box-star); border-color: var(--box-star-border); color: var(--box-star-text); }
        .cell-high { background: var(--box-high); border-color: var(--box-high-border); color: var(--box-high-text); }
        .cell-core { background: var(--box-core); border-color: var(--box-core-border); color: var(--box-core-text); }
        .cell-under { background: var(--box-under); border-color: var(--box-under-border); color: var(--box-under-text); }
        .cell-warn { background: var(--box-warn); border-color: var(--box-warn-border); color: var(--box-warn-text); }
        .cell-risk { background: var(--box-risk); border-color: var(--box-risk-border); color: var(--box-risk-text); }

        .analytics-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .analytics-card {
            padding: 1.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .analytics-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            background: rgba(0, 75, 135, 0.1);
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }

        .analytics-value {
            font-size: 1.5rem;
            font-weight: 700;
            line-height: 1.2;
        }

        .analytics-label {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .side-details {
            position: fixed;
            top: 0;
            right: -450px;
            width: 450px;
            height: 100%;
            background: var(--bg-header);
            border-left: 1px solid var(--border-color);
            box-shadow: var(--shadow-lg);
            transition: right var(--transition-normal);
            z-index: 105;
            padding: 2rem;
            overflow-y: auto;
        }

        .side-details.active {
            right: 0;
        }

        .close-btn {
            position: absolute;
            top: 1.5rem;
            right: 1.5rem;
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--text-muted);
        }

        .side-title {
            font-size: 1.25rem;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 0.75rem;
            color: var(--primary);
        }

        .detail-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.75rem;
            font-size: 0.9rem;
        }

        .detail-label {
            color: var(--text-muted);
            font-weight: 500;
        }

        .detail-val {
            font-weight: 600;
            text-align: right;
        }

        .comment-box {
            background: var(--bg-main);
            border-radius: var(--radius-sm);
            padding: 12px;
            font-size: 0.85rem;
            margin-top: 0.5rem;
            border-left: 3px solid var(--primary);
        }

        .slider-container {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .slider-value-display {
            font-size: 1.15rem;
            font-weight: 700;
            color: var(--primary);
            width: 35px;
            text-align: right;
        }

        input[type="range"] {
            flex: 1;
            height: 6px;
            background: var(--border-color);
            border-radius: 3px;
            outline: none;
            -webkit-appearance: none;
        }

        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--primary);
            cursor: pointer;
            transition: transform 0.1s;
        }

        .offline-banner {
            background-color: var(--accent);
            color: white;
            text-align: center;
            font-size: 0.8rem;
            font-weight: 700;
            padding: 4px;
            z-index: 1000;
        }

        .criteria-card {
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            background: var(--bg-input);
            padding: 1rem;
            margin-bottom: 1rem;
        }

        .criteria-header {
            display: flex;
            justify-content: space-between;
            font-weight: 600;
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
            color: var(--primary);
        }

        .criteria-desc {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-bottom: 0.75rem;
        }

        /* Thank You Modal Overlay */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }
        .modal-overlay.show {
            opacity: 1;
            pointer-events: auto;
        }
        .modal-overlay .modal-content {
            background: var(--bg-card);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            padding: 3rem 2rem;
            max-width: 500px;
            width: 90%;
            text-align: center;
            box-shadow: var(--shadow-lg);
            transform: scale(0.9);
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .modal-overlay.show .modal-content {
            transform: scale(1);
        }
        .success-icon-container {
            display: flex;
            justify-content: center;
            margin-bottom: 1.5rem;
        }
        .animated-check {
            font-size: 5rem;
            color: var(--accent);
            animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
        }
        @keyframes scaleIn {
            0% { transform: scale(0); opacity: 0; }
            100% { transform: scale(1); opacity: 1; }
        }

        /* ========== AI ADVISOR CHATBOT ========== */
        .chatbot-container {
            max-width: 800px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            height: 520px;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            overflow: hidden;
        }
        .chatbot-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 1rem 1.25rem;
            background: linear-gradient(135deg, var(--primary), var(--primary-light, #1a6eb5));
            border-radius: var(--radius-md) var(--radius-md) 0 0;
            color: white;
        }
        .chatbot-avatar {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: rgba(255,255,255,0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            backdrop-filter: blur(4px);
        }
        .chatbot-name {
            font-weight: 700;
            font-size: 1rem;
        }
        .chatbot-status {
            font-size: 0.75rem;
            opacity: 0.85;
        }
        .chatbot-progress {
            padding: 0.5rem 1.25rem;
            background: var(--bg-card);
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .chatbot-progress-bar {
            flex: 1;
            height: 6px;
            background: rgba(0,0,0,0.06);
            border-radius: 3px;
            overflow: hidden;
        }
        .chatbot-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), var(--accent));
            border-radius: 3px;
            transition: width 0.5s ease;
        }
        .chatbot-progress-text {
            font-size: 0.75rem;
            color: var(--text-muted);
            white-space: nowrap;
        }
        .chatbot-messages {
            flex: 1;
            overflow-y: auto;
            padding: 1.25rem;
            display: flex;
            flex-direction: column;
            gap: 12px;
            background: var(--bg-main);
            min-height: 0;
        }
        .chat-bubble {
            max-width: 85%;
            padding: 0.85rem 1.1rem;
            border-radius: 16px;
            font-size: 0.88rem;
            line-height: 1.55;
            animation: bubbleIn 0.35s ease both;
        }
        @keyframes bubbleIn {
            0% { opacity: 0; transform: translateY(12px) scale(0.95); }
            100% { opacity: 1; transform: translateY(0) scale(1); }
        }
        .chat-bubble.ai {
            align-self: flex-start;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-bottom-left-radius: 4px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }
        .chat-bubble.user {
            align-self: flex-end;
            background: linear-gradient(135deg, var(--primary), #1a6eb5);
            color: white;
            border-bottom-right-radius: 4px;
        }
        .chat-bubble .bubble-label {
            font-size: 0.68rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 4px;
            opacity: 0.7;
        }
        .chat-bubble.ai .bubble-label { color: var(--primary); }
        .chat-bubble.user .bubble-label { color: rgba(255,255,255,0.8); }
        .typing-indicator {
            display: flex;
            gap: 4px;
            padding: 8px 0;
        }
        .typing-indicator span {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--primary);
            animation: typingBounce 1.4s infinite ease-in-out both;
        }
        .typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
        .typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
        @keyframes typingBounce {
            0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
            40% { transform: scale(1); opacity: 1; }
        }
        .chatbot-input-area {
            display: flex;
            gap: 8px;
            padding: 1rem 1.25rem;
            background: var(--bg-card);
            border-top: 1px solid var(--border-color);
            flex-shrink: 0;
        }
        .chatbot-input-area textarea {
            flex: 1;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 10px 14px;
            font-size: 0.88rem;
            resize: none;
            background: var(--bg-main);
            color: var(--text-main);
            font-family: inherit;
            min-height: 44px;
            max-height: 100px;
        }
        .chatbot-input-area textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(0,75,135,0.12);
        }
        .chatbot-send-btn {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary), var(--accent));
            color: white;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            transition: transform 0.2s, box-shadow 0.2s;
            flex-shrink: 0;
        }
        .chatbot-send-btn:hover {
            transform: scale(1.08);
            box-shadow: 0 3px 12px rgba(0,75,135,0.25);
        }
        .chatbot-send-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            transform: none;
        }

        /* AI Analysis Result Card */
        .ai-advisor-result {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            margin-top: 1.5rem;
            overflow: hidden;
        }
        .ai-advisor-result-header {
            background: linear-gradient(135deg, var(--primary), #1a6eb5);
            color: white;
            padding: 1rem 1.25rem;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .ai-advisor-result-body {
            padding: 1.25rem;
        }
        .ai-dim-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 10px;
            margin: 1rem 0;
        }
        .ai-dim-card {
            background: var(--bg-main);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            padding: 0.75rem;
            text-align: center;
        }
        .ai-dim-card .dim-label {
            font-size: 0.72rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.3px;
            margin-bottom: 4px;
        }
        .ai-dim-card .dim-score {
            font-size: 1.4rem;
            font-weight: 700;
        }
        .ai-dim-card .dim-bar {
            height: 4px;
            background: rgba(0,0,0,0.06);
            border-radius: 2px;
            margin-top: 6px;
            overflow: hidden;
        }
        .ai-dim-card .dim-bar-fill {
            height: 100%;
            border-radius: 2px;
            transition: width 0.6s ease;
        }
        .ai-risk-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 12px;
            border-radius: 16px;
            font-size: 0.78rem;
            font-weight: 600;
        }
        .ai-risk-low { background: rgba(46,125,50,0.1); color: #2e7d32; }
        .ai-risk-medium { background: rgba(255,152,0,0.1); color: #ef6c00; }
        .ai-risk-high { background: rgba(198,40,40,0.1); color: #c62828; }
        .ai-rec-list {
            list-style: none;
            padding: 0;
            margin: 0.5rem 0 0;
        }
        .ai-rec-list li {
            padding: 8px 12px;
            border-left: 3px solid var(--primary);
            margin-bottom: 6px;
            font-size: 0.85rem;
            background: var(--bg-main);
            border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        }
        .ai-rec-list li.urgent { border-left-color: #c62828; }
        .ai-rec-list li.positive { border-left-color: #2e7d32; }
        .ai-rec-list li.digital { border-left-color: #7b1fa2; }
        .chatbot-complete-banner {
            text-align: center;
            padding: 2rem;
            background: linear-gradient(135deg, rgba(46,125,50,0.05), rgba(46,125,50,0.12));
            border: 1px solid rgba(46,125,50,0.2);
            border-radius: var(--radius-md);
            margin-bottom: 1rem;
        }
        .chatbot-complete-banner i {
            font-size: 3rem;
            color: #2e7d32;
            margin-bottom: 0.5rem;
        }

        /* AI Interview Styles */
        .ai-interview-container {
            display: grid;
            grid-template-columns: 1fr;
            gap: 2rem;
        }
        @media (min-width: 992px) {
            .ai-interview-container {
                grid-template-columns: 2fr 1fr;
            }
        }
        .ai-chat-box {
            display: flex;
            flex-direction: column;
            height: 600px;
            background: var(--bg-card);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-color);
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }
        .ai-chat-header {
            padding: 1.25rem;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid rgba(255,255,255,0.08);
        }
        .ai-avatar-animated {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent) 0%, #ff7a45 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: white;
            position: relative;
            box-shadow: 0 4px 10px rgba(242,101,34,0.3);
        }
        .ai-avatar-animated.thinking::after {
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 3px solid var(--accent);
            animation: pulse-ring 1.5s cubic-bezier(0.215, 0.610, 0.355, 1) infinite;
        }
        @keyframes pulse-ring {
            0% { transform: scale(0.95); opacity: 0.8; }
            100% { transform: scale(1.4); opacity: 0; }
        }
        .ai-timer-wrapper {
            background: rgba(0,0,0,0.03);
            padding: 0.75rem 1.25rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid var(--border-color);
            font-size: 0.88rem;
        }
        .ai-timer-bar {
            flex: 1;
            height: 6px;
            background: #e2e8f0;
            border-radius: 3px;
            margin: 0 15px;
            overflow: hidden;
        }
        .ai-timer-fill {
            height: 100%;
            width: 100%;
            background: linear-gradient(90deg, #4caf50, #81c784);
            border-radius: 3px;
            transition: width 1s linear, background-color 0.5s ease;
        }
        .ai-timer-fill.warn {
            background: linear-gradient(90deg, #ff9800, #ffb74d);
        }
        .ai-timer-fill.danger {
            background: linear-gradient(90deg, #f44336, #e57373);
            animation: pulse-timer-danger 1s infinite alternate;
        }
        @keyframes pulse-timer-danger {
            0% { opacity: 0.7; }
            100% { opacity: 1; }
        }
        .ai-chat-messages {
            flex: 1;
            padding: 1.5rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            background: var(--bg-main);
        }
        .ai-message {
            max-width: 75%;
            padding: 1rem;
            border-radius: 12px;
            font-size: 0.94rem;
            line-height: 1.5;
            animation: slide-up 0.3s ease;
        }
        @keyframes slide-up {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .ai-message.agent {
            background: var(--bg-card);
            color: var(--text-main);
            align-self: flex-start;
            border-bottom-left-radius: 2px;
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-sm);
        }
        .ai-message.employee {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
            color: white;
            align-self: flex-end;
            border-bottom-right-radius: 2px;
            box-shadow: 0 4px 10px rgba(0,75,135,0.15);
        }
        .ai-chat-input-wrapper {
            padding: 1rem 1.25rem;
            background: var(--bg-card);
            border-top: 1px solid var(--border-color);
            display: flex;
            gap: 12px;
            align-items: center;
        }
        .ai-chat-input {
            flex: 1;
            padding: 10px 14px;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            background: var(--bg-input);
            color: var(--text-main);
            outline: none;
            resize: none;
            font-family: var(--font-body);
            font-size: 0.95rem;
            min-height: 46px;
            height: 46px;
            max-height: 100px;
            box-sizing: border-box;
            transition: border-color var(--transition-fast);
        }
        .ai-chat-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(0,75,135,0.12);
        }
        .ai-send-btn {
            width: 46px;
            height: 46px;
            border-radius: 8px;
            background: var(--primary);
            color: white;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            cursor: pointer;
            transition: all var(--transition-fast);
        }
        .ai-send-btn:hover {
            background: var(--primary-dark);
            transform: translateY(-2px);
        }
        .ai-send-btn:disabled {
            background: #e2e8f0;
            color: #a0aec0;
            cursor: not-allowed;
            transform: none;
        }

        /* Consent & Welcome styling */
        .ai-consent-card {
            max-width: 650px;
            margin: 2rem auto;
            padding: 2.5rem;
            background: var(--bg-card);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-lg);
            text-align: center;
        }

        /* Modals and Reports Viewer */
        .modal-overlay-custom {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.5);
            backdrop-filter: blur(8px);
            z-index: 1100;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 2rem;
        }
        .modal-overlay-custom.active {
            display: flex;
        }
        .modal-content-custom {
            width: 100%;
            max-width: 900px;
            max-height: 85vh;
            background: var(--bg-card);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-lg);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            animation: fadeIn 0.3s ease;
        }
        .modal-header-custom {
            padding: 1.25rem 2rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--bg-header);
        }
        .modal-body-custom {
            flex: 1;
            padding: 2rem;
            overflow-y: auto;
            background: var(--bg-main);
        }
        .modal-footer-custom {
            padding: 1.25rem 2rem;
            border-top: 1px solid var(--border-color);
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            background: var(--bg-header);
        }

        /* Report Layout in Modal */
        .report-document {
            background: white;
            color: #2b3a4a;
            padding: 3rem;
            border-radius: var(--radius-sm);
            box-shadow: 0 4px 20px rgba(0,0,0,0.05);
            font-family: var(--font-body);
            line-height: 1.7;
        }
        [data-theme="dark"] .report-document {
            background: #1e293b;
            color: #f1f5f9;
        }
        .report-document h1 {
            font-family: var(--font-heading);
            color: var(--primary);
            border-bottom: 2px solid var(--primary);
            padding-bottom: 8px;
            margin-bottom: 1.5rem;
            font-size: 2rem;
            text-align: center;
        }
        .report-document h2 {
            font-family: var(--font-heading);
            color: var(--accent);
            margin: 2rem 0 1rem 0;
            font-size: 1.4rem;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 4px;
        }
        .report-document h3 {
            font-size: 1.1rem;
            color: var(--primary);
            margin: 1.2rem 0 0.6rem 0;
        }
        .report-document table {
            margin: 1.5rem 0;
            width: 100%;
            border-collapse: collapse;
        }
        .report-document th {
            background: rgba(0,75,135,0.08);
            font-weight: 700;
        }
        .report-document td, .report-document th {
            border: 1px solid var(--border-color);
            padding: 10px 14px;
        }

        /* Radar/Score bars on Report */
        .report-score-bar-container {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 8px;
        }
        .report-score-label {
            width: 160px;
            font-weight: 600;
            font-size: 0.9rem;
        }
        .report-score-track {
            flex: 1;
            height: 12px;
            background: #f1f5f9;
            border-radius: 6px;
            overflow: hidden;
            border: 1px solid rgba(0,0,0,0.05);
        }
        .report-score-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
            border-radius: 6px;
        }
        .report-score-val {
            width: 30px;
            font-weight: 700;
            text-align: right;
            color: var(--primary);
        }

        /* Org Chart Custom Styles */
        .org-chart-container {
            display: flex;
            gap: 1.5rem;
            height: calc(100vh - 180px);
            overflow: hidden;
        }
        .org-chart-tree-panel {
            flex: 1;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            padding: 1.5rem;
            overflow: auto;
            position: relative;
            display: flex;
            flex-direction: column;
        }
        .org-chart-detail-panel {
            width: 320px;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            padding: 1.5rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
            box-shadow: var(--shadow-sm);
        }
        .org-tree-wrapper {
            margin: auto;
            min-width: fit-content;
            padding: 20px;
        }
        .org-tree, .org-tree ul, .org-tree li {
            list-style: none;
            margin: 0;
            padding: 0;
            position: relative;
        }
        .org-tree {
            display: flex;
            justify-content: center;
        }
        .org-tree ul {
            display: flex;
            justify-content: center;
            padding-top: 24px;
        }
        .org-tree ul::before {
            content: '';
            position: absolute;
            top: 0;
            left: 50%;
            border-left: 2px solid var(--border-color);
            width: 0;
            height: 24px;
        }
        .org-tree li {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 0 12px;
            position: relative;
        }
        .org-tree li::before, .org-tree li::after {
            content: '';
            position: absolute;
            top: 0;
            right: 50%;
            border-top: 2px solid var(--border-color);
            width: 50%;
            height: 24px;
        }
        .org-tree li::after {
            right: auto;
            left: 50%;
            border-left: 2px solid var(--border-color);
        }
        .org-tree li:only-child::after, .org-tree li:only-child::before {
            display: none;
        }
        .org-tree li:only-child {
            padding-top: 0;
        }
        .org-tree li:first-child::before, .org-tree li:last-child::after {
            border: 0 none;
        }
        .org-tree li:last-child::before {
            border-right: 2px solid var(--border-color);
            border-radius: 0 5px 0 0;
        }
        .org-tree li:first-child::after {
            border-radius: 5px 0 0 0;
        }
        .org-node-card {
            background: var(--bg-input);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 10px 14px;
            width: 190px;
            position: relative;
            cursor: pointer;
            transition: all 0.2s ease-in-out;
            box-shadow: 0 2px 6px rgba(0,0,0,0.02);
            text-align: center;
        }
        .org-node-card:hover {
            transform: translateY(-2px);
            border-color: var(--primary-light);
            box-shadow: 0 4px 12px rgba(0,75,135,0.1);
        }
        .org-node-card.active {
            border-color: var(--primary) !important;
            background: rgba(0,75,135,0.04);
            box-shadow: 0 4px 15px rgba(0,75,135,0.15);
        }
        .org-node-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary-light);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.85rem;
            margin: 0 auto 6px auto;
        }
        .org-node-name {
            font-weight: 600;
            font-size: 0.88rem;
            color: var(--text-color);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .org-node-title {
            font-size: 0.72rem;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-top: 2px;
        }
        .org-node-dept {
            font-size: 0.68rem;
            background: rgba(242,101,34,0.08);
            color: var(--accent);
            padding: 2px 6px;
            border-radius: 4px;
            display: inline-block;
            margin-top: 4px;
            font-weight: 600;
        }
        .org-node-card.level-L1 .org-node-avatar { background: #e91e63; }
        .org-node-card.level-L1 { border-left: 4px solid #e91e63; }
        .org-node-card.level-L2 .org-node-avatar { background: #9c27b0; }
        .org-node-card.level-L2 { border-left: 4px solid #9c27b0; }
        .org-node-card.level-L3 .org-node-avatar { background: #3f51b5; }
        .org-node-card.level-L3 { border-left: 4px solid #3f51b5; }
        .org-node-card.level-L4 .org-node-avatar { background: #009688; }
        .org-node-card.level-L4 { border-left: 4px solid #009688; }
        .org-node-card.level-L5 .org-node-avatar { background: #757575; }
        .org-node-card.level-L5 { border-left: 4px solid #757575; }

        .org-node-toggle {
            position: absolute;
            bottom: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            cursor: pointer;
            z-index: 10;
            box-shadow: 0 1px 4px rgba(0,0,0,0.1);
            color: var(--text-muted);
            transition: all 0.2s;
        }
        .org-node-toggle:hover {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        /* Floating AI Agent Widget */
        .floating-agent-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            font-family: inherit;
        }

        .agent-avatar-wrapper {
            position: relative;
            cursor: pointer;
            transition: transform 0.3s ease;
        }

        .agent-avatar-img {
            width: 80px;
            height: auto;
            filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
            animation: agent-bobbing 3s ease-in-out infinite;
            transform-origin: bottom center;
            display: block;
        }

        .agent-avatar-wrapper:hover .agent-avatar-img {
            transform: scale(1.08);
            animation: agent-wiggle 0.5s ease-in-out infinite alternate;
        }

        @keyframes agent-bobbing {
            0%, 100% {
                transform: translateY(0) scaleY(1);
            }
            50% {
                transform: translateY(-8px) scaleY(1.02);
            }
        }

        @keyframes agent-wiggle {
            0% { transform: rotate(-3deg) scale(1.08); }
            100% { transform: rotate(3deg) scale(1.08); }
        }

        .agent-bubble {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(0, 75, 135, 0.15);
            color: #333;
            padding: 8px 12px;
            border-radius: 12px 12px 0 12px;
            font-size: 0.8rem;
            font-weight: 600;
            max-width: 200px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            margin-bottom: 8px;
            animation: float-bubble 4s ease-in-out infinite;
            position: relative;
            pointer-events: none;
        }

        .agent-bubble::after {
            content: '';
            position: absolute;
            bottom: -6px;
            right: 15px;
            border-width: 6px 6px 0;
            border-style: solid;
            border-color: rgba(255, 255, 255, 0.95) transparent;
            display: block;
            width: 0;
        }

        @keyframes float-bubble {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-4px); }
        }

        /* Chat Window Panel */
        .agent-chat-window {
            position: fixed;
            bottom: 125px;
            right: 20px;
            width: 360px;
            height: 480px;
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.5);
            box-shadow: 0 12px 40px rgba(0, 75, 135, 0.15);
            border-radius: 16px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            z-index: 10000;
            transform: translateY(20px) scale(0.95);
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            font-family: inherit;
        }

        .agent-chat-window.active {
            transform: translateY(0) scale(1);
            opacity: 1;
            pointer-events: auto;
        }

        .agent-chat-header {
            background: linear-gradient(135deg, #004b87, #002d54);
            color: white;
            padding: 12px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .agent-chat-header-info {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .agent-chat-header-info i {
            font-size: 1.3rem;
        }

        .agent-chat-close {
            cursor: pointer;
            font-size: 1.2rem;
            opacity: 0.8;
            transition: opacity 0.2s;
        }

        .agent-chat-close:hover {
            opacity: 1;
        }

        .agent-chat-messages {
            flex: 1;
            padding: 16px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 12px;
            background: rgba(248, 249, 250, 0.4);
        }

        .agent-msg {
            max-width: 80%;
            padding: 10px 14px;
            border-radius: 12px;
            font-size: 0.85rem;
            line-height: 1.4;
            word-break: break-word;
        }

        .agent-msg.bot {
            background: rgba(0, 75, 135, 0.05);
            color: #333;
            align-self: flex-start;
            border-radius: 12px 12px 12px 0;
            border: 1px solid rgba(0, 75, 135, 0.08);
        }

        .agent-msg.user {
            background: #004b87;
            color: white;
            align-self: flex-end;
            border-radius: 12px 12px 0 12px;
        }

        .agent-chat-input-area {
            padding: 12px;
            border-top: 1px solid rgba(0, 0, 0, 0.06);
            display: flex;
            gap: 8px;
            background: rgba(255, 255, 255, 0.8);
        }

        .agent-chat-input {
            flex: 1;
            border: 1px solid rgba(0, 75, 135, 0.15);
            background: rgba(255, 255, 255, 0.8);
            border-radius: 8px;
            padding: 8px 12px;
            font-size: 0.85rem;
            outline: none;
            transition: border-color 0.2s;
            color: #333;
        }

        .agent-chat-input:focus {
            border-color: #004b87;
        }

        .agent-chat-send {
            background: #004b87;
            color: white;
            border: none;
            border-radius: 8px;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background 0.2s;
        }

        .agent-chat-send:hover {
            background: #002d54;
        }

        .agent-typing {
            display: flex;
            gap: 4px;
            align-items: center;
            padding: 10px 14px;
            background: rgba(0, 75, 135, 0.05);
            border-radius: 12px 12px 12px 0;
            align-self: flex-start;
            width: fit-content;
        }

        .agent-typing span {
            width: 6px;
            height: 6px;
            background-color: #004b87;
            border-radius: 50%;
            display: inline-block;
            animation: agent-bounce 1.4s infinite both;
        }

        .agent-typing span:nth-child(1) { animation-delay: -0.32s; }
        .agent-typing span:nth-child(2) { animation-delay: -0.16s; }

        @keyframes agent-bounce {
            0%, 80%, 100% { transform: scale(0); }
            40% { transform: scale(1); }
        }

        /* Admin Accounts Screen Styles */
        .accounts-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 0.5rem;
        }
        .accounts-tab-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            padding: 8px 16px;
            font-weight: 600;
            cursor: pointer;
            border-radius: 6px;
            transition: all 0.2s;
        }
        .accounts-tab-btn:hover {
            color: var(--primary);
            background: rgba(0, 75, 135, 0.05);
        }
        .accounts-tab-btn.active {
            background: var(--primary-bg);
            color: var(--primary);
        }
        .accounts-tab-content {
            display: none;
        }
        .accounts-tab-content.active {
            display: block;
        }
        .admin-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
        }
        .admin-table th {
            text-align: left;
            padding: 12px;
            background: rgba(0, 75, 135, 0.05);
            color: var(--text-color);
            font-weight: 600;
            border-bottom: 2px solid var(--border-color);
        }
        .admin-table td {
            padding: 12px;
            border-bottom: 1px solid var(--border-color);
            color: var(--text-color);
        }
        .sso-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        .sso-badge.linked {
            background: rgba(46, 125, 50, 0.1);
            color: #2e7d32;
        }
        .sso-badge.local {
            background: rgba(239, 108, 0, 0.1);
            color: #ef6c00;
        }
        .sso-badge.active {
            background: rgba(13, 110, 253, 0.1);
            color: #0d6efd;
            box-shadow: 0 0 8px rgba(13, 110, 253, 0.2);
        }
        .admin-action-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 4px;
            transition: all 0.2s;
            font-size: 1.1rem;
        }
        .admin-action-btn.edit {
            color: var(--primary);
        }
        .admin-action-btn.edit:hover {
            background: var(--primary-bg);
        }
        .admin-action-btn.delete {
            color: #c62828;
        }
        .admin-action-btn.delete:hover {
            background: rgba(198, 40, 40, 0.1);
        }
        .admin-action-btn.clear {
            color: #ef6c00;
        }
        .admin-action-btn.clear:hover {
            background: rgba(239, 108, 0, 0.1);
        }

        /* MCP & Agent Logs Additional Styles */
        .mcp-pulse-container {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .mcp-pulse {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            display: inline-block;
        }
        .mcp-pulse.online {
            background-color: #2e7d32;
            box-shadow: 0 0 8px #2e7d32;
            animation: pulse-green 2s infinite;
        }
        .mcp-pulse.offline {
            background-color: #c62828;
            box-shadow: 0 0 8px #c62828;
            animation: pulse-red 2s infinite;
        }
        @keyframes pulse-green {
            0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7); }
            70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
            100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
        }
        @keyframes pulse-red {
            0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.7); }
            70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(198, 40, 40, 0); }
            100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(198, 40, 40, 0); }
        }
        .mcp-tool-category {
            margin-top: 1.5rem;
        }
        .mcp-tool-category h4 {
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 6px;
            color: var(--primary);
            font-size: 0.95rem;
            margin-bottom: 10px;
        }
        .mcp-tool-card {
            background: rgba(0, 0, 0, 0.02);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 10px 14px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .mcp-tool-card:hover {
            background: rgba(0, 75, 135, 0.03);
            border-color: var(--primary);
        }
        .mcp-tool-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .mcp-tool-name {
            font-weight: 700;
            font-family: monospace;
            color: var(--text-color);
        }
        .mcp-tool-permission {
            font-size: 0.75rem;
            color: var(--text-muted);
            background: rgba(0,0,0,0.05);
            padding: 2px 6px;
            border-radius: 4px;
        }
        .mcp-tool-detail {
            display: none;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px dashed var(--border-color);
            font-size: 0.8rem;
        }
        .mcp-tool-detail.active {
            display: block;
        }
        .mcp-tool-schema {
            background: rgba(0, 0, 0, 0.04);
            padding: 8px;
            border-radius: 4px;
            font-family: monospace;
            margin-top: 6px;
            white-space: pre-wrap;
        }
        .log-tag {
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.72rem;
            font-weight: bold;
        }
        .log-tag.allow {
            background: rgba(46, 125, 50, 0.1);
            color: #2e7d32;
        }
        .log-tag.deny {
            background: rgba(198, 40, 40, 0.1);
            color: #c62828;
        }

/* Body-level legacy styles retained during migration. */

                    .conclusion-success { background: #e8f5e9; border: 1px solid #c8e6c9; color: #2e7d32; }
                    .conclusion-warning { background: #fff3e0; border: 1px solid #ffe0b2; color: #ef6c00; }
                    .conclusion-warning-red { background: #fbe9e7; border: 1px solid #ffccbc; color: #d84315; }
                    .conclusion-danger { background: #ffebee; border: 1px solid #ffcdd2; color: #c62828; }
                    .conclusion-neutral { background: #f5f5f5; border: 1px solid #e0e0e0; color: #616161; }

                    .tab-360-content { animation: fadeIn 0.3s ease; }
                    .badge-360-relation { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; display: inline-block; }
                    .relation-self { background: rgba(0, 75, 135, 0.1); color: var(--primary); }
                    .relation-manager { background: rgba(40, 167, 69, 0.1); color: #28a745; }
                    .relation-subordinate { background: rgba(253, 126, 20, 0.1); color: #fd7e14; }

                    #screen-360-eval .glass-panel {
                        padding: 1.5rem 2rem;
                    }
