.topic-sync-button.is-loading i,
#sync-all-mailpro.is-loading i {
    animation: topic-sync-spin 0.8s linear infinite;
}

.topic-sync-running {
    background-color: rgba(52, 152, 219, 0.08);
}

.topic-sync-failed {
    background-color: rgba(230, 126, 34, 0.08);
}

.topic-sync-page-loading {
    overflow: hidden;
}

.topic-sync-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 28, 38, 0.42);
    backdrop-filter: blur(7px);
}

.topic-sync-overlay[hidden] {
    display: none;
}

.topic-sync-loading-panel {
    min-width: min(420px, calc(100vw - 40px));
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
    text-align: center;
}

.topic-sync-loading-panel h2 {
    margin: 12px 0 8px;
}

.topic-sync-loading-panel p {
    margin: 0;
}

.topic-sync-large-spinner {
    display: inline-block;
    color: #696cff;
    font-size: 34px;
    animation: topic-sync-spin 0.8s linear infinite;
}

.topic-last-sync {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.8rem;
}

.topic-last-sync-today {
    color: #198754;
}

.topic-last-sync-old {
    color: #d97706;
}

@keyframes topic-sync-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
/* EAPB Dark Theme CSS */

/* Root Variables */
 :root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2c3e50;
    --danger-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --bg-dark: #1a1a1a;
    --bg-darker: #0f0f0f;
    --bg-light: #2c3e50;
    --bg-lighter: #34495e;
    --text-primary: #ecf0f1;
    --text-secondary: #95a5a6;
    --text-muted: #7f8c8d;
    --border-color: #34495e;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

body.dark-theme {
    background-color: var(--bg-dark);
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 200px);
}

/* Navigation */
.navbar {
    background-color: var(--bg-light);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.nav-brand a:hover {
    color: var(--primary-dark);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: 4px;
}

.nav-menu a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Alerts */
.toast-container {
    position: fixed;
    top: 88px;
    right: 24px;
    z-index: 1100;
    display: flex;
    width: min(380px, calc(100vw - 32px));
    flex-direction: column;
    gap: 12px;
}

.alert {
    position: relative;
    padding: 14px 42px 14px 16px;
    margin: 0;
    border: 1px solid #d9dee3;
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    background: #ffffff;
    display: flex;
    align-items: center;
    box-shadow: 0 5px 15px rgba(67, 89, 113, 0.12);
    animation: toast-slide-in 0.25s ease-out;
    font-size: 13px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.alert-dismissed {
    opacity: 0;
    transform: translateY(-8px);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.35);
}

.modal-dialog {
    width: min(420px, 100%);
    padding: 24px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 36px rgba(31, 41, 55, 0.2);
    color: #566a7f;
}

.modal-dialog h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.topic-update-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
}

.topic-update-list details {
    border-bottom: 1px solid #e7e7eb;
}

.topic-update-page {
    max-width: 1100px;
}

.topic-update-new-card {
    margin-bottom: 20px;
}

.topic-update-title small {
    margin-left: 8px;
    color: #a1acb8;
    font-size: 12px;
    font-weight: 400;
}

.topic-update-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
}

.topic-update-list summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    cursor: pointer;
    list-style: none;
}

.topic-update-list summary::-webkit-details-marker {
    display: none;
}

.topic-update-list summary::after {
    margin-left: auto;
    content: '⌄';
    color: #697a8d;
}

.topic-update-item-new {
    font-weight: 700;
}

.topic-update-list summary small {
    color: #a1acb8;
    font-size: 11px;
    font-weight: 400;
}

.topic-update-list details[open] summary::after {
    content: '⌃';
}

.topic-update-list details p {
    margin: 0 0 12px 24px;
    color: #697a8d;
    font-size: 13px;
}

@media (max-width: 700px) {
    .topic-update-list {
        grid-template-columns: 1fr;
    }
}

@keyframes toast-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes standalone-alert-dismiss {
    0%, 88% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-8px); visibility: hidden; }
}

.login-page .login-box > .alert {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1100;
    width: min(380px, calc(100vw - 32px));
    animation: toast-slide-in 0.25s ease-out, standalone-alert-dismiss 5s 0.25s forwards;
}

.alert-success {
    background-color: #eafaf1;
    border-color: #b8ebcc;
    border-left-color: var(--success-color);
    color: #087443;
}

.alert-danger {
    background-color: #fff0ef;
    border-color: #f5c2bd;
    border-left-color: var(--danger-color);
    color: #b42318;
}

.alert-warning {
    background-color: #fff8e7;
    border-color: #f2d28b;
    border-left-color: var(--warning-color);
    color: #8a6200;
}

.alert-info {
    background-color: #eef7ff;
    border-color: #b9daf5;
    border-left-color: var(--info-color);
    color: #245f8f;
}

.alert-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.alert-close:hover { opacity: 1; }

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.btn-secondary {
    background-color: var(--bg-lighter);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    transition: var(--transition);
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.gdpr-editor-card .card-body {
    padding: 0;
}

.gdpr-policy-editor .ql-toolbar.ql-snow {
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid #e7e7eb;
    background: #f8f9fa;
}

.gdpr-policy-editor .ql-container.ql-snow {
    min-height: 560px;
    border: 0;
    color: #566a7f;
    font-family: inherit;
    font-size: 14px;
}

.gdpr-policy-editor .ql-editor {
    min-height: 560px;
    padding: 24px;
}

.gdpr-policy-editor .ql-editor.ql-blank::before {
    color: #a1acb8;
    font-style: normal;
}

.gdpr-policy-editor .ql-snow .ql-stroke {
    stroke: #566a7f;
}

.gdpr-policy-editor .ql-snow .ql-fill {
    fill: #566a7f;
}

.gdpr-policy-editor .ql-snow .ql-picker {
    color: #566a7f;
}

.gdpr-editor-actions {
    padding: 16px 20px 20px;
    border-top: 1px solid #e7e7eb;
}

.member-topic-summary,
.member-contact-list {
    margin: 12px 0 24px 20px;
}

.member-topic-summary {
    display: block;
}

.member-topic-summary-two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row;
    column-gap: 24px;
}

@media (max-width: 640px) {
    .member-topic-summary-two-columns {
        grid-template-columns: 1fr;
    }
}

.member-topic-summary li {
    margin: 0;
    list-style-type: none;
}

.member-contact-list li {
    margin: 8px 0;
}

.member-contact-list {
    list-style-type: square;
}

.member-thank-you-signoff {
    margin-top: 24px;
}

.member-topic-check {
    display: inline-block;
    width: 24px;
    color: var(--success-color);
    font-size: 10px;
    font-weight: 700;
}

.member-close-button {
    margin-top: 12px;
}

.topic-options,
.topic-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 16px;
}

.admin-member-filter-row {
    display: grid;
    align-items: center;
    gap: 16px;
}

.admin-member-filter-primary-row {
    grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, 1fr));
}

.export-filter-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.export-filter-row-single {
    grid-template-columns: minmax(0, 1fr) auto;
}

.export-filter-row-single .topic-filter-picker {
    max-width: none;
    width: 100%;
}

.export-preview {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e7e7eb;
}

.export-preview h3 {
    margin: 0 0 16px;
    color: #566a7f;
    font-size: 16px;
}

.export-preview-section + .export-preview-section {
    margin-top: 20px;
}

.export-preview-label {
    margin: 0 0 10px;
    color: #566a7f;
    font-size: 14px;
    font-weight: 400;
}

.export-preview-label-selected {
    font-weight: 700;
}

.export-preview-table {
    margin: 0;
}

.export-preview-table td {
    font-size: 13px;
}

.export-preview-number {
    width: 48px;
    color: #697a8d;
    text-align: center;
}

.export-client-errors {
    display: block;
    margin-bottom: 16px;
}

.admin-member-filter-topic-row {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 16px;
}

.admin-member-filter-row .form-group {
    margin: 0;
}

.admin-member-filter-actions {
    margin: 0;
}

.admin-member-filter-actions .member-clear-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    white-space: nowrap;
}

.members-card .member-clear-button {
    border-color: #d9dee3;
    box-sizing: border-box;
}

.member-results-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.member-results-heading h3 {
    flex: 0 0 auto;
    margin: 0;
}

.member-search-input {
    width: 100%;
    min-height: 44px;
    padding-left: 12px !important;
}

.members-card .member-filter-control {
    min-height: 44px;
    border-color: #d9dee3 !important;
    box-sizing: border-box;
}

.members-card .member-filter-control:focus,
.members-card .member-clear-button:focus {
    border-color: #696cff !important;
}

.members-filter-form {
    padding: 16px 0 20px;
    border-bottom: 1px solid #eef0f2;
}

.bulk-topics-card {
    margin-bottom: 20px;
}

.bulk-update-accordion {
    margin-bottom: 20px;
}

.bulk-update-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    border-bottom: 0 !important;
    border-bottom-color: transparent !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.bulk-update-summary::-webkit-details-marker {
    display: none;
}

.bulk-update-summary h3 {
    margin: 0;
}

.bulk-update-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid #566a7f;
    border-bottom: 2px solid #566a7f;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.bulk-update-accordion[open] .bulk-update-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.bulk-update-controls {
    display: grid;
    grid-template-columns: minmax(0, 0.5fr) minmax(0, 1.5fr) minmax(200px, 2fr) auto;
    align-items: start;
    gap: 16px;
    padding: 20px;
}

.bulk-update-controls .bulk-user-picker,
.bulk-update-controls .bulk-topic-picker {
    margin: 0;
}

.bulk-action-control {
    display: flex;
    align-items: stretch;
}

.bulk-action-control .member-filter-control {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
}

.bulk-update-button {
    align-self: stretch;
    min-height: 48px;
    padding-top: 0;
    padding-bottom: 0;
    white-space: nowrap;
}

.bulk-topics-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 20px 20px 0;
}

.bulk-user-picker {
    position: relative;
    margin: 0 20px 20px;
}

.bulk-user-picker-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 48px;
    padding: 6px 10px;
    border: 1px solid #696cff;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}

.bulk-user-search {
    min-width: 120px;
    flex: 1 1 140px;
    padding: 5px 4px;
    border: 0 !important;
    background: transparent !important;
    color: #566a7f !important;
    outline: none;
}

.bulk-user-search:focus {
    box-shadow: none !important;
}

.bulk-user-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.bulk-user-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    border-radius: 4px;
    background: #eef0ff;
    color: #566a7f;
    font-size: 12px;
}

.bulk-user-tag button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #697a8d;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

.bulk-user-avatar {
    display: inline-grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 50%;
    background: #eef0ff;
    color: #696cff;
    font-size: 12px;
    font-weight: 700;
}

.bulk-user-suggestions {
    position: absolute;
    z-index: 10;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: none;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 0;
    border: 1px solid #d9dee3;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 5px 15px rgba(67, 89, 113, 0.12);
}

.bulk-user-picker-control[aria-expanded="true"] + .bulk-user-suggestions {
    display: block;
}

.bulk-user-suggestion {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
    padding: 9px 12px;
    border: 0;
    background: #ffffff;
    color: #566a7f;
    cursor: pointer;
    text-align: left;
}

.bulk-user-suggestion:hover {
    background: #f5f6ff;
}

.bulk-user-suggestion[hidden] {
    display: none;
}

.bulk-user-details {
    display: grid;
    gap: 2px;
}

.bulk-user-details small,
.bulk-user-option small {
    color: #a1acb8;
    font-size: 11px;
}

.bulk-topic-picker {
    position: relative;
}

.bulk-topic-picker-control {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    height: 48px;
    min-height: 48px;
    padding: 5px 9px;
    border: 1px solid #696cff;
    border-radius: 6px;
    background: #ffffff;
}

.bulk-topic-search {
    min-width: 120px;
    flex: 1 1 120px;
    padding: 5px 4px;
    border: 0 !important;
    background: transparent !important;
    color: #566a7f !important;
    outline: none;
}

.bulk-topic-search:focus {
    box-shadow: none !important;
}

.bulk-topic-tags {
    display: flex;
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 5px;
}

.bulk-topic-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 220px;
    padding: 4px 7px;
    border-radius: 4px;
    background: #eef0ff;
    color: #566a7f;
    font-size: 12px;
    white-space: nowrap;
    overflow: visible;
}

.bulk-topic-tag > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bulk-topic-tag button {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #697a8d;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

.bulk-topic-more-wrapper {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.bulk-topic-more {
    display: inline-block;
    padding: 4px 7px;
    border-radius: 4px;
    background: #eef0ff;
    color: #566a7f;
    cursor: default;
    font-size: 12px;
    white-space: nowrap;
}

.bulk-topic-more-tooltip {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    width: max-content;
    max-width: 260px;
    max-height: 220px;
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: 6px;
    background: #566a7f;
    box-shadow: 0 5px 15px rgba(67, 89, 113, 0.2);
    color: #ffffff;
    font-size: 12px;
    line-height: 1.45;
}

.bulk-topic-more-tooltip ul {
    margin: 0;
    padding-left: 16px;
}

.bulk-topic-more-tooltip li + li {
    margin-top: 3px;
}

.bulk-topic-more-wrapper:hover .bulk-topic-more-tooltip,
.bulk-topic-more-wrapper:focus-within .bulk-topic-more-tooltip {
    display: block;
}

.bulk-topic-suggestions {
    position: absolute;
    z-index: 10;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: none;
    max-height: 230px;
    overflow-y: auto;
    padding: 6px 0;
    border: 1px solid #d9dee3;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 5px 15px rgba(67, 89, 113, 0.12);
}

.bulk-topic-picker-control[aria-expanded="true"] + .bulk-topic-suggestions {
    display: block;
}

.bulk-topic-suggestion {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    background: #ffffff;
    color: #566a7f;
    cursor: pointer;
    text-align: left;
}

.bulk-topic-suggestion:hover {
    background: #f5f6ff;
}

.bulk-topic-suggestion[hidden] {
    display: none;
}

.bulk-topics-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px 20px;
}

.bulk-select-all {
    color: #697a8d;
    font-size: 13px;
}

.topic-filter-group {
    margin-top: 4px;
}

.topic-filter-group fieldset {
    padding: 0;
    border: 0;
}

.topic-filter-fieldset {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topic-filter-picker {
    position: relative;
    flex: 1 1 360px;
    min-width: 0;
    max-width: 680px;
}

.admin-member-filter-topic-row .topic-filter-picker {
    width: 100%;
    max-width: none;
}

.topic-filter-picker-control {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-height: 44px;
    padding: 4px 0;
    border: 1px solid #d9dee3;
    border-radius: 6px;
    background: #ffffff;
}

.topic-filter-tags {
    display: flex;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: visible;
    gap: 5px;
}

.topic-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    border-radius: 4px;
    background: #eef0ff;
    color: #566a7f;
    font-size: 12px;
    flex-shrink: 0;
    max-width: 180px;
    white-space: nowrap;
    overflow: visible;
}

.topic-filter-tag > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-filter-tag button {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #697a8d;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

.topic-filter-search {
    min-width: 80px;
    flex: 1 1 140px;
    padding: 5px 12px;
    border: 0 !important;
    background: transparent !important;
    color: #566a7f !important;
    outline: none;
}

.topic-filter-picker-control > .topic-filter-search {
    white-space: nowrap;
    text-overflow: ellipsis;
}

.topic-filter-more-wrapper {
    flex-shrink: 0;
}

.topic-filter-search:focus {
    box-shadow: none !important;
}

.topic-filter-suggestions {
    position: absolute;
    z-index: 10;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: none;
    max-height: 230px;
    overflow-y: auto;
    padding: 6px 0;
    border: 1px solid #d9dee3;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 5px 15px rgba(67, 89, 113, 0.12);
}

.topic-filter-actions {
    display: flex;
    gap: 8px;
    padding: 4px 12px 10px;
    border-bottom: 1px solid #e7e7ef;
}

.topic-filter-action,
.topic-filter-more {
    padding: 4px 7px;
    border: 0;
    border-radius: 4px;
    background: #eef0ff;
    color: #566a7f;
    cursor: pointer;
    font-size: 12px;
}

.topic-filter-more-wrapper {
    position: relative;
    display: inline-flex;
}

.topic-filter-more-tooltip {
    position: absolute;
    z-index: 20;
    bottom: calc(100% + 8px);
    left: 0;
    display: none;
    width: max-content;
    max-width: 320px;
    max-height: 220px;
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: 6px;
    background: #566a7f;
    box-shadow: 0 5px 15px rgba(67, 89, 113, 0.2);
    color: #ffffff;
    font-size: 12px;
    line-height: 1.45;
}

.topic-filter-more-tooltip ul {
    margin: 0;
    padding-left: 16px;
}

.topic-filter-more-tooltip li + li {
    margin-top: 3px;
}

.topic-filter-more-wrapper:hover .topic-filter-more-tooltip,
.topic-filter-more-wrapper:focus-within .topic-filter-more-tooltip {
    display: block;
}

.topic-filter-action:hover,
.topic-filter-more:hover {
    background: #e3e4ff;
    color: #696cff;
}

.topic-filter-action:disabled {
    cursor: default;
    opacity: 0.5;
}

.topic-filter-picker-control[aria-expanded="true"] + .topic-filter-suggestions {
    display: block;
}

.topic-filter-suggestion {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    background: #ffffff;
    color: #566a7f;
    cursor: pointer;
    text-align: left;
}

.topic-filter-suggestion:hover {
    background: #f5f6ff;
}

.topic-filter-suggestion[hidden] {
    display: none;
}

.invite-topic-suggestion,
.manager-topic-suggestion,
.edit-topic-suggestion,
.export-org-suggestion,
.export-topic-suggestion,
.export-org-topic-suggestion,
.settings-topic-suggestion,
.topic-filter-suggestions button[class$="-suggestion"] {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    background: #ffffff;
    color: #566a7f;
    cursor: pointer;
    text-align: left;
}

.invite-topic-suggestion:hover,
.manager-topic-suggestion:hover,
.edit-topic-suggestion:hover,
.export-org-suggestion:hover,
.export-topic-suggestion:hover,
.export-org-topic-suggestion:hover,
.settings-topic-suggestion:hover,
.topic-filter-suggestions button[class$="-suggestion"]:hover {
    background: #f5f6ff;
}

.invite-topic-suggestion[hidden],
.manager-topic-suggestion[hidden],
.edit-topic-suggestion[hidden],
.export-org-suggestion[hidden],
.export-topic-suggestion[hidden],
.export-org-topic-suggestion[hidden],
.settings-topic-suggestion[hidden],
.topic-filter-suggestions button[class$="-suggestion"][hidden] {
    display: none;
}

.topic-filter-options {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
}

.topic-edit-fieldset {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    padding: 0;
}

.topic-edit-fieldset .topic-filter-options {
    flex: 1 1 auto;
    min-width: 0;
}

.topic-filter-legend {
    flex: 0 0 auto;
    margin: 0;
    padding-bottom: 10px;
    color: var(--text-primary);
    font-weight: 500;
}

.member-filter-label {
    color: #566a7f !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

.member-filter-control {
    background: #ffffff !important;
    border: 1px solid #d9dee3 !important;
    border-radius: 6px !important;
    color: #566a7f !important;
}

.member-filter-control:focus {
    border-color: #696cff !important;
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.12) !important;
    outline: none;
}

.profile-created-value {
    margin: 0;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    font-size: 14px;
}

.profile-created-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 20px;
}

.profile-created-row .member-filter-label {
    display: inline;
    margin: 0;
}

.topic-option,
.topic-filter {
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    min-height: 32px;
    padding: 5px 12px;
    box-sizing: border-box;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.topic-filter-options .topic-filter {
    min-height: 0;
    padding: 6px 12px;
    border: 1px solid #263238;
    border-radius: 999px;
    color: #566a7f;
    background: #ffffff;
    font-size: 12px;
    font-weight: 400;
    line-height: 22px;
}

.topic-option input,
.edit-topic-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.topic-visibility-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
}

.topic-visibility-option input {
    position: static;
    width: 16px;
    height: 16px;
    margin: 0;
    opacity: 1;
    pointer-events: auto;
}

.topic-visibility-option:has(input:checked),
.topic-visibility-option:hover {
    color: var(--text-muted);
    border-color: transparent;
    background-color: transparent;
}

.edit-topic-option:has(input:checked) {
    color: #2589d8;
    border-color: #2589d8;
    background-color: #e3f2fd;
}

.topic-filter-options .topic-option.edit-topic-option:has(input:checked) {
    color: #2589d8;
    border-color: #2589d8;
    background-color: #e3f2fd;
}

.topic-option:has(input:checked) {
    color: var(--topic-color, var(--primary-color));
    border-color: var(--topic-color, var(--primary-color));
    background-color: color-mix(in srgb, var(--topic-color, var(--primary-color)) 15%, transparent);
}

.export-topic-fieldset {
    border: 0;
    padding: 0;
}

.topic-filter-options .topic-filter.topic-filter-selected,
.topic-filter-options .topic-filter:hover {
    color: #2589d8;
    border-color: #2589d8;
    background-color: #e3f2fd;
}

.topic-option:hover {
    color: var(--topic-color, var(--primary-color));
    border-color: var(--topic-color, var(--primary-color));
}

.filter-row .form-group input,
.filter-row .form-group select,
.filter-row + .topic-filter-group .topic-filter,
.filter-row ~ .btn {
    min-height: 38px;
    box-sizing: border-box;
}

.filter-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.filter-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    box-sizing: border-box;
}

.member-filter-accordion {
    margin-bottom: 20px;
}

.member-filter-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

.member-filter-accordion-summary::-webkit-details-marker {
    display: none;
}

.member-filter-accordion-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.member-filter-icon {
    font-size: 18px;
    line-height: 1;
}

.member-filter-accordion-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid #566a7f;
    border-bottom: 2px solid #566a7f;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.member-filter-accordion[open] .member-filter-accordion-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.member-add-button {
    min-height: 44px;
    padding: 11px 22px;
    border-radius: 6px;
    background: #696cff;
    box-shadow: 0 3px 8px rgba(105, 108, 255, 0.2);
}

.member-add-button:hover {
    background: #5f61e6;
}

.member-add-manager-button {
    background: #71dd37;
    box-shadow: 0 3px 8px rgba(113, 221, 55, 0.25);
}

.member-add-manager-button:hover {
    background: #64c62f;
}

.mfa-settings {
    margin-bottom: 15px;
}

.mfa-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.mfa-heading-row h4 {
    margin: 0;
}

.mfa-toggle {
    display: inline-flex;
    align-items: center;
    width: 38px;
    height: 22px;
    padding: 2px;
    border-radius: 999px;
    background: #d9dee3;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

.mfa-toggle.is-enabled {
    background: #696cff;
}

.mfa-toggle-handle {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(67, 89, 113, 0.25);
    transition: transform 0.2s ease;
}

.mfa-toggle.is-enabled .mfa-toggle-handle {
    transform: translateX(14px);
}

.mfa-toggle:focus-visible {
    outline: 2px solid #696cff;
    outline-offset: 2px;
}

.member-clear-button {
    min-height: 42px;
    padding: 6px 14px;
    border: 1px solid #d9dee3;
    border-radius: 6px;
    background: #ffffff;
    color: #697a8d;
}

.member-clear-button:hover {
    border-color: #696cff;
    background: #eeeeff;
    color: #696cff;
}

.edit-member-footer {
    border-top: 0;
    padding-top: 0;
}

.password-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .password-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .admin-member-filter-row {
        grid-template-columns: 1fr;
    }

    .member-search-input {
        width: 100%;
    }

    .member-results-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .bulk-update-controls {
        grid-template-columns: 1fr;
    }

    .bulk-update-button {
        width: 100%;
    }

    .topic-filter-fieldset {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .topic-edit-fieldset {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

.member-topics-cell {
    min-width: 180px;
}

.member-topic-label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 1px 2px 1px 0;
    max-width: 180px;
    padding: 3px 5px 3px 8px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background-color: color-mix(in srgb, var(--topic-color, var(--primary-color)) 72%, white);
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
}

.member-topic-label > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-label-full {
    max-width: none;
}

.topic-label-full > span:first-child {
    overflow: visible;
    text-overflow: clip;
}

.topic-label-link {
    cursor: pointer;
    text-decoration: none;
}

.topic-label-link:hover {
    text-decoration: underline;
    color: #ffffff;
}

.member-topic-remove-form {
    display: inline;
}

.member-topic-remove {
    width: 15px;
    height: 15px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 300;
    line-height: 14px;
}

.member-topic-remove:hover {
    color: #111827;
}

.member-topics-more-wrapper {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.member-topics-more {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef0ff;
    color: #566a7f;
    cursor: default;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
}

.member-topics-more-tooltip {
    position: absolute;
    z-index: 50;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    display: none;
    width: max-content;
    max-width: 260px;
    max-height: 220px;
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: 6px;
    background: #566a7f;
    box-shadow: 0 5px 15px rgba(67, 89, 113, 0.2);
    color: #ffffff;
    font-size: 12px;
    line-height: 1.45;
}

.member-topics-more-tooltip ul {
    margin: 0;
    padding-left: 16px;
}

.member-topics-more-tooltip li + li {
    margin-top: 3px;
}

.member-topics-more-wrapper:hover .member-topics-more-tooltip,
.member-topics-more-wrapper:focus-within .member-topics-more-tooltip {
    display: block;
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background-color: var(--bg-light);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.table thead {
    background-color: var(--bg-lighter);
}

.table th {
    padding: 15px;
    text-align: left;
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.result-table {
    border: 1px solid #e3e7ee;
    background-color: #ffffff;
    color: #263238;
    box-shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
}

.result-table thead {
    background-color: #f8fafc;
}

.result-table th {
    padding: 14px 16px;
    color: #667085;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid #e3e7ee;
}

.result-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #edf0f4;
    vertical-align: middle;
}

.result-table tbody tr:nth-child(even) {
    background-color: #fbfcfe;
}

.result-table tbody tr:hover {
    background-color: #f0f5ff;
}

.members-overview-table thead {
    background-color: transparent;
}

.members-overview-table th {
    padding: 12px 16px;
    color: #3a4257;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    border-top: none;
    border-bottom: 1px solid #eceef1;
}

.members-overview-table .table-sort-link:hover {
    color: inherit;
    text-decoration: underline;
}

.members-overview-table .user-type-label {
    font-size: 13px;
}

.members-overview-table .member-organization-cell {
    font-size: 13px;
}

.members-overview-table {
    overflow: visible;
}

.overview-results {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.overview-result {
    min-height: 84px;
    padding: 16px;
    border: 1px solid #e3e7ee;
    border-left: 4px solid #98a2b3;
    background: #ffffff;
}

.overview-result-confirmed {
    border-left-color: #12b76a;
}

.overview-result-pending {
    border-left-color: #f79009;
}

.overview-result-label {
    display: block;
    margin-bottom: 10px;
    color: #667085;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.overview-result strong {
    color: #1d2939;
    font-size: 26px;
}

.result-number {
    width: 44px;
    color: #98a2b3 !important;
    font-size: 12px !important;
    text-align: center !important;
}

.table-sort-link {
    color: inherit;
    text-decoration: none;
}

.table-sort-link:hover {
    color: #696cff;
    text-decoration: underline;
}

.member-name-link {
    color: #263238;
    text-decoration: none;
}

.member-name-link:hover {
    color: #263238;
    text-decoration: underline;
}

.responsible-name-link {
    color: #263238;
    text-decoration: none;
}

.responsible-name-link:hover {
    color: #263238;
    text-decoration: underline;
}

.user-type-label {
    display: block;
    margin-top: 3px;
    color: #263238;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
}

.manager-type-icon {
    margin-right: 3px;
    font-size: 12px;
    vertical-align: -1px;
    color: #71dd37;
}

.member-type-icon {
    margin-right: 3px;
    font-size: 12px;
    vertical-align: -1px;
    color: #696cff;
}

.admin-type-icon {
    margin-right: 3px;
    font-size: 12px;
    vertical-align: -1px;
    color: #ff3e1d;
}

.user-type-email {
    color: #263238;
}

.status-badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-confirmed {
    color: #087443;
    background-color: #d9fbe9;
}

.status-pending {
    color: #9a6700;
    background-color: #fff0c2;
}

.status-expired {
    color: #b42318;
    background-color: #fee4e2;
}

.status-deleted {
    color: #b42318;
    background-color: #fee4e2;
}

.event-type-badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.event-type-create {
    background-color: #27ae60;
}

.event-type-update {
    background-color: #3498db;
}

.event-type-delete {
    background-color: #e74c3c;
}

.event-type-login {
    background-color: #9b59b6;
}

.event-type-logout {
    background-color: #667085;
}

.event-type-export {
    background-color: #0f9d9a;
}

.event-type-status_change {
    background-color: #f39c12;
}

.table-action {
    display: inline-block;
    margin: 2px 3px 2px 0;
    padding: 5px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #667085;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    text-decoration: none;
}

.table-action-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 18px;
    line-height: 28px;
    text-align: center;
}

.status-reinvite-form {
    display: inline-flex;
    margin: 0;
    vertical-align: middle;
}

.member-status-cell {
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.table-action:hover {
    background-color: #eef2f7;
    color: #344054;
}

.table-action-edit:hover {
    color: #2457d6;
}

.table-action-reinvite:hover {
    color: #087443;
}

.table-action-delete:hover {
    color: #b42318;
}

.table-action-delete.table-action-icon {
    color: #98a2b3;
}

.table-action-delete.table-action-icon:hover {
    color: #b42318;
    background-color: #fee4e2;
}

.table-action-edit.table-action-icon {
    color: #98a2b3;
}

.table-action-edit.table-action-icon:hover {
    color: #2457d6;
    background-color: #eaf1ff;
}

@media (max-width: 800px) {
    .overview-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Cards */
.card {
    background-color: var(--bg-light);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
    padding-bottom: 15px;
}

.card-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.card-body {
    margin-bottom: 15px;
}

.card-footer {
    padding-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.card-footer.export-members {
    justify-content: flex-start;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.mfa-page {
    height: auto;
    min-height: 100vh;
    align-items: flex-start;
    overflow-y: auto;
    padding-top: 24px;
    padding-bottom: 24px;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 24px;
}

.login-container-wide {
    max-width: 720px;
}

.thank-you-container {
    max-width: 1180px;
}

.thank-you-page {
    align-items: flex-start;
    overflow-y: auto;
    padding: 24px 0;
}

.thank-you-container .login-box {
    text-align: left;
}

.thank-you-container .login-submit {
    display: block;
    margin-top: 24px;
}

.login-container-wide .login-box {
    text-align: left;
    max-height: 80vh;
    overflow-y: auto;
}

.gdpr-confirmation-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.login-brand img {
    display: block;
    width: min(360px, 100%);
    height: auto;
}

.login-brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
    background: #696cff;
    color: #ffffff;
    box-shadow: 0 5px 12px rgba(105, 108, 255, 0.28);
}

.login-box {
    background: #ffffff;
    border: 1px solid #e7e7eb;
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 5px 18px rgba(67, 89, 113, 0.08);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #566a7f;
    font-size: 24px;
    margin-bottom: 8px;
}

.login-header p {
    color: #a1acb8;
    font-size: 14px;
}

.member-topic-summary {
    list-style-type: none;
}

.login-form {
    margin-bottom: 20px;
}

.login-form h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.login-form .form-group label {
    color: #566a7f;
    font-size: 13px;
}

.login-input {
    background: #ffffff !important;
    border: 1px solid #d9dee3 !important;
    color: #566a7f !important;
    border-radius: 6px !important;
}

.login-input:focus {
    border-color: #696cff !important;
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.12) !important;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 22px;
    color: #697a8d;
    font-size: 13px;
}

.login-options a {
    color: #696cff;
    text-decoration: none;
}

.login-options a:hover {
    text-decoration: underline;
}

.login-submit {
    width: 100%;
    min-height: 44px;
    border-radius: 6px;
    background: #696cff;
}

.login-submit:hover {
    background: #5f61e6;
}

.login-footer {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.login-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* MFA setup */
.mfa-setup-page {
    display: flex;
    justify-content: center;
    padding: 26px 0;
}

.mfa-setup-card {
    width: min(100%, 480px);
    padding: 32px;
    background: #ffffff;
    border: 1px solid #e7e7eb;
    border-radius: 8px;
    box-shadow: 0 5px 18px rgba(67, 89, 113, 0.08);
}

.mfa-setup-header {
    text-align: center;
}

.mfa-setup-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 8px;
    background: #eef0ff;
    color: #696cff;
    font-size: 13px;
    font-weight: 700;
}

.mfa-setup-header h1 {
    margin: 0 0 8px;
    color: #566a7f;
    font-size: 24px;
}

.mfa-setup-header p {
    margin: 0;
    color: #697a8d;
    font-size: 14px;
}

.mfa-setup-steps {
    display: grid;
    gap: 9px;
    margin: 26px 0 22px;
    color: #566a7f;
    font-size: 13px;
}

.mfa-setup-steps div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mfa-setup-steps span {
    display: inline-grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    background: #eef0ff;
    color: #696cff;
    font-size: 11px;
    font-weight: 700;
}

.mfa-qr-panel {
    padding: 20px;
    border: 1px solid #e7e7eb;
    border-radius: 6px;
    background: #f8f9fa;
    text-align: center;
}

.mfa-qr-panel > p {
    margin: 0 0 14px;
    color: #566a7f;
    font-size: 13px;
}

.mfa-qr-panel img {
    display: block;
    width: min(100%, 210px);
    height: auto;
    margin: 0 auto;
    padding: 8px;
    background: #ffffff;
}

.mfa-manual-code {
    display: grid;
    gap: 3px;
    margin-top: 14px;
    color: #697a8d;
    font-size: 12px;
}

.mfa-manual-code code {
    color: #566a7f;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.mfa-verify-form {
    margin-top: 22px;
}

.mfa-verify-form .form-group {
    margin-bottom: 16px;
}

.mfa-verify-form label {
    color: #566a7f;
    font-size: 13px;
}

.mfa-code-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.mfa-code-inputs .mfa-code-digit {
    width: 100%;
    height: 52px;
    padding: 0;
    border: 1px solid #d9dee3 !important;
    border-radius: 6px;
    background: #ffffff !important;
    color: #566a7f !important;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
}

.mfa-code-inputs .mfa-code-digit:focus {
    border-color: #696cff !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.12);
}

.mfa-error-help {
    margin: 8px 0 0;
    color: #b42318;
    font-size: 12px;
}

.mfa-submit-button {
    width: 100%;
}

.mfa-cancel-link {
    display: block;
    margin-top: 16px;
    color: #697a8d;
    font-size: 13px;
    text-align: center;
    text-decoration: none;
}

.mfa-cancel-link:hover {
    color: #696cff;
    text-decoration: underline;
}

.mfa-backup-note {
    margin-top: 24px;
    padding: 14px 16px;
    border-left: 3px solid #f39c12;
    border-radius: 4px;
    background: #fff8e7;
    color: #8a6200;
}

.mfa-backup-note strong {
    font-size: 13px;
}

.mfa-backup-note p {
    margin: 4px 0 0;
    font-size: 12px;
}

.mfa-standalone-page {
    width: 100%;
    max-width: 720px;
    margin-right: auto;
    margin-left: auto;
}

.mfa-standalone-page .mfa-setup-card {
    width: 100%;
    max-width: none;
    max-height: none;
    margin-right: auto;
    margin-left: auto;
    overflow: visible;
    text-align: left;
}

.mfa-standalone-page .mfa-setup-header,
.mfa-standalone-page .mfa-setup-steps,
.mfa-standalone-page .mfa-verify-form,
.mfa-standalone-page .mfa-backup-note {
    text-align: center;
}

.mfa-backup-codes {
    margin: 22px 0;
    padding: 16px;
    border: 1px solid #d9dee3;
    border-radius: 6px;
    background: #f8f9fa;
}

.mfa-backup-codes-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.mfa-backup-codes-header p {
    margin: 4px 0 0;
    color: #697a8d;
    font-size: 12px;
}

.mfa-backup-code-actions {
    display: flex;
    gap: 6px;
}

.mfa-icon-button {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    border: 1px solid #d9dee3;
    border-radius: 6px;
    background: #ffffff;
    color: #697a8d;
    cursor: pointer;
}

.mfa-icon-button:hover {
    border-color: #696cff;
    color: #696cff;
}

.mfa-backup-codes > code {
    display: block;
    column-count: 2;
    column-gap: 32px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 4px;
    background: #ffffff;
    color: #566a7f;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-line;
}

@media (max-width: 520px) {
    .mfa-backup-codes > code {
        column-count: 1;
    }
}

@media (max-width: 420px) {
    .mfa-setup-card {
        padding: 24px 20px;
    }

    .mfa-code-inputs {
        gap: 6px;
    }
}

/* Application shell */
body.dark-theme {
    background: #f4f5f9;
    color: #566a7f;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 200;
    display: flex;
    width: 250px;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid #e7e7eb;
    box-shadow: 2px 0 10px rgba(67, 89, 113, 0.04);
}

.sidebar-brand {
    position: relative;
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid #f0f0f2;
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #566a7f;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.sidebar-brand img {
    display: block;
    width: 185px;
    height: auto;
}

.sidebar-collapse-toggle {
    position: absolute;
    right: -12px;
    top: 23px;
    z-index: 1;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    padding: 0;
    border: 1px solid #e7e7eb;
    border-radius: 50%;
    background: #ffffff;
    color: #697a8d;
    cursor: pointer;
    font-size: 19px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(67, 89, 113, 0.12);
}

.sidebar-collapse-toggle:hover {
    color: #696cff;
    border-color: #696cff;
}

.brand-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: #696cff;
    color: #ffffff;
    font-size: 18px;
    box-shadow: 0 5px 12px rgba(105, 108, 255, 0.28);
}

.sidebar-section-label {
    padding: 26px 24px 10px;
    color: #a1acb8;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-section-label.account-label {
    padding-top: 28px;
}

.app-sidebar .nav-menu {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 12px;
}

.app-sidebar .nav-menu li {
    list-style: none;
    width: 100%;
}

.app-sidebar .nav-menu a,
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 6px;
    color: #697a8d;
    font-size: 14px;
    text-decoration: none;
}

.app-sidebar .nav-menu a > span:nth-child(2) {
    flex: 1 1 auto;
}

.nav-arrow {
    color: #a1acb8;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
}

.app-sidebar .nav-menu a.active .nav-arrow,
.app-sidebar .nav-menu a:hover .nav-arrow {
    color: currentColor;
}

.app-sidebar .nav-menu a:hover,
.app-sidebar .nav-menu a.active,
.sidebar-footer a:hover {
    background: #eeeeff;
    color: #696cff;
}

.nav-icon {
    display: inline-grid;
    width: 20px;
    place-items: center;
    color: currentColor;
    font-size: 17px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 12px 22px;
    border-top: 1px solid #f0f0f2;
}

.app-main {
    width: calc(100% - 250px);
    min-width: 0;
    margin-left: 250px;
}

.app-shell.sidebar-collapsed .app-sidebar {
    width: 78px;
}

.app-shell.sidebar-collapsed .app-main {
    width: calc(100% - 78px);
    margin-left: 78px;
}

.app-shell.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 0 12px;
}

.app-shell.sidebar-collapsed .sidebar-brand img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    object-position: left center;
}

.app-shell.sidebar-collapsed .sidebar-section-label,
.app-shell.sidebar-collapsed .app-sidebar .nav-menu a > span:nth-child(2),
.app-shell.sidebar-collapsed .app-sidebar .nav-arrow,
.app-shell.sidebar-collapsed .sidebar-footer a > span:not(.nav-icon) {
    display: none;
}

.app-shell.sidebar-collapsed .app-sidebar .nav-menu {
    padding: 0 12px;
}

.app-shell.sidebar-collapsed .app-sidebar .nav-menu a,
.app-shell.sidebar-collapsed .sidebar-footer a {
    justify-content: center;
    padding: 11px 0;
}

.app-shell.sidebar-collapsed .nav-icon {
    width: 24px;
    font-size: 19px;
}

.app-shell.sidebar-collapsed .sidebar-collapse-toggle {
    right: -12px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 20px 30px 0;
}

.topbar-context {
    color: #697a8d;
    font-size: 14px;
}

.user-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #e7e7ff;
    color: #696cff;
    font-size: 12px;
    font-weight: 700;
}

.sidebar-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: #697a8d;
    cursor: pointer;
    font-size: 21px;
}

.page-content {
    min-height: calc(100vh - 70px);
}

.page-content .container {
    width: calc(100% - 40px);
    max-width: 1800px;
    min-height: 0;
    margin-right: auto;
    margin-left: auto;
}

.page-content .container.invite-member-container {
    max-width: 933px;
}

.dashboard-loading-active .app-main {
    filter: blur(5px);
    transition: filter 0.2s ease;
}

.dashboard-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.28);
}

.sk-fold-cube {
    position: relative;
    width: 48px;
    height: 48px;
    transform: rotateZ(45deg);
}

.sk-fold-cube .sk-cube {
    position: relative;
    float: left;
    width: 50%;
    height: 50%;
    transform: scale(1.1);
}

.sk-fold-cube .sk-cube::before {
    position: absolute;
    width: 100%;
    height: 100%;
    content: '';
    background-color: #FECB00;
    animation: sk-fold-cube-angle 2.4s infinite linear both;
    transform-origin: 100% 100%;
}

.sk-fold-cube .sk-cube2 {
    transform: scale(1.1) rotateZ(90deg);
}

.sk-fold-cube .sk-cube3 {
    transform: scale(1.1) rotateZ(270deg);
}

.sk-fold-cube .sk-cube4 {
    transform: scale(1.1) rotateZ(180deg);
}

.sk-fold-cube .sk-cube2::before {
    animation-delay: 0.3s;
}

.sk-fold-cube .sk-cube3::before {
    animation-delay: 0.6s;
}

.sk-fold-cube .sk-cube4::before {
    animation-delay: 0.9s;
}

@keyframes sk-fold-cube-angle {
    0%, 10% { transform: perspective(140px) rotateX(-180deg); opacity: 0; }
    25%, 75% { transform: perspective(140px) rotateX(0deg); opacity: 1; }
    90%, 100% { transform: perspective(140px) rotateY(180deg); opacity: 0; }
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4 {
    color: #566a7f;
}

.page-content .card,
.page-content .stat-card {
    background: #ffffff;
    border: 1px solid #e7e7eb;
    box-shadow: 0 3px 12px rgba(67, 89, 113, 0.06);
}

.page-content .card-header {
    border-bottom-color: #eef0f2;
}

.result-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.result-card-header h3 {
    margin: 0;
}

.result-card-link {
    color: #696cff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.result-card-link:hover {
    color: #5f61e6;
    text-decoration: underline;
}

.result-card-count {
    color: #a1acb8;
    font-size: 12px;
}

.logs-activities-table {
    font-size: 12px;
}

.page-content .table {
    background: #ffffff;
    color: #566a7f;
    box-shadow: none;
}

.page-content .table thead {
    background: #f8f9fa;
}

.page-content .table th {
    color: #697a8d;
    border-bottom-color: #e7e7eb;
}

.page-content .table td {
    border-bottom-color: #eef0f2;
}

.page-content .card:has(.table) {
    overflow-x: auto;
}

.page-content .table {
    width: 100%;
    table-layout: auto;
}

.footer {
    display: none;
}

@media (max-width: 900px) {
    .sidebar-collapse-toggle {
        display: none;
    }

    .app-sidebar {
        width: 250px;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .app-shell.sidebar-collapsed .app-sidebar {
        width: 250px;
    }

    .app-shell.sidebar-collapsed .sidebar-section-label,
    .app-shell.sidebar-collapsed .app-sidebar .nav-menu a > span:nth-child(2),
    .app-shell.sidebar-collapsed .app-sidebar .nav-arrow,
    .app-shell.sidebar-collapsed .sidebar-footer a > span:not(.nav-icon) {
        display: inline;
    }

    .app-shell.sidebar-collapsed .app-sidebar .nav-menu a,
    .app-shell.sidebar-collapsed .sidebar-footer a {
        justify-content: flex-start;
        padding: 11px 14px;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-main {
        width: 100%;
        margin-left: 0;
    }

    .app-shell.sidebar-collapsed .app-main {
        width: 100%;
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
        margin-right: auto;
    }

    .page-content .card:has(.table) {
        overflow-x: auto;
    }

    .page-content .table {
        min-width: 720px;
    }

    .page-content > .container > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-light);
    border-radius: 4px;
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.stat-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.stat-card-link:focus-visible {
    outline: 2px solid #696cff;
    outline-offset: 4px;
}

.admin-activities-accordion {
    margin-bottom: 30px;
}

.admin-activities-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
}

.admin-activities-summary::-webkit-details-marker {
    display: none;
}

.admin-activities-summary h3 {
    margin: 0;
}

.admin-activities-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid #566a7f;
    border-bottom: 2px solid #566a7f;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.admin-activities-accordion[open] .admin-activities-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.admin-activities-content {
    border-top: 1px solid #eef0f2;
}

.admin-activities-more {
    padding: 14px 20px 18px;
    text-align: right;
}

.admin-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.members-page-heading {
    align-items: flex-end;
}

.admin-page-heading h1,
.admin-page-heading p {
    margin: 0;
}

.admin-page-heading p {
    color: #697a8d;
}

.logs-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px 20px;
}

.logs-filter-accordion {
    margin-bottom: 20px;
}

.logs-filter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
}

.logs-filter-summary::-webkit-details-marker {
    display: none;
}

.logs-filter-summary h3 {
    margin: 0;
}

.logs-filter-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid #566a7f;
    border-bottom: 2px solid #566a7f;
    transform: rotate(45deg) translateY(-2px);
}

.logs-filter-accordion[open] .logs-filter-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.logs-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 16px;
}

.logs-filter-clear-action {
    align-self: end;
}

.logs-filter-clear-action .member-clear-button {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .stat-value {
    color: var(--primary-color);
    font-size: 32px;
    font-weight: bold;
}

.total-invited-counts {
    display: flex;
    align-items: center;
    gap: 8px;
}

.total-invited-confirmed {
    color: #3498db;
}

.total-invited-pending {
    color: #f39c12;
}

.total-invited-expired {
    color: #e74c3c;
}

.total-invited-separator {
    color: #a1acb8;
}

.dashboard-topic-table th:not(:first-child),
.dashboard-topic-table td:not(:first-child) {
    text-align: center;
}

.dashboard-topic-name {
    font-weight: 700;
}

.dashboard-stat-link {
    color: #263238;
    text-decoration: none;
}

.dashboard-stat-link:hover {
    color: #263238;
    text-decoration: underline;
}

.dashboard-org-count-link,
.dashboard-org-count-link:visited {
    display: inline-block;
    min-width: 28px;
    padding: 3px 7px;
    border-radius: 999px;
    color: #263238;
    text-decoration: none;
}

.dashboard-org-count-link:hover {
    color: #263238;
    text-decoration: none;
}

.dashboard-org-confirmed-link:hover {
    background-color: #d9fbe9;
    color: #087443;
}

.dashboard-org-pending-link:hover {
    background-color: #fff0c2;
    color: #9a6700;
}

.dashboard-org-expired-link:hover {
    background-color: #fee4e2;
    color: #b42318;
}

.dashboard-organization-table th:not(:first-child),
.dashboard-organization-table td:not(:first-child) {
    text-align: center;
}

.dashboard-organization-name {
    font-weight: 700;
}

.dashboard-organization-table tbody tr:hover {
    background-color: #ffffff;
}

.dashboard-organization-table tbody tr:nth-child(even):hover {
    background-color: #fbfcfe;
}

/* Footer */
.footer {
    background-color: var(--bg-light);
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--bg-light);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 500px;
    border-radius: 4px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        gap: 15px;
    }

    .nav-menu a {
        padding: 5px 8px;
        font-size: 14px;
    }

    .container {
        padding: 10px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px;
    }

    .login-box {
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 20px 16px 0;
    }

    .page-content {
        padding: 16px 0;
    }

    .page-content .container {
        padding: 10px;
    }

    .page-content .card {
        padding: 14px;
    }

    .filter-actions {
        width: 100%;
    }

    .filter-actions .btn {
        flex: 1 1 0;
    }

    .topbar-context {
        max-width: 52vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-info {
    color: var(--info-color);
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

.d-flex {
    display: flex;
}

.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

/* Pagination Styles */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.page-item {
    display: inline-block;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #e9ecef;
    border-color: #e9ecef;
    cursor: not-allowed;
}

.page-item.active .page-link {
    background-color: #5b7dff;
    border-color: #5b7dff;
    color: #fff;
    cursor: default;
}

.page-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    line-height: 1;
    color: #495057;
    background-color: #f3f4f5;
    border: 1px solid #f3f4f5;
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    font-size: 13px;
    font-weight: 500;
    padding: 0;
}

.page-link:hover:not(.disabled),
.page-item:not(.disabled):not(.active) .page-link:hover {
    background-color: #e9ecef;
    border-color: #e9ecef;
    color: #495057;
}

.page-link:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(91, 125, 255, 0.25);
}
