:root {
    --ea-theme-bg: #f5f7fa;
    --ea-theme-surface: #ffffff;
    --ea-theme-surface-raised: #ffffff;
    --ea-theme-surface-muted: #eef2f6;
    --ea-theme-text: #172033;
    --ea-theme-text-muted: #566176;
    --ea-theme-border: #d9e0e8;
    --ea-theme-accent: #2f6fed;
    --ea-theme-accent-soft: #e8f0fe;
    --ea-theme-shadow: 0 10px 30px rgba(23, 32, 51, .12);
}

html[data-ea-theme="dark"] {
    --ea-theme-bg: #0b1018;
    --ea-theme-surface: #121a26;
    --ea-theme-surface-raised: #182230;
    --ea-theme-surface-muted: #202c3b;
    --ea-theme-text: #edf3fa;
    --ea-theme-text-muted: #aebdce;
    --ea-theme-border: #334154;
    --ea-theme-accent: #7ba7ff;
    --ea-theme-accent-soft: #20395e;
    --ea-theme-shadow: 0 14px 34px rgba(0, 0, 0, .34);
    --primary-color: #7f9dff;
    --secondary-color: #edf3fa;
    --teritory-color: #dce7f4;
    --light-color: #aebdce;
    --white-text: #ffffff;
    --border-color: #3a485b;
    --text-color: #c3cfdd;
    --heading-color: #f4f8fc;
    --ea-color-app: #0b1018;
    --ea-color-surface: #121a26;
    --ea-color-subtle: #202c3b;
    --ea-color-selected: #20395e;
    --ea-color-text: #edf3fa;
    --ea-color-text-secondary: #b8c5d5;
    --ea-color-muted: #91a1b4;
    --ea-color-border: #334154;
    --ea-color-border-strong: #495a70;
    --ea-color-primary: #102f54;
    --ea-color-primary-hover: #17416f;
    --ea-color-interactive: #7ba7ff;
    --ea-color-evidence: #5ed3c6;
    --ea-color-success: #62d49b;
    --ea-color-warning: #efbd68;
    --ea-color-danger: #ff887d;
    --ea-color-focus: #83adff;
    --ea-shadow: var(--ea-theme-shadow);
}

.ea-theme-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--ea-theme-border);
    border-radius: 6px;
    background: var(--ea-theme-surface);
    color: var(--ea-theme-text);
    box-shadow: none;
    cursor: pointer;
}

.ea-theme-toggle .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.ea-theme-toggle:hover {
    border-color: var(--ea-theme-accent);
    color: var(--ea-theme-accent);
}

.ea-theme-toggle:focus-visible {
    outline: 2px solid var(--ea-theme-accent);
    outline-offset: 2px;
}

.ea-theme-toggle-icon {
    position: relative;
    width: 17px;
    height: 17px;
    display: block;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.ea-theme-toggle-icon::after {
    content: "";
    position: absolute;
    inset: -5px;
    border: 2px dotted currentColor;
    border-radius: 50%;
}

html[data-ea-theme="dark"] .ea-theme-toggle-icon {
    border: 0;
    background: currentColor;
    box-shadow: inset 6px -4px 0 var(--ea-theme-surface);
}

html[data-ea-theme="dark"] .ea-theme-toggle-icon::after {
    display: none;
}

.ea-theme-toggle-floating {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2100;
    box-shadow: var(--ea-theme-shadow);
}

.ea-login-theme {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
}

[data-ea-theme-slot] {
    display: inline-flex;
    align-items: center;
}

.ea-header-controls {
    order: 3;
    display: flex;
    align-items: center;
    gap: 10px;
}

header .navbar-collapse {
    order: 2;
}

html[data-ea-theme="dark"],
html[data-ea-theme="dark"] body,
html[data-ea-theme="dark"] #app,
html[data-ea-theme="dark"] .main-wrapper,
html[data-ea-theme="dark"] .main-content,
html[data-ea-theme="dark"] .section,
html[data-ea-theme="dark"] .ea-workspace {
    background-color: var(--ea-theme-bg) !important;
    color: var(--ea-theme-text);
}

html[data-ea-theme="dark"] body {
    background-image: none;
}

html[data-ea-theme="dark"] :where(h1, h2, h3, h4, h5, h6, label, legend, dt, strong, b) {
    color: var(--ea-theme-text);
}

html[data-ea-theme="dark"] :where(p, li, dd, small, .text-muted, .help-block, .form-text) {
    color: var(--ea-theme-text-muted) !important;
}

html[data-ea-theme="dark"] :where(a:not(.btn):not(.primary-btn):not(.ea-button):not(.nav-link)) {
    color: var(--ea-theme-accent);
}

html[data-ea-theme="dark"] :where(header .navbar, .main-navbar, .navbar.active, .ea-utility-bar, .navbar-bg) {
    background: var(--ea-theme-surface) !important;
    border-color: var(--ea-theme-border) !important;
}

html[data-ea-theme="dark"] :where(.nav-link, .profile-name, .ea-account-link, .navbar .nav-link) {
    color: var(--ea-theme-text) !important;
}

html[data-ea-theme="dark"] :where(
    .card,
    .modal-content,
    .dropdown-menu,
    .login-box,
    .register-box,
    .home-form-box,
    .meet-eassy-annotation-inner-box,
    .blog-box,
    .profile-box,
    .payment-detail-wrapper,
    .subscription-plan-box,
    .annotation-sidebar-section,
    .sidebar-dropdown-heading,
    .accordion-item,
    .accordion-button,
    .list-group-item,
    .table,
    .table-responsive,
    .toast,
    .swal-modal,
    .selectric,
    .selectric-items,
    .note-editor,
    .note-editable,
    .ea-section,
    .ea-metric,
    .ea-filter-bar,
    .ea-projects-table,
    .ea-account-menu
) {
    background-color: var(--ea-theme-surface) !important;
    color: var(--ea-theme-text) !important;
    border-color: var(--ea-theme-border) !important;
    box-shadow: none;
}

html[data-ea-theme="dark"] :where(
    .form-control,
    .form-select,
    input,
    select,
    textarea,
    .input-group-text,
    .selectric .label
) {
    background-color: var(--ea-theme-surface-muted) !important;
    color: var(--ea-theme-text) !important;
    border-color: var(--ea-theme-border) !important;
}

html[data-ea-theme="dark"] :where(input, textarea)::placeholder {
    color: #8798ac !important;
    opacity: 1;
}

html[data-ea-theme="dark"] :where(.dropdown-item, .header-profile-link) {
    background-color: transparent;
    color: var(--ea-theme-text-muted) !important;
}

html[data-ea-theme="dark"] :where(.dropdown-item:hover, .dropdown-item:focus, .header-profile-link:hover, .header-profile-link:focus) {
    background-color: var(--ea-theme-surface-muted) !important;
    color: var(--ea-theme-text) !important;
}

html[data-ea-theme="dark"] :where(.dropdown-divider, hr, .card-header, .card-footer, .modal-header, .modal-footer) {
    border-color: var(--ea-theme-border) !important;
}

html[data-ea-theme="dark"] :where(.table > :not(caption) > * > *, table th, table td) {
    background-color: transparent;
    color: var(--ea-theme-text-muted);
    border-color: var(--ea-theme-border) !important;
}

html[data-ea-theme="dark"] :where(.table-striped > tbody > tr:nth-of-type(odd) > *, .ea-table th) {
    background-color: var(--ea-theme-surface-muted) !important;
}

html[data-ea-theme="dark"] :where(.table-hover > tbody > tr:hover > *, .ea-table tbody tr:hover) {
    background-color: var(--ea-theme-accent-soft) !important;
    color: var(--ea-theme-text) !important;
}

html[data-ea-theme="dark"] :where(.common-banner, .breadcrumb-section, .pdf-header-section, .pdf-table-section, .hero-banner-section, .meet-eassy-annotation-section) {
    background-color: #111b2a !important;
    background-image: none !important;
}

html[data-ea-theme="dark"] :where(.bg-white, .bg-light) {
    background-color: var(--ea-theme-surface) !important;
}

html[data-ea-theme="dark"] :where(.border, .border-top, .border-bottom, .border-start, .border-end) {
    border-color: var(--ea-theme-border) !important;
}

html[data-ea-theme="dark"] .ea-workspace {
    background-image: linear-gradient(rgba(123, 167, 255, .035) 1px, transparent 1px);
}

html[data-ea-theme="dark"] .ea-sidebar {
    background: #081f38;
}

html[data-ea-theme="dark"] .ea-icon-button {
    background: var(--ea-theme-surface-muted);
    border-color: var(--ea-theme-border);
    color: var(--ea-theme-text);
}

html[data-ea-theme="dark"] :where(.ea-status-complete, .ea-status-uploaded) {
    background: #163a2c;
    border-color: #2c6a50;
}

html[data-ea-theme="dark"] .ea-status-awaiting_review {
    background: #49391c;
    border-color: #735c2d;
}

html[data-ea-theme="dark"] .ea-status-failed {
    background: #4a2525;
    border-color: #78413f;
}

html[data-ea-theme="dark"] :where(.ea-status-parsing, .ea-status-uploading, .ea-status-searching_evidence, .ea-status-verifying_evidence) {
    background: #1c3557;
    border-color: #345982;
}

html[data-ea-theme="dark"] footer,
html[data-ea-theme="dark"] .main-footer {
    background: #080d14 !important;
    border-color: var(--ea-theme-border) !important;
}

html[data-ea-theme="dark"] .main-sidebar,
html[data-ea-theme="dark"] .main-sidebar .sidebar-brand,
html[data-ea-theme="dark"] .main-sidebar::after {
    background-color: #0e1724 !important;
}

html[data-ea-theme="dark"] .main-sidebar .sidebar-menu li a {
    color: #b7c5d7 !important;
}

html[data-ea-theme="dark"] .main-sidebar .sidebar-menu li.active > a,
html[data-ea-theme="dark"] .main-sidebar .sidebar-menu li a:hover {
    background-color: #20324a !important;
    color: #ffffff !important;
}

html[data-ea-theme="dark"] :where(.page-link, .pagination .page-item.disabled .page-link) {
    background: var(--ea-theme-surface) !important;
    color: var(--ea-theme-accent) !important;
    border-color: var(--ea-theme-border) !important;
}

html[data-ea-theme="dark"] :where(.btn-light, .btn-secondary, .secondary-btn, .light-btn) {
    background: var(--ea-theme-surface-muted) !important;
    color: var(--ea-theme-text) !important;
    border-color: var(--ea-theme-border) !important;
}

html[data-ea-theme="dark"] :where(.alert-light, .alert-secondary) {
    background: var(--ea-theme-surface-muted) !important;
    color: var(--ea-theme-text) !important;
    border-color: var(--ea-theme-border) !important;
}

html[data-ea-theme="dark"] :where(.pdfViewer, .page canvas, canvas[data-pdfjsprinting], iframe, embed) {
    color-scheme: light;
}

@media (max-width: 991.98px) {
    .ea-header-controls {
        order: 2;
    }

    header .navbar-collapse {
        order: 3;
    }

    .ea-header-controls .ea-theme-toggle {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    html[data-ea-theme="dark"] header #navbarSupportedContent {
        border-color: var(--ea-theme-border);
    }

    html[data-ea-theme="dark"] .navbar-toggler.ea-navbar-toggler {
        background: var(--ea-theme-surface-muted);
        border-color: var(--ea-theme-border);
    }

    html[data-ea-theme="dark"] .navbar-toggler.ea-navbar-toggler .ea-menu-line {
        background: var(--ea-theme-text);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ea-theme-toggle,
    .ea-theme-toggle * {
        transition: none !important;
    }
}

html[data-ea-theme="dark"] :where(
    .login-page,
    .page-login-section,
    .login-wrapper,
    .secondary-color,
    .annoation-tab-section,
    .subscription-plan-section,
    .payment-detail-section,
    .profile-setting-section,
    .blog-plan-section,
    .video-section
) {
    background-color: var(--ea-theme-bg) !important;
    background-image: none !important;
}

html[data-ea-theme="dark"] :where(
    .stripe-box,
    .subscription-header-img,
    .divider,
    .open-mode-sidebar h3,
    .annoation-tab-wrapper .nav-tabs .nav-link,
    .pdf-download-table thead
) {
    background-color: var(--ea-theme-surface-muted) !important;
    color: var(--ea-theme-text) !important;
    border-color: var(--ea-theme-border) !important;
}

html[data-ea-theme="dark"] :where(
    .annoation-tab-wrapper .nav-tabs .nav-link.active,
    .annoation-tab-wrapper .tab-content .accordion-body .pdf-text-box,
    .tab-close,
    .pdf-download-table,
    .sidebar-wrapper .accordion-item,
    .sidebar-dropdown-heading:not(.collapsed),
    .open-popup-right-wrapper,
    .open-folder-popup .pdf-content-wrapper
) {
    background-color: var(--ea-theme-surface) !important;
    color: var(--ea-theme-text) !important;
    border-color: var(--ea-theme-border) !important;
    box-shadow: none !important;
}

html[data-ea-theme="dark"] :where(
    .radio-btn-box,
    .payment-price-txt,
    .download-count,
    .pdf-download-table tr th,
    .meet-eassy-annotation-inner-box-para,
    .select-formfield .form-icon,
    #pdf-filter
) {
    color: var(--ea-theme-text) !important;
    border-color: var(--ea-theme-border) !important;
}

html[data-ea-theme="dark"] :where(
    .annotation-sidebar-section,
    .sidebar-dropdown-heading,
    .radio-btn-box,
    .pdf-download-table tbody tr,
    .open-mode-sidebar,
    .open-folder-popup .pdf-content-wrapper
) {
    border-color: var(--ea-theme-border) !important;
}