* {
    font-family: 'Geist', sans-serif;
}

/* GLOBAL STYLES VARS - for using in whole project and to simplify figma styles copy/paste*/
:root {
    /*padding*/
    --spacing: 4px;
    --spacing1: 4px;
    --spacing2: 8px;
    --spacing3: 12px;
    --spacing4: 16px;
    --spacing5: 20px;
    --spacing6: 24px;
    --spacing7: 28px;

    /*radius*/
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-3xl: 24px;
    --radius-4xl: 32px;
    --border-radius: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 32px;

    /*font size*/
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-2xl: 24px;

    /*line height*/
    --font-line-height-5: 20px;
    --font-line-height-6: 24px;
    --font-line-height-7: 28px;
    --font-line-height-9: 36px;

    /*letter spacing*/
    --tracking-wide: 0.4px;
    --tracking-wider: 0.8px;

    /*colors*/
    --primary-color: var(--purple500);
    --primary-light: #1E033E;
    --primary-bg: #F0F0F9;
    --primary-highlight: #D3D3ED;

    --color-base-white: #FFFFFF;
    --content-main: #31373F;
    --main_background_color: #FDFDFF;
    --main-color: #4B5563;

    --purple: #1E033E;
    --purple10: #E8E6EC;
    --purple50: #D2CDD8;
    --purple100: #A59AB2;
    --purple200: #78688B;
    --purple300: #4B3565;
    --purple400: #1E033E;
    --purple500: #180232;
    --purple600: #120225;
    --purple700: #0C0119;
    --purple800: #06010C;
    --purple900: #030006;
    --purple950: #0C0C1D;

    --grey20: #E6E6E6;
    --grey50: #F9FAFB;
    --grey100: #F3F4F6;
    --grey150: #CED1DA7F;
    --grey200: #E5E7EB;
    --grey300: #D1D5DB;
    --grey340: #575757;
    --grey400: #9CA3AF;
    --grey500: #AAB0BD;
    --grey600: #4B5563;
    --grey700: #374151;

    --gray50: var(--grey50, #F9FAFB);
    --gray100: var(--grey100, #F3F4F6);
    --gray200: var(--grey200, #E5E7EB);
    --gray300: var(--grey300, #D1D5DB);
    --gray400: var(--grey400, #9CA3AF);
    --gray500: #6B7280;
    --gray600: var(--grey600, #4B5563);
    --gray700: var(--grey700, #374151);
    --gray800: #1F2937;

    --slate50: #F8FAFC;
    --slate100: #F1F5F9;
    --slate200: #E2E8F0;
    --slate300: #CBD5E1;
    --slate400: #94A3B8;
    --slate500: #64748B;
    --slate550: #657990;
    --slate600: #475569;
    --slate700: #334155;
    --slate800: #1E293B;
    --slate900: #0F172A;
    --slate950: #020617;

    --blue10: #F0F5FF;
    --blue50: #D1E2FF;
    --blue300: #5794FF;
    --blue400: #54ABC3;
    --blue500: #0561FF;
    --pink400: #C354A6;
    --red200: #FF808E;
    --green700: #00B078;
    --yellow700: #D6AE0D;

    --success-color: #00895E;
    --warning-color: #DB9D00;
    --danger-color: #FF566A;
    --info-color: #7020C6;
    --neutral-color: #51CFB4;

    --table-higlited-row: #F1F3F57F;
    --table-higlited-row-selected: #E3E3F37F;

    /*fonts*/
    --font-dm-sans: "DM Sans";
    /* Kept the token name for existing references; value is now Geist (app-wide font). */
    --font-inter: 'Geist', sans-serif;

    --shadow-sm: 0px 0px 16px rgba(207, 196, 240, 0.24);
    --shadow-md: 0px 0px 40px rgba(164, 162, 170, 0.4);

    --ag-selected-row-background-color: var(--purple10)
}

.flex {
    display: flex;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.leading,
.tracking,
.overflow-hidden,
.overflow-auto,
.overflow-hidden,
.relative {
}

.font-dm-sans {
    font-family: var(--font-dm-sans), sans-serif !important;
}

.font-inter {
    font-family: var(--font-inter), sans-serif !important;
}

.material-symbols-outlined {
    font-variation-settings: "FILL" 1,
    "wght" 400,
    "GRAD" 0,
    "opsz" 20
}

.material-symbols-rounded {
    font-variation-settings: "FILL" 1,
    "wght" 400,
    "GRAD" 0,
    "opsz" 20
}

html {
    height: 100%;
    scrollbar-gutter: stable;
}

body {
    height: 100%;
    width: 100%;
    background-color: var(--main_background_color);
    min-width: 1024px !important;
    min-height: 576px !important;
}

/* SELECTOR */
.selector {
    display: flex;
    flex-flow: row nowrap;
    gap: 20px;
    align-items: center;

    & > .selector_label {
        font-weight: bold;
        font-size: 14px;
        color: var(--grey400);
    }

    & > .selector_container {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #F5F5F5;
        border-radius: 9999px;
        padding: 4px;
        gap: 4px;
        width: max-content;
        border: 1px solid #EAEAEA;

        & > .selector_button {
            text-align: center;
            font-weight: bold;
            font-size: 14px;
            color: var(--grey400);
            background-color: transparent;
            padding: 8px 20px;
            border-radius: 9999px;
            border: none;
            cursor: pointer;
            transition: all 0.3s ease;

            &.active {
                background-color: var(--purple400);; /* Цвет активной кнопки */
                color: #FFFFFF;

                &:hover {
                    background-color: var(--purple400); /* Цвет текста при наведении на неактивную кнопку */
                }
            }

            &:hover:not(.active) {
                color: #657990; /* Цвет текста при наведении на неактивную кнопку */
            }
        }
    }

    &.toggle > .selector_container {
        background-color: var(--grey50);
        border: none;

        & > .selector_button {
            font-size: var(--text-sm);
            font-weight: 500;
            line-height: var(--font-line-height-6);
            letter-spacing: var(--tracking-wider);
            text-align: center;
            text-underline-position: from-font;
            text-decoration-skip-ink: none;
        }
    }
}


/*uses in different places*/
.content_block {
    display: flex;
    flex-flow: row nowrap;
    gap: 20px;
    padding: var(--spacing5);
    border-radius: var(--radius-2xl);

    &.column {
        flex-flow: column;
    }

    &.highlighted {
        background: var(--grey50);
    }

    &.white {
        background-color: #FFFFFF;
    }
}

.label_container {
    display: flex;
    align-items: center;
    gap: 8px;

    .color_circle {
        width: 8px;
        min-width: 8px;
        height: 8px;
        border-radius: 50%;

        &.large {
            width: 12px;
            min-width: 12px;
            height: 12px;
        }
    }

    .label {
        font-size: var(--text-xs);
        font-weight: 500;
        line-height: var(--font-line-height-5);
        letter-spacing: var(--tracking-wide);
        text-align: left;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
        text-wrap: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        flex: 1;

        &.link {
            cursor: pointer;

            &:hover {
                text-decoration: underline;
            }
        }
    }

    &.current {
        color: var(--purple500);

        .color_circle {
            background-color: var(--purple500);
        }
    }

    &.average {
        color: var(--gray500);

        .color_circle {
            background-color: var(--gray500);
        }
    }
}


/* SelectLizo container */
.dropdown {
    position: relative;
    display: inline-block;
    width: 181px; /* Adjust width as needed */


    /* Select wrapper */

    .selectWrapper {
        padding: var(--spacing2) var(--spacing3) var(--spacing2) var(--spacing3);
        border-radius: var(--radius-3xl);
        border: 1px solid var(--gray400, #9CA3AF);
        cursor: pointer;
        user-select: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        outline: none;
        transition: border-color 0.3s ease;
        background: #F9FAFBCC;
        color: var(--gray700);

        &:focus {
            border-color: #007BFF;
            box-shadow: 0 0 4px rgba(0, 123, 255, 0.6);
        }
    }
}

/* Placeholder or selected text */
[data-selected] {
    color: var(--gray700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: var(--font-line-height-5);
    letter-spacing: var(--tracking-wide);
    text-align: center;
    text-underline-position: from-font;
    text-decoration-skip-ink: none;

}

/* SelectLizo options wrapper */
.dropdownSelectWrapper {
    position: fixed;
    overflow-y: auto;
    background-color: #FFFFFF;
    z-index: 10;
    display: none; /* Hidden by default */
    width: 320px;
    max-height: 336px;
    padding: var(--spacing5);
    border-radius: 16px;
    border: 1px solid var(--gray200, #E5E7EB);
    box-shadow: 0 0 40px 0 #A4A2AA66;
}

.dropdown_title {
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 24px;
    text-align: left;
    text-underline-position: from-font;
    text-decoration-skip-ink: none;
    color: var(--gray500);
    margin-bottom: 16px;
}

/* Show dropdown when active */
.selectWrapper:focus + .dropdownSelectWrapper {
    display: block;
}

/* SelectLizo list */
.dropdownSelect {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing4);
}

/* SelectLizo options */
.dropdownSelectOption {
    padding: var(--spacing3) var(--spacing4);
    border-radius: var(--radius-xl);
    border: 1px solid transparent;
    background: var(--gray50, #F9FAFB);
    color: var(--gray600);
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: var(--font-line-height-6);
    letter-spacing: var(--tracking-wider);
    text-align: left;
    text-underline-position: from-font;
    text-decoration-skip-ink: none;
}

.dropdownSelectOption:hover {
    border: 1px solid var(--purple400, #1E033E);
}

/* Active/focused option */
.bg-zinc-200 {
    background-color: var(--purple50); /* Light gray */
    color: #FFFFFF;
}

.bg-blue-410 {
    background-color: var(--purple50); /* Light gray */
}

.dropdownSelectOption.global {
    background: var(--gray100, #F9FAFB);
    border: 1px solid transparent;

    &:hover {
        border: 1px solid var(--gray700);
    }

    &.bg-blue-410 {
        background-color: var(--grey300); /* Light gray */
    }
}

.chart_card {
    display: flex;
    flex-direction: column;
    gap: 16px;

    padding: var(--spacing4);
    border-radius: 16px;
    border: 1px solid #F3F4F6;
    box-shadow: 0 0 16px 0 #CFC4F03D;

    .selects_container {
        display: flex;
        flex-flow: row nowrap;
        gap: 16px;
    }
}

[chart-container] {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tooltip {
    position: absolute;
    bottom: 110%; /* Position below */
    left: 0;
    background-color: #333333;
    color: #FFFFFF;
    white-space: normal;
    width: max-content;
    z-index: 10;
    display: none; /* Hidden by default */
    padding: 4px 12px 4px 12px;
    gap: 8px;
    border-radius: 2px;
    background: var(--gray500, #6B7280);
    box-shadow: 0 2px 8px 0 #00000026;
}

.prev-page-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: var(--font-line-height-6);
    letter-spacing: var(--tracking-wider);
    text-align: left;
    text-underline-position: from-font;
    text-decoration-skip-ink: none;
    color: var(--main-color);
    width: fit-content;
}

.table_wrapper {
    /*height: 624px;*/
    height: 571px;

    .table-container {
        width: 100%;
        height: 100%;
    }
}

.dropdownMenuWrapper {
    position: fixed;
    overflow-y: auto;
    z-index: 10;
    display: none; /* Hidden by default */
    min-width: 200px;
    background-color: #FFFFFF;
    padding: var(--spacing5);
    border-radius: 16px;
    border: 1px solid var(--gray200, #E5E7EB);
    box-shadow: 0 0 40px 0 #A4A2AA66;

    &.systemDropdown {
        background-color: #444444;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        padding: 4px;
        border-radius: 12px;
        border: none;

        .menuItemsList {
            gap: 3px;

            .menuItem {
                padding: 10px 15px;
                transition: background-color 0.3s ease;
                font-size: var(--text-sm);
                font-weight: 500;
                line-height: var(--font-line-height-6);
                letter-spacing: var(--tracking-wider);
                text-align: left;
                text-underline-position: from-font;
                text-decoration-skip-ink: none;
                color: white;
                background-color: #444444;

                &:hover {
                    background-color: var(--grey340);
                    cursor: pointer;
                }
            }
        }
    }


    &.open {
        display: block;
    }

    .menuItemsList {
        list-style: none;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;

        .menuItem {
            padding: var(--spacing3) var(--spacing4);
            border-radius: var(--radius-xl);
            border: 1px solid transparent;
            background: var(--gray50, #F9FAFB);
            color: var(--gray600);
            cursor: pointer;
            transition: background-color 0.3s ease;
            font-size: var(--text-sm);
            font-weight: 500;
            line-height: var(--font-line-height-6);
            letter-spacing: var(--tracking-wider);
            text-align: left;
            text-underline-position: from-font;
            text-decoration-skip-ink: none;
            display: flex;
            align-items: center;
            gap: 10px;

            &:hover {
                border: 1px solid var(--purple400, #1E033E);
            }
        }
    }
}

.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100vh;
    background: #222222;
    color: #FFFFFF;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
    transition: left 300ms ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 10;

    &.open {
        left: 0;
    }

    .sidebar-wrapper {
        height: 100%;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        position: relative;

        .sidebar-content {
            flex-grow: 1;
            overflow-y: auto;
            padding-top: 40px;
        }

        .close-btn {
            position: absolute;
            top: 10px;
            right: 10px;
            font-size: 20px;
            background: none;
            border: none;
            color: white;
            cursor: pointer;
            border-radius: 50%;

            &:hover {
                color: #000000;
                background-color: #FFFFFF;
            }
        }
    }
}

.defaultAgGridCell {
    display: flex;
    align-items: center;
    word-wrap: break-word;
    white-space: normal;
    line-height: normal;

    &.common {
        font-weight: 500;
        font-size: 14px;
    }

    &.highlighted {
        font-weight: bold;
    }

}

.cellWithLink:hover {
    cursor: pointer;
    text-decoration: underline;
}

/*  AG GRID TABLE STYLES*/

.ag-header-cell {
    border-right: 1px solid #E6E6E6;
    color: #657990;
    font-weight: 600;

    &:last-child {
        border-left: unset;
    }

    &.ag-column-last {
        border-right: unset !important;
    }
}

/*  set pagination items to the left side*/
.ag-paging-panel {
    justify-content: flex-start;
}

.dashboard_info-card {
    /*min-width: 325px;*/
    height: 180px;
    max-width: 420px;
    padding: 12px 12px;
    border-radius: var(--radius-2xl);
    border: 1px solid var(--gray200, #E5E7EB);
    background: var(--color-base-white, #FFFFFF);
    flex: 1;

    .info-card_title {
        min-width: fit-content;
        white-space: nowrap;
        font-size: var(--text-xs);
        font-weight: 600;
        line-height: var(--font-line-height-5);
        letter-spacing: var(--tracking-wide);
        text-align: left;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
        color: var(--gray600);
    }

    &.type_of_structure {
        display: flex;
        align-items: center;

        & > .chart_legend {
            display: flex;
            flex-direction: column;
            gap: 8px;
            flex: 1;

            & > .legend_container {
                display: flex;
                flex-direction: column;
                gap: 4px;

                & > .legend_title {
                    font-size: var(--text-xs);
                    font-weight: 500;
                    line-height: var(--font-line-height-5);
                    letter-spacing: var(--tracking-wide);
                    text-align: left;
                    text-underline-position: from-font;
                    text-decoration-skip-ink: none;
                    color: var(--purple500);

                    &.average {
                        color: var(--gray500);
                    }
                }
            }
        }

        .pie_chart {
            display: flex;
            align-items: center;
            flex: 1;
            height: calc(100% - 12px);
            width: 122px;

            & > canvas {
                width: 100%;
                height: 100%;
                max-width: 140px;
                max-height: 140px;
            }
        }
    }

    &.age_groups {
        display: flex;
        flex-direction: column;
        gap: 4px;

        & > .card_head {
            display: flex;
            justify-content: space-between;

            & > .groups_labels {
                padding-left: 4px;
                display: flex;
                gap: 4px;
            }
        }

        .bar_chart {
            width: 100%;
            height: calc(100% - 14px);
        }
    }

    &.persons_per_household {
        display: flex;
        flex-direction: column;
        justify-content: space-between;

        & > .stat-card_container {
            display: flex;
            flex-direction: row;
            gap: 8px;
        }
    }

    &.ownership {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-width: 288px;

        & > .progress-bar_wrapper {
            height: calc(100% - 56px);
            display: flex;
            flex-direction: column;
            justify-content: space-between;

            & > .progress-bar_container {
                display: flex;
                flex-direction: column;
                gap: 8px;

                & > .progress-bar_legend {
                    display: flex;
                    justify-content: space-between;

                    & > .label {
                        font-size: var(--text-xs);
                        font-weight: 500;
                        line-height: var(--font-line-height-5);
                        letter-spacing: var(--tracking-wide);
                        text-align: left;
                        text-underline-position: from-font;
                        text-decoration-skip-ink: none;
                        text-wrap: nowrap;

                        &.current {
                            color: var(--purple500);
                        }

                        &.average {
                            color: var(--gray500);
                        }
                    }

                    & > .values_container {
                        display: flex;
                        gap: 4px;

                        & > div {
                            padding: 0 var(--spacing1);
                            gap: var(--spacing1);
                            border-radius: 4px;
                            font-size: var(--text-xs);
                            font-weight: 500;
                            line-height: var(--font-line-height-5);
                            letter-spacing: var(--tracking-wide);
                            text-align: left;
                            text-underline-position: from-font;
                            text-decoration-skip-ink: none;

                        }
                    }

                    &.current {
                        & > .label {
                            color: var(--purple500);
                        }
                    }

                    &.average {
                        & > .label {
                            color: var(--gray500);
                        }

                        & > .values_container {
                            & > .occupied {
                                color: var(--gray500);
                                background-color: var(--gray100);
                            }

                            & > .vacant {
                                color: var(--gray500);
                                border: 1px solid var(--gray200)
                            }
                        }
                    }
                }

                & > .progress-bar {
                    height: 6px;
                    width: 100%;
                    border-radius: 4px;
                    overflow: hidden;

                    & > .fill_bar {
                        height: 100%;
                        width: 0;
                        transition-duration: 500ms;
                        color: transparent;
                    }

                    &.current {
                        border: 1px solid var(--purple50);
                        background-color: var(--purple200);

                        & > .fill_bar {
                            background-color: var(--purple500);
                        }
                    }

                    &.average {
                        border: 1px solid var(--gray100);
                        background-color: var(--gray300);

                        & > .fill_bar {
                            background-color: var(--gray500);
                        }
                    }
                }
            }
        }
    }
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 22px 16px;
    max-width: 95px;
    gap: var(--spacing1);
    border-radius: var(--radius-2xl);

    & > .value {
    / / styleName: Headline / H4;
        font-size: var(--text-2xl);
        font-weight: 700;
        line-height: var(--font-line-height-9);
        letter-spacing: var(--tracking-wider);
        text-align: left;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
    }

    & > .label {
        font-size: var(--text-xs);
        font-weight: 500;
        line-height: var(--font-line-height-5);
        letter-spacing: var(--tracking-wide);
        text-align: left;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
        text-wrap: nowrap;
    }
}

.chip {
    padding: 0 var(--spacing2);
    gap: var(--spacing1);
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: var(--font-line-height-5);
    letter-spacing: var(--tracking-wide);
    text-align: left;
    text-underline-position: from-font;
    text-decoration-skip-ink: none;
    text-wrap: nowrap;

    &.filled {
        &.highlighted {
            color: var(--purple600);
            background: var(--purple10);

            &.dark {
                background: var(--purple50);
            }
        }

        &.default {
            color: var(--gray500);
            background: var(--gray100);
        }
    }

    &.outlined {
        &.highlighted {
            color: var(--purple500);
            border: 1px solid var(--purple200);
        }

        &.default {
            color: var(--gray500);
            border: 1px solid var(--gray200);
        }
    }
}

.range-statistic_wrapper {
    display: flex;
    flex-flow: column;
    gap: 12px;
    max-width: 400px;

    .range-statistic {
        display: flex;
        flex-flow: row nowrap;
        justify-content: space-between;
        align-items: center;
        padding: var(--spacing4);
        gap: 20px;
        border-radius: var(--radius-2xl);
        background-color: #FFFFFF;

        .label {
            font-size: var(--text-xs);
            font-weight: 600;
            line-height: var(--font-line-height-5);
            letter-spacing: var(--tracking-wide);
            text-align: left;
            text-underline-position: from-font;
            text-decoration-skip-ink: none;
            color: var(--gray500);
            text-wrap: nowrap;
        }

        .range_item {
            width: 177px;
            height: 8px;
            border-radius: 16px;
            background: linear-gradient(90deg, #E88181 0%, #F2DA60 40%, #7CFACE 100%);
            position: relative;

            .range_pointer {
                width: 4px;
                height: 16px;
                border-radius: 12px;
                background: var(--gray600);
                position: absolute;
                top: 50%;
                left: 0;
                opacity: 0;
                color: transparent;
                transform: translate(-50%, -50%);
                transition-duration: 500ms;
            }
        }
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.carousel-container

@apply relative overflow-hidden;
.cards-page

@apply absolute inset-0 transition-transform duration-500;


.trend-arrow {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.trend-arrow.up {
    transform: rotate(-90deg);
}

.trend-arrow.down {
    transform: rotate(90deg);
}

.trend-arrow.up-right {
    transform: rotate(-45deg);
}

.trend-arrow.down-right {
    transform: rotate(45deg);
}

.trend-arrow.success {
    color: var(--success-color);
}

.trend-arrow.warning {
    color: var(--warning-color);
}

.trend-arrow.danger {
    color: var(--danger-color);
}

.trend-arrow.info {
    color: var(--info-color);
}

.trend-arrow.neutral {
    color: var(--neutral-color);
}
