@media (max-width: 768px) {

    body, html {
        overflow-x: hidden;
        height: auto;
        min-height: 100vh;
        overscroll-behavior-y: none;
    }

    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
    }

    body.modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        left: 0;
    }

    input, select, textarea {
        font-size: 16px !important;
    }

    input[type="date"],
    input[type="datetime-local"] {
        -webkit-appearance: none;
        appearance: none;
        clip-path: inset(0 0 0 0 round 12px);
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        padding: 16px 15px;
        z-index: 1001;
        backdrop-filter: blur(8px);
    }

    .tab .logo{
        display: none;
    }

    .mobile-header .mobile-title {
        color: #fff;
        font-size: 16px;
        font-weight: 600;
    }

    .burger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        padding: 11px;
        width: 46px;
        height: 46px;
        cursor: pointer;
        position: relative;
        z-index: 1002;
        border: 1px solid rgba(32, 32, 32, 1);
        border-radius: 10px;
        background: rgba(13, 13, 13, 1);
    }

    .burger-menu span {
        width: 100%;
        height: 2.5px;
        background-color: #9A58F6;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .burger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .burger-menu.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }

    .burger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background-color: #0D0D0D;
        border-top: 1px solid #202020;
        z-index: 1001;
        padding: 8px 0;
        justify-content: space-around;
        align-items: center;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex: 1;
        padding: 4px;
        background: transparent;
        border: none;
        color: #868686;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .mobile-nav-item svg {
        width: 24px;
        height: 24px;
    }

    .mobile-nav-item svg rect {
        fill: #191919;
        transition: fill 0.3s ease;
    }

    .mobile-nav-item svg path {
        fill: #868686;
        stroke: #868686;
        transition: all 0.3s ease;
    }

    .mobile-nav-item.active {
        color: #9A58F6;
    }

    .mobile-nav-item.active svg rect {
        fill: #9A58F6;
    }

    .mobile-nav-item.active svg path {
        fill: #fff;
        stroke: #fff;
    }

    .mobile-nav-item span {
        font-size: 10px;
        font-weight: 500;
    }

    .container {
        flex-direction: column;
        height: auto;
        padding-top: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .tab {
        position: fixed;
        bottom: -100%;
        left: 0;
        right: 0;
        width: 100%;
        height: calc(100% - 80px);
        background-color: #030303;
        z-index: 1000;
        transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 16px 12px;
        overflow-y: auto;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(32, 32, 32, 1);
    }

    .tab.active {
        bottom: 0;
    }

    .tab::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 3px;
        background-color: #1C1C1C;
        border-radius: 2px;
    }

    .popup{
        top: 0!important;
        left: 0!important;
        width: 100%!important;
        height: 100%!important;
    }

    .overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 70px;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
        backdrop-filter: blur(4px);
        pointer-events: none;
    }

    .tab-btns{
        display: flex!important;
        width: auto;
        flex-shrink: 0;
    }

    .overlay.active {
        pointer-events: unset;
        opacity: 1;
    }

    main {
        padding: 20px 15px;
        height: auto;
        min-height: calc(100vh - 126px);
        margin: 0;
        border: 1px solid rgba(32, 32, 32, 1);
        border-radius: 22px;
        background: rgba(13, 13, 13, 1);
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .page-content {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    main .where {
        font-size: 10px;
        margin-bottom: 8px;
    }

    .page-title {
        font-size: 20px;
        margin-top: 0;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    .page-desc {
        font-size: 12px;
        margin-top: 4px;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    .stats-block {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 12px;
    }

    .stats-block .stats {
        min-height: 150px;
        padding: 14px;
        border-radius: 10px;
        width: calc(50% - 5px);

    }

    .stats-block .stats .stats-header {
        margin-bottom: 10px;
    }

    .stats-block .stats .stats-header svg {
        width: 20px;
        height: 20px;
    }

    .all-profit {
        font-size: 20px;
        margin-top: 6px;
        line-height: 1.2;
    }

    .all-profit-desc {
        font-size: 12px;
        margin-top: 4px;
    }

    .all-profit-percent {
        font-size: 10px;
        padding: 4px 6px;
    }

    .stats-diagram {
        margin-top: 10px;
        gap: 8px;
    }

    .stats-diagram svg {
        width: 40%;
        height: fit-content;
    }

    .graphs {
        flex-direction: column;
        gap: 12px;
        margin-top: 16px;
    }

    .graph {
        padding: 14px;
        border-radius: 10px;
    }

    .graph-title {
        font-size: 15px;
    }

    .graph-desc {
        font-size: 11px;
        margin-top: 3px;
    }

    .chart-container {
        margin-top: 12px;
        overflow-x: auto;
    }

    .chart {
        min-width: 600px;
    }

    .activity {
        flex-direction: column;
        gap: 12px;
        margin-top: 16px;
    }

    .activity-block {
        padding: 14px;
        border-radius: 10px;
    }

    .activity-title {
        font-size: 15px;
    }

    .activity-desc {
        font-size: 11px;
        margin-top: 3px;
    }

    .orders {
        margin-top: 12px;
        gap: 10px;
    }

    .orders .order {
        padding: 15px;
        border-radius: 10px;
    }

    .order-title {
        font-size: 13px;
    }

    .order-desc {
        font-size: 10px;
        margin-top: 3px;
    }

    .order-time {
        font-size: 10px;
        top: 10px;
        right: 12px;
    }

    .social {
        padding: 10px;
        border-radius: 10px;
    }

    .social-title {
        font-size: 12px;
    }

    .social-desc {
        font-size: 10px;
        margin-top: 2px;
    }

    .social-percent {
        font-size: 12px;
    }

    .deals-header {
        gap: 12px;
        margin-bottom: 16px;
        align-items: unset;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .deal-detail-flex{
        flex-wrap: wrap;
    }

    .deals-main-blocks-info {
        flex-wrap: wrap;
        & > div {
            flex: unset;
            width: calc(33.33% - 7px);
            align-items: center;
            padding: 12px;
            height: auto;
            min-height: 80px;

            &.big {
                width: 100%;
                flex: unset;
                gap: 15px;
                padding: 15px;
            }

            & > p{
                text-align: center;
                font-size: 12px;
            }
        }
    }

    .deals-blocks-info {
        overflow: visible;

        & > div{
            min-width: unset;
            white-space: normal;
        }
    }

    .deals-search{
        width: 100%;
    }

    .deals-cards{
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;

        & .card{
            padding: 15px;
            box-sizing: border-box;
        }
    }

    .autoresponder{
        width: 100%;
        padding: 15px;

        & .bottom-content{
            flex-wrap: wrap;
        }

        & .item{
            padding: 15px!important;
            height: auto!important;
            width: calc((100% - 20px) / 3)!important;

            & h3{
                font-size: 20px!important;
            }

            & p{
                font-size: 14px!important;
            }
        }
    }

    .deals-columns-header{
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;

        & .btn{
            width: 100%;
            justify-content: center;
        }

        & h3 {
            word-wrap: break-word;
            overflow-wrap: break-word;
        }
    }

    .deals-autoresponder-status{
        align-items: center;

        & .name{
            width: auto;

            & p{
                width: auto;
            }
        }

        & .stats{
            flex-direction: column;
            justify-content: center;
            align-items: flex-end;
            gap: 8px;
            width: auto;

            & p{
                width: auto;
                flex: 0 0 auto;
            }
        }
    }

    .download-report{
        width: 100%;
        padding: 15px;
        overflow-x: hidden;

        & .choose-report{
            width: 100%;
            max-width: 100%;
        }

        & .choose-report > div{
            flex-direction: column;
            gap: 10px;
            width: 100%;
            max-width: 100%;

            & label{
                flex: auto;
                width: 100%;
                min-width: 0;
                max-width: 100%;
                box-sizing: border-box;
                overflow: hidden;
                border-radius: 12px;
            }

            & input[type="date"]{
                width: 100%;
                max-width: 100%;
                box-sizing: border-box;
            }
        }
    }

    .popup-block-content > label:has(input[type="date"]),
    .popup-block-content > label:has(input[type="datetime-local"]) {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        border-radius: 12px;
    }

    .new-configuration > label:has(input[type="date"]),
    .new-configuration > label:has(input[type="datetime-local"]) {
        overflow: hidden;
        border-radius: 12px;
    }

    .popup-block-content:has(input[type="date"]),
    .popup-block-content:has(input[type="datetime-local"]) {
        overflow-x: hidden;
    }

    .reports-info{
        flex-direction: column;

        & p{
            width: 100%;
        }
    }

    .subscript {
        & .subscriptions {
            flex-direction: column;
        }
    }

    .support-block{
        flex-direction: column;
        gap: 15px;
    }

    .sub-status {
        & > div {
            & .main {
                font-size: 10px;

                & span{
                    font-size: 10px;
                }
            }
        }
    }

    .deals-column.settings {
        & .settings-block {
            padding: 15px;
        }
    }

    .admin-cards {
        width: 100%;

        & .card{
            gap: 15px;
            padding: 15px;
            background: rgba(18, 18, 18, 1);
            border: 1px solid rgba(32, 32, 32, 1);
            border-radius: 12px;

            & .card-header{
                flex-direction: column-reverse;
                gap: 5px;

                & p{
                    font-size: 11px;
                }
            }

            & > p{
                font-size: 20px;

                & span{
                    font-size: 12px;
                }
            }
        }
    }

    .big-card{
        width: 100%;
        min-width: unset;

        & .graph {
            & .first-svg{
                left: 0;
            }
            & .last-svg {
                margin-left: -15px;
            }
        }
    }

    #pageAdmin{
        & .deals-column {
            &.flex {
                flex-direction: column;
                overflow: hidden;
                gap: 10px;
            }

            &.nobg {
                padding: 0;
            }
        }

        & .admin-cards {
            display: flex !important;
            flex-wrap: wrap;
            width: 100% !important;
            gap: 10px;
        }

        & .admin-cards .card {
            width: calc(50% - 5px) !important;
            flex-shrink: 0;
        }

        & .big-card {
            width: 100% !important;
            min-width: unset !important;
            height: auto !important;
            min-height: 250px;
        }
    }

    #pageAutoresponder{
        height: unset;
        & .deals-columns{
            height: unset;

            & .deals-column .deals-active-place.first{
                height: unset;
            }
            & .deals-column .deals-active-place.second{
                height: unset;
            }

            & .inactive-place {
                margin: 25px 0;
                & > div {
                    margin: 0;
                }
            }
        }
    }

    .deals-existing-configurations {
        align-items: center;
        min-height: 120px;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .deals-existing-configurations .configuration {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;

        & .info {
            min-width: 0;
            flex: 1;

            & h4 {
                overflow: hidden;
                text-overflow: ellipsis;
            }
        }

        & .btns {
            flex-shrink: 0;
        }
    }

    .new-configuration {
        width: 100%;
        overflow: hidden;
        max-width: 100%;
        box-sizing: border-box;

        & > label, & > .form-field {
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;

            & > label.dots {
                & p {
                    white-space: normal;
                }
            }

            & .select-label {
                width: 100%;
                max-width: 100%;

                & select {
                    width: 100%;
                    max-width: 100%;
                    box-sizing: border-box;
                }
            }

            & .input-with-additional {
                width: 100%;
                flex-wrap: wrap;

                & input {
                    min-width: 0;
                    flex: 1 1 auto;
                }

                & .additional {
                    flex-wrap: wrap;
                    flex-shrink: 0;

                    & button {
                        white-space: nowrap;
                        font-size: 10px;
                        padding: 4px 8px;
                    }

                    & select {
                        min-width: 70px;
                    }
                }
            }
        }

        & input, & textarea, & select {
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
        }

        & > button {
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
        }
    }

    .deals-active-accounts{
        flex-direction: column;

        & .item{
            width: 100%;

            & .info{
                gap: 15px;
            }
        }
    }

    .deals-blocks-info {
        flex-direction: column;
        gap: 10px;
    }

    .deals-block-checks {
        flex-direction: column;
        flex-wrap: nowrap;
        overflow: visible;
        gap: 10px;

        & .block{
            width: 100%;
            min-width: unset;
            white-space: normal;
        }
    }

    .create-deal-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;

        &.px{
            margin: 0;
        }
    }

    .deals-filters {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 16px;
    }

    .deals-columns {
        grid-template-columns: 1fr!important;
        gap: 12px;
        width: 100%;
        max-width: 100%;
    }

    .deals-column {
        min-height: auto;
        padding: 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;

        &.flex {
            flex-direction: column;
        }
    }

    .deals-column-header h3 {
        font-size: 14px;
        flex: 1;
        min-width: 0;
    }

    .deal-card {
        padding: 15px;
        overflow: hidden;
    }

    .deal-actions {
        & > div {
            gap: 4px;
        }
    }

    .deal-btn {
        padding: 6px 8px;
        font-size: 10px;
    }

    .deal-card-preview {
        justify-content: space-between;
        gap: 12px;
    }

    .deal-total {
        font-size: 16px;
    }

    .deal-profit {
        font-size: 13px;
    }

    .popup-block-content > label.dots p {
        white-space: normal;
    }

    .popup.new-deal .popup-block-content{
        flex-wrap: wrap;
    }

    .popup.new-deal .popup-block-content.ones{
        flex-direction: column;
        align-items: stretch;
    }

    .popup.new-deal .popup-block-content.ones .first{
        flex: unset;
        width: 100%;
        white-space: nowrap;
    }

    .popup.new-deal .popup-block-content.ones .first input{
        font-size: 11px;
    }

    .popup.new-deal .popup-block-content.ones .second{
        flex: unset;
        width: 100%;
    }

    .popup.new-deal .popup-block-content.ones .third{
        flex: unset;
        width: 100%;
    }

    .popup-block-content.ones > div:not(.param-row){
        align-self: flex-start;
    }

    .popup-block-content.ones .param-row{
        flex-direction: column;
        align-items: stretch;
    }

    .popup-block-content.ones .param-row .remove-param-btn{
        align-self: flex-start;
    }

    .filter-dropdown {
        white-space: normal;
    }

    table.transactions{
        min-width:720px;
    }
}

@media (max-width: 480px) {

    table.transactions{
        min-width:600px;
    }
    thead th{
        padding:10px 12px;
        font-size:12px;
    }
    tbody td{
        padding:10px 12px;
        font-size:14px;
    }

    .mobile-header .mobile-title {
        font-size: 15px;
    }

    .mobile-bottom-nav {
        height: 65px;
        padding: 6px 0;
    }

    .mobile-nav-item svg {
        width: 22px;
        height: 22px;
    }

    .mobile-nav-item span {
        font-size: 9px;
    }


    .overlay {
        bottom: 65px;
    }


    .page-title {
        font-size: 18px;
    }

    .page-desc {
        font-size: 11px;
    }

    .stats-block {
        gap: 8px;
        margin-top: 10px;
    }

    .stats-block .stats {
        min-height: 140px;
        padding: 15px;
        border-radius: 8px;
    }

    .all-profit {
        font-size: 18px;
    }

    .all-profit-desc {
        font-size: 11px;
    }

    .chart-container {
        height: 180px;
    }

    .admin-cards {
        display: flex !important;
        flex-wrap: wrap;
        gap: 10px;
        width: 100% !important;
        max-width: 100%;
        overflow: hidden;
    }

    .admin-cards .card {
        width: calc(50% - 5px) !important;
        min-width: 0;
        flex-shrink: 0;
    }

    .admin-cards .card > p {
        font-size: 18px;
    }

    /* End btns with checkboxes mobile */
    .popup-block-content.end-btns {
        flex-direction: column;
        gap: 12px;
    }

    .popup-block-content.end-btns > div {
        width: 100%;
    }

    .popup-block-content.end-btns > div:last-child {
        flex-direction: column;
        gap: 10px;
        margin-top: 8px;
    }

    .popup-block-content.end-btns > div:last-child .close-popup,
    .popup-block-content.end-btns > div:last-child button {
        width: 100%;
        justify-content: center;
    }
}

@media screen and (max-width: 360px) {
    .stats-block .stats{
        width: 100%;
    }
}


/* Swipe animation for markers */
@media (max-width: 768px) {
    .deal-markers .marker {
        touch-action: pan-y;
        user-select: none;
        will-change: transform, opacity;
    }
}

@media (max-width: 768px) {
    #pageAdmin .admin-cards {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100% !important;
    }

    #pageAdmin .admin-cards .card {
        width: 100% !important;
        min-width: 0;
    }

    #pageAdmin .big-card {
        width: 100% !important;
        min-width: unset !important;
        height: auto !important;
    }
}
