:root {
    --th-accent: #45d0ff;
    --th-accent-2: #00f7c1;
    --th-accent-3: #7c5cff;
    --th-surface-0: #02050e;
    --th-surface-1: #060b19;
    --th-surface-2: #0b1123;
    --th-surface-3: #141d35;
    --th-border: #233455;
    --th-border-bright: #3c5f94;
    --th-text-1: #f5fbff;
    --th-text-2: #cfddf6;
}

.theme-hybrid-dark {
    background-color: var(--th-surface-0);
    color: var(--th-text-1);
    font-family: "Inter", "Poppins", "Segoe UI", Arial, sans-serif;
}

.theme-hybrid-dark .th-app-content {
    position: relative;
    isolation: isolate;
    min-height: calc(100vh - 220px);
    padding-bottom: 2rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 8%, rgba(69, 208, 255, 0.24), transparent 30%),
        radial-gradient(circle at 86% 12%, rgba(0, 247, 193, 0.14), transparent 32%),
        radial-gradient(circle at 50% 130%, rgba(124, 92, 255, 0.22), transparent 46%),
        linear-gradient(180deg, #02050e 0%, #040915 44%, #080f1f 100%);
    color: var(--th-text-1);
}

/* Prevent modal backdrops from trapping modals inside themed content stacks. */
.theme-hybrid-dark.modal-open .th-app-content {
    isolation: auto;
    overflow: visible;
}

.theme-hybrid-dark .th-app-content::before,
.theme-hybrid-dark .th-app-content::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* Grid + map diagonals (no trail). */
.theme-hybrid-dark .th-app-content::before {
    opacity: 0.22;
    mix-blend-mode: screen;
    background-image:
        linear-gradient(rgba(69, 208, 255, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(69, 208, 255, 0.14) 1px, transparent 1px),
        radial-gradient(circle at 28% 72%, rgba(0, 247, 193, 0.22) 0, rgba(0, 247, 193, 0.09) 3px, transparent 4px),
        radial-gradient(circle at 74% 30%, rgba(69, 208, 255, 0.22) 0, rgba(69, 208, 255, 0.09) 3px, transparent 4px),
        radial-gradient(circle at 55% 58%, rgba(124, 92, 255, 0.2) 0, rgba(124, 92, 255, 0.09) 3px, transparent 4px);
    background-size: 64px 64px, 64px 64px, 320px 320px, 370px 370px, 440px 440px;
    background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat;
    background-position: center, center, center, center, center;
}

/* Map pointer removed per design request. */
.theme-hybrid-dark .th-app-content::after {
    content: none;
}

.theme-hybrid-dark .th-app-content .container,
.theme-hybrid-dark .th-app-content .container-fluid {
    position: relative;
    z-index: 1;
}

.theme-hybrid-dark .th-app-content h1,
.theme-hybrid-dark .th-app-content h2,
.theme-hybrid-dark .th-app-content h3,
.theme-hybrid-dark .th-app-content h4,
.theme-hybrid-dark .th-app-content h5,
.theme-hybrid-dark .th-app-content h6,
.theme-hybrid-dark .th-app-content label,
.theme-hybrid-dark .th-app-content th,
.theme-hybrid-dark .th-app-content .color-blue {
    color: var(--th-text-1) !important;
    letter-spacing: 0.01em;
}

.theme-hybrid-dark .th-app-content p,
.theme-hybrid-dark .th-app-content td,
.theme-hybrid-dark .th-app-content li,
.theme-hybrid-dark .th-app-content small {
    color: var(--th-text-1) !important;
}

.theme-hybrid-dark .th-app-content .text-muted {
    color: var(--th-text-2) !important;
}

/* Preserve semantic orange accents in dark mode. */
.theme-hybrid-dark .th-app-content .color-orange,
.theme-hybrid-dark .th-app-content .primary-orange {
    color: #f6851f !important;
}

.theme-hybrid-dark .th-app-content .featured-box,
.theme-hybrid-dark .th-app-content .card,
.theme-hybrid-dark .th-app-content .modal-content,
.theme-hybrid-dark .th-app-content .alert,
.theme-hybrid-dark .th-app-content .table,
.theme-hybrid-dark .th-app-content .dataTables_wrapper .dataTables_filter input,
.theme-hybrid-dark .th-app-content .dataTables_wrapper .dataTables_length select {
    background: linear-gradient(170deg, rgba(15, 24, 46, 0.96), rgba(7, 12, 26, 0.94));
    border: 1px solid var(--th-border) !important;
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.44), 0 0 0 1px rgba(69, 208, 255, 0.05) inset;
    backdrop-filter: blur(8px);
}

.theme-hybrid-dark .th-app-content .card:hover,
.theme-hybrid-dark .th-app-content .featured-box:hover {
    border-color: var(--th-border-bright) !important;
    box-shadow: 0 22px 40px rgba(0, 0, 0, 0.52), 0 0 24px rgba(69, 208, 255, 0.15);
}

.theme-hybrid-dark .th-app-content .table thead th,
.theme-hybrid-dark .th-app-content .table td,
.theme-hybrid-dark .th-app-content .table th {
    border-color: var(--th-border) !important;
    color: var(--th-text-1) !important;
}

.theme-hybrid-dark .th-app-content .modal-header,
.theme-hybrid-dark .th-app-content .modal-footer {
    border-color: var(--th-border) !important;
}

.theme-hybrid-dark .modal-content {
    background: linear-gradient(170deg, rgba(15, 24, 46, 0.98), rgba(7, 12, 26, 0.97)) !important;
    border: 1px solid var(--th-border) !important;
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(69, 208, 255, 0.06) inset;
    color: var(--th-text-1) !important;
}

.theme-hybrid-dark .modal-header,
.theme-hybrid-dark .modal-footer {
    border-color: var(--th-border) !important;
}

.theme-hybrid-dark .modal-title,
.theme-hybrid-dark .modal-body p,
.theme-hybrid-dark .modal-body label,
.theme-hybrid-dark .modal-body span,
.theme-hybrid-dark .modal-body div {
    color: var(--th-text-1) !important;
}

.theme-hybrid-dark .modal .btn-close {
    filter: invert(1) brightness(1.2);
    opacity: 0.9;
}

.theme-hybrid-dark .modal-backdrop.show {
    opacity: 0.55;
}

.theme-hybrid-dark .th-app-content .form-control,
.theme-hybrid-dark .th-app-content .form-select,
.theme-hybrid-dark .th-app-content input[type="file"] {
    background-color: rgba(2, 8, 18, 0.88) !important;
    border: 1px solid var(--th-border) !important;
    color: var(--th-text-1) !important;
    border-radius: 11px;
}

.theme-hybrid-dark .th-app-content .form-control::placeholder {
    color: #aebfdf !important;
}

.theme-hybrid-dark .modal .form-control,
.theme-hybrid-dark .modal .form-select,
.theme-hybrid-dark .modal input[type="file"] {
    background-color: rgba(2, 8, 18, 0.92) !important;
    border: 1px solid var(--th-border) !important;
    color: var(--th-text-1) !important;
}

.theme-hybrid-dark .modal .form-control::placeholder {
    color: #aebfdf !important;
}

.theme-hybrid-dark .th-app-content .form-control:focus,
.theme-hybrid-dark .th-app-content .form-select:focus {
    border-color: var(--th-accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(69, 208, 255, 0.22), 0 0 16px rgba(69, 208, 255, 0.22) !important;
}

.theme-hybrid-dark .th-app-content .btn {
    border-radius: 11px;
    font-weight: 600;
    letter-spacing: 0.015em;
}

.theme-hybrid-dark .th-app-content .btn-primary-orange,
.theme-hybrid-dark .th-app-content .btn-primary-blue {
    background-image: linear-gradient(135deg, #3476ff 0%, #07b1ff 55%, #00f0cd 100%) !important;
    border: 1px solid #58d9ff !important;
    color: #001b2b !important;
    box-shadow: 0 10px 24px rgba(0, 129, 188, 0.35);
}

.theme-hybrid-dark .th-app-content .btn-primary-orange:hover,
.theme-hybrid-dark .th-app-content .btn-primary-blue:hover {
    background-image: linear-gradient(135deg, #5590ff 0%, #1dc2ff 56%, #49ffd8 100%) !important;
    box-shadow: 0 14px 28px rgba(20, 172, 237, 0.45);
}

.theme-hybrid-dark .th-app-content .th-admin-nav .btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(69, 208, 255, 0.28) !important;
    background: linear-gradient(170deg, rgba(20, 31, 58, 0.86), rgba(10, 18, 36, 0.9));
    color: #cfe7ff !important;
}

.theme-hybrid-dark .th-app-content .th-admin-nav .btn.is-active {
    background-image: linear-gradient(135deg, #45d0ff 0%, #00f7c1 100%) !important;
    border-color: #96ffe7 !important;
    color: #041929 !important;
    box-shadow: 0 0 20px rgba(0, 247, 193, 0.4);
}

.theme-hybrid-dark .th-app-content a:not(.btn) {
    color: #7ed8ff;
}

.theme-hybrid-dark .th-app-content a:not(.btn):hover {
    color: #acfff4;
}

.theme-hybrid-dark .th-app-content .pagination .page-link {
    background-color: rgba(5, 11, 24, 0.94);
    border-color: var(--th-border);
    color: var(--th-text-2);
}

.theme-hybrid-dark .th-app-content .pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #2f78ff, #00d8ff);
    border-color: #5de4ff;
    color: #fff;
}

.theme-hybrid-dark .th-app-content .tab-pane .featured-box,
.theme-hybrid-dark .th-app-content .featured-box .box-content {
    background: transparent;
}

.theme-hybrid-dark .th-app-content .body,
.theme-hybrid-dark .th-app-content .main,
.theme-hybrid-dark .th-app-content .tabs,
.theme-hybrid-dark .th-app-content .tab-content,
.theme-hybrid-dark .th-app-content .tab-pane {
    background: transparent !important;
    color: var(--th-text-1);
}

.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs > li .nav-link,
.theme-hybrid-dark .th-app-content .tabs.tabs-bottom .nav-tabs li .nav-link {
    color: var(--th-text-2) !important;
    opacity: 0.95;
}

.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs > li .nav-link.active,
.theme-hybrid-dark .th-app-content .tabs.tabs-bottom .nav-tabs li .nav-link.active {
    border-bottom-color: var(--th-accent) !important;
    color: var(--th-text-1) !important;
}

.theme-hybrid-dark .th-app-content .featured-box .box-content {
    background: linear-gradient(170deg, rgba(14, 23, 42, 0.97), rgba(5, 10, 21, 0.95)) !important;
    border: 1px solid var(--th-border) !important;
    border-top: 2px solid var(--th-accent) !important;
    border-radius: 12px;
}

.theme-hybrid-dark .th-app-content .featured-boxes-style-6 .featured-box {
    background: transparent !important;
    box-shadow: none;
}

.theme-hybrid-dark .th-app-content .disable-element .color-blue,
.theme-hybrid-dark .th-app-content .disable-element .nav-link {
    color: #7f95bf !important;
    opacity: 0.75 !important;
}

/* Registration stepper icon fixes for dark hybrid theme:
   remove legacy halo ring and ensure icon contrast. */
.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs .featured-boxes-style-6 .featured-box .icon-featured {
    background: linear-gradient(170deg, rgba(15, 24, 46, 0.98), rgba(9, 15, 31, 0.98)) !important;
    border: 1px solid rgba(69, 208, 255, 0.38) !important;
    color: #d8ecff !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
}

.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs .featured-boxes-style-6 .featured-box .icon-featured::after {
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0 !important;
}

.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs .nav-link.active .featured-boxes-style-6 .featured-box .icon-featured {
    border-color: #65deff !important;
    color: #ffffff !important;
    box-shadow: 0 10px 24px rgba(4, 165, 223, 0.32), 0 0 0 1px rgba(101, 222, 255, 0.2) inset;
}

.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs .nav-link.active .featured-boxes-style-6 .featured-box .icon-featured::after,
.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs .nav-link:hover .featured-boxes-style-6 .featured-box .icon-featured::after {
    border: 0 !important;
}

.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs .th-step-icon {
    color: #d7e2ee !important;
    background: transparent !important;
    border: 0 !important;
    font-size: 1.5rem !important;
    width: 100% !important;
    height: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs .th-step-icon-wrap {
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
    height: 68px !important;
    min-height: 68px !important;
    max-height: 68px !important;
    aspect-ratio: 1 / 1;
    border-radius: 50% !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
    border: 2px solid rgba(235, 245, 255, 0.55) !important;
    background: rgba(11, 18, 35, 0.45) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07) inset !important;
}

.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs .nav-link.active .th-step-icon {
    color: #ffffff !important;
    background: transparent !important;
}

.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs .nav-link.active .th-step-icon-wrap {
    border-color: #ffffff !important;
    background: rgba(18, 34, 62, 0.62) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset !important;
}

.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs > li .nav-link > p {
    color: #a7b7ce !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.theme-hybrid-dark .th-app-content .tabs.tabs-simple .nav-tabs > li .nav-link.active > p {
    color: #ffffff !important;
}

/* Registration step 3 billing cycle labels (dark mode). */
.theme-hybrid-dark .th-app-content .th-billing-cycle-label {
    color: #e6f0ff !important;
}

.theme-hybrid-dark .th-app-content .form-check-input {
    background-color: rgba(2, 8, 18, 0.88) !important;
    border-color: var(--th-border-bright) !important;
}

.theme-hybrid-dark .th-app-content .form-check-input:checked {
    background-color: var(--th-accent) !important;
    border-color: var(--th-accent) !important;
}


@media (max-width: 767.98px) {
    .theme-hybrid-dark .th-app-content {
        padding-bottom: 1rem;
    }

    .theme-hybrid-dark .th-app-content::before {
        opacity: 0.28;
        background-size: 44px 44px, 44px 44px, 240px 240px, 280px 280px, 320px 320px;
    }

    .theme-hybrid-dark .th-app-content .th-admin-nav .btn {
        width: calc(50% - 0.5rem);
        justify-content: center;
    }

    .theme-hybrid-dark .th-app-content .table {
        font-size: 0.88rem;
    }
}
