:root {
    --bg-main: #f1f5f9;
    --text-main: #1e293b;
    --bg-card: rgba(255, 255, 255, 0.6);
    --border-color: rgba(0, 0, 0, 0.1);
}

html.dark {
    --bg-main: #0d1117;
    --text-main: #e2e8f0;
    --bg-card: rgba(21, 25, 35, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: "Inter", Arial, sans-serif;
    transition: background 0.5s ease, color 0.3s ease;
    overflow: hidden;
}

html.dark body {
    background: linear-gradient(180deg, #1e293b 0%, #080a0f 100%);
    background-attachment: fixed;
}

.font-display {
    font-family: "Outfit", "Inter", Arial, sans-serif;
}

#paid-filters-form {
    position: relative;
    z-index: 1000;
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.45) transparent;
}

#paid-filters-form::-webkit-scrollbar {
    height: 5px;
}

main {
    z-index: 0;
}

#webgl-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.6;
    pointer-events: none;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 4px solid var(--border-color);
    box-shadow: 0 2px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

html.dark .glass-card {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    background: #000;
}

.glass-card:hover {
    border-color: rgba(16, 185, 129, 0.4);
}

.theme-toggle {
    position: relative;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    pointer-events: auto;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

html.dark .theme-toggle {
    background: rgba(255, 255, 255, 0.05);
}

.theme-toggle:hover,
.theme-toggle:focus {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.bar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    padding: 0 4px;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: width 0.5s ease;
}

.premium-input {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
    outline: none;
    transition: all 0.2s;
}

html.dark .premium-input {
    background: rgba(0, 0, 0, 0.4);
    color: white;
}

.premium-input:focus {
    border-color: #10b981;
}

.premium-input option {
    background: #fff;
    color: #1e293b;
}

html.dark .premium-input option {
    background: #0f172a;
    color: white;
}

.filter-select-shell {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

.filter-select-label {
    color: #9ca3af;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.date-range-field {
    position: relative;
    flex: 0 0 auto;
}

.date-range-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-width: 260px;
    min-height: 40px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #969dae;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    outline: none;
    box-shadow: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.date-range-trigger:hover,
.date-range-field.open .date-range-trigger,
.date-range-trigger:focus {
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.1);
}

.date-range-kicker {
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.date-range-value {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.date-range-icon {
    color: #10b981;
    font-size: 20px;
    line-height: 1;
}

.date-range-popover {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    z-index: 1001;
    display: none;
    width: min(640px, calc(100vw - 32px));
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: #111827;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: bookingFade 0.2s ease-out;
}

.date-range-field.open .date-range-popover {
    display: block;
}

.date-picker-months {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.date-picker-month {
    min-width: 0;
}

.date-picker-header {
    display: grid;
    grid-template-columns: 28px 1fr 28px;
    align-items: center;
    margin-bottom: 16px;
}

.date-picker-title {
    color: #f3f6f5;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.date-picker-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font-size: 20px;
    outline: none;
}

.date-picker-nav:hover,
.date-picker-nav:focus {
    color: #dbeafe;
    background: rgba(148, 163, 184, 0.08);
}

.date-picker-nav.is-hidden {
    visibility: hidden;
}

.date-picker-weekdays,
.date-picker-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.date-picker-weekdays {
    margin-bottom: 8px;
}

.date-picker-weekday {
    color: #9ca3af;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.date-picker-day {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #d1d5db;
    font-size: 11px;
    font-weight: 600;
    outline: none;
    transition: all 0.2s;
}

.date-picker-day:hover,
.date-picker-day:focus {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.date-picker-day.is-empty {
    visibility: hidden;
    pointer-events: none;
}

.date-picker-day.is-outside {
    background: transparent;
    color: #d1d5db;
}

.date-picker-day.is-in-range {
    background: rgba(59, 130, 246, 0.2);
    border-radius: 0;
}

.date-picker-day.is-selected {
    background: #3b82f6;
    color: white;
    font-weight: 800;
}

@keyframes bookingFade {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 900px) {
    .date-range-trigger {
        width: min(352px, calc(100vw - 48px));
        min-width: min(260px, calc(100vw - 48px));
    }

    .date-range-popover {
        position: fixed;
        top: 132px;
        left: 16px;
        right: 16px;
        width: auto;
        max-height: calc(100vh - 156px);
        overflow-y: auto;
        padding: 18px;
    }

    .date-picker-months {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.native-multi-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.multi-select {
    position: relative;
    z-index: 1000;
    width: 220px;
    min-width: 220px;
}

.multi-select.wide {
    width: 220px;
    min-width: 220px;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    outline: none;
}

html.dark .multi-select-trigger {
    background: rgba(0, 0, 0, 0.4);
    color: white;
}

.multi-select.open .multi-select-trigger,
.multi-select-trigger:focus {
    border-color: #10b981;
}

.multi-select-trigger[disabled] {
    cursor: wait;
    opacity: 0.65;
}

.multi-select-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1001;
    display: none;
    width: max(100%, 320px);
    max-height: 70vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    padding: 6px;
}

html.dark .multi-select-menu {
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.multi-select.open .multi-select-menu {
    display: block;
}

.multi-select.wide .multi-select-menu {
    width: min(760px, calc(100vw - 48px));
}

.multi-select.wide.open .multi-select-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: start;
}

.multi-select-group {
    min-width: 0;
}

.multi-select-group-title {
    position: sticky;
    top: -6px;
    z-index: 1;
    margin: -6px -6px 4px;
    padding: 8px 10px;
    background: rgba(241, 245, 249, 0.96);
    border-bottom: 1px solid var(--border-color);
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

html.dark .multi-select-group-title {
    background: rgba(15, 23, 42, 0.98);
    color: #cbd5e1;
}

.multi-select-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 12px;
    line-height: 1.35;
}

.multi-select-option:hover {
    background: rgba(16, 185, 129, 0.1);
}

.multi-select-option input {
    margin-top: 2px;
    accent-color: #10b981;
}

.multi-select-option.is-disabled {
    cursor: default;
    color: #64748b;
}

.tab-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    outline: none;
}

.tab-btn:hover,
.tab-btn.active {
    color: #10b981;
    border-color: #10b981;
}

html.dark .tab-btn.active {
    color: #34d399;
    border-color: #34d399;
}

.view-section {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 40px;
}

.view-section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.custom-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.6) transparent;
}

.custom-scroll::-webkit-scrollbar {
    width: 8px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.6);
    border-radius: 999px;
}

.funnel-stage {
    position: relative;
    z-index: 10;
    width: 100%;
    margin: 0 4px;
    background: rgba(99, 102, 241, 0.7);
    border: 1px solid rgba(129, 140, 248, 0.5);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px;
}

.funnel-stage span {
    font-size: 10px;
    font-weight: 700;
    color: #e0e7ff;
    text-transform: uppercase;
    line-height: 1.1;
}

.funnel-stage strong {
    margin-top: 4px;
    font-size: 20px;
    line-height: 1;
    color: white;
}

.funnel-stage em {
    margin-top: 4px;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    color: #e0e7ff;
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 4px;
    border-radius: 4px;
}

.funnel-rate {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 16px;
    color: #4f46e5;
    font-size: 13px;
    font-weight: 700;
}

.funnel-rate small {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-radius: 4px;
    padding: 4px;
}

.eer-journey-card {
    border-color: rgba(79, 70, 229, 0.18);
}

.eer-journey-card:hover {
    border-color: rgba(79, 70, 229, 0.32);
}

.eer-journey-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    background:
        linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(20, 184, 166, 0.08)),
        rgba(255, 255, 255, 0.42);
    border-bottom: 1px solid rgba(99, 102, 241, 0.18);
}

.eer-journey-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    color: #4338ca;
}

.eer-journey-title i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.12);
    color: #4f46e5;
    font-size: 18px;
}

.eer-journey-title h3 {
    min-width: 0;
    margin: 0;
    color: #4338ca;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.eer-journey-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid rgba(20, 184, 166, 0.22);
    border-radius: 7px;
    background: rgba(184, 116, 20, 0.1);
    color: #0f766e;
    font-size: 11px;
    font-weight: 800;
}

.eer-journey-body {
    padding: 26px 28px 30px;
}

.eer-journey-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
}

.eer-journey-track::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 44px;
    right: 44px;
    height: 2px;
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.32), rgba(20, 184, 166, 0.32));
}

.eer-stage {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.eer-stage-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, 0.86);
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #14b8a6);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.22);
}

.eer-stage-content {
    width: 100%;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    border: 1px solid rgba(99, 102, 241, 0.16);
    border-radius: 8px;
    background-color: rgba(26, 15, 93, 0.6);
    /* box-shadow: 0 16px 32px rgba(228, 77, 7, 0.08); */
    text-align: center;
}

.eer-stage-content span {
    min-height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.eer-stage-content strong {
    color: #111827;
    font-size: 30px;
    line-height: 1;
    font-weight: 900;
}

.eer-stage-content em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.12);
    font-size: 12px;
    line-height: 1;
    font-style: normal;
    font-weight: 900;
}

.eer-stage-content em.text-red-500 {
    background: rgba(239, 68, 68, 0.12);
}

html.dark .eer-journey-card {
    background: rgba(15, 23, 42, 0.86);
}

html.dark .eer-journey-header {
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(20, 184, 166, 0.1)),
        rgba(15, 23, 42, 0.78);
    border-bottom-color: rgba(148, 163, 184, 0.14);
}

html.dark .eer-journey-title,
html.dark .eer-journey-title h3 {
    color: #c7d2fe;
}

html.dark .eer-journey-title i {
    background: rgba(129, 140, 248, 0.14);
    color: #a5b4fc;
}

html.dark .eer-journey-pill {
    border-color: rgba(45, 212, 191, 0.18);
    background: rgba(45, 212, 191, 0.1);
    color: #5eead4;
}

html.dark .eer-journey-track::before {
    background: linear-gradient(90deg, rgba(129, 140, 248, 0.4), rgba(45, 212, 191, 0.38));
}

html.dark .eer-stage-marker {
    border-color: rgba(15, 23, 42, 0.92);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
}

html.dark .eer-stage-content {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(26, 15, 93, 0.6);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

html.dark .eer-stage-content span {
    color: #cbd5e1;
}

html.dark .eer-stage-content strong {
    color: #fff;
}

@media (max-width: 1100px) {
    .eer-journey-track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .eer-journey-track::before {
        display: none;
    }
}

@media (max-width: 640px) {
    .eer-journey-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 16px;
    }

    .eer-journey-body {
        padding: 20px 16px 24px;
    }

    .eer-journey-track {
        grid-template-columns: 1fr;
    }

    .eer-stage {
        align-items: stretch;
        flex-direction: row;
    }

    .eer-stage-marker {
        margin-top: 12px;
    }

    .eer-stage-content {
        min-height: 92px;
    }
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-row > i {
    width: 42px;
    text-align: center;
    font-size: 18px;
    color: #9bb894;
}

.progress-row > div {
    flex: 1;
    height: 21px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.progress-row span {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: flex-end;
    background: #3d944a;
    color: white;
    font-size: 8px;
    font-weight: 500;
    padding: 0 12px;
    border-radius: 6px;
}

.progress-row em {
    width: 48px;
    text-align: center;
    color: #34d399;
    font-size: 8px;
    font-style: normal;
    font-weight: 500;
}

.terminal-metrics-card {
    background: #f8fafc;
    border-color: #cfd6e3;
    border-radius: 15px;
    box-shadow: none;
}

html.dark .terminal-metrics-card {
    background: #f8fafc;
    border-color: #cfd6e3;
    box-shadow: none;
}

.terminal-metrics-card:hover {
    border-color: #cfd6e3;
}

.terminal-metrics-header {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 10px;
    /* background: #e7e7f8; */
    border-bottom: 1px solid #c8cdfb;
    /* color: #5b5cf1; */
}

.terminal-metrics-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    /* min-height: 330px; */
    padding: 30px 28px;
}

.terminal-metrics-body h5 {
    margin: 0 0 -4px;
    color: #6f7a8d;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
}

.terminal-progress-row {
    gap: 20px;
}

.terminal-progress-row > i {
    width: 40px;
    color: #172133;
    font-size: 22px;
}

.terminal-progress-row > div {
    height: 26px;
    background: #dedede;
    border: 1px solid #c6c8cc;
    border-radius: 5px;
}

.terminal-progress-row span {
    min-width: 34px;
    background: #6366f1;
    border-radius: 4px;
    font-size: 10px;
    line-height: 1;
    padding: 0 7px;
}

.terminal-progress-row-android > i {
    color: #10b981;
}

.terminal-progress-row-android span {
    background: #10b981;
}

.terminal-metrics-body .terminal-progress-row:nth-of-type(4) span {
    background: #43bd99;
}

.terminal-progress-row em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-height: 20px;
    border-radius: 5px;
    background: #dff5ed;
    color: #02b980;
    font-size: 13px;
    line-height: 1;
    font-style: normal;
    font-weight: 800;
}

@media (max-width: 767px) {
    .terminal-metrics-body {
        min-height: 0;
        padding: 24px 16px;
    }

    .terminal-progress-row {
        gap: 12px;
    }

    .terminal-progress-row > i,
    .terminal-progress-row em {
        width: 34px;
    }

    .terminal-metrics-body h5 {
        font-size: 8px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
