:root {
    /* Colors */
    --bg-primary: #f8fafc;
    --p-primary-color: #334155;
    --p-secondary-color: #667180;
    --white: #f8fafc;
    --blue1: #065084;
    --blue2: #0F828C;
    --blue3: #78B9B5;
    --accent: #320A6B;

    /* Notifications */
    --success-bg: #e6f4ea;
    --success-border: #34a853;
    --success-text: #1e4620;
    --info-bg: #e8f0fe;
    --info-border: #4285f4;
    --info-text: #1a2e57;
    --warning-bg: #fef7e0;
    --warning-border: #fbbc04;
    --warning-text: #5c4400;

    /* Sizes */
    --max-width: 1400px;
    --h1-size: 4rem;
    --h1-spacing: 0.08rem;
    --h1-height: 4.5rem;
    --h2-size: 2.6rem;
    --h2-spacing: .12rem;
    --h3-size: 2.2rem;
    --h4-size: 1.8rem;
    --h5-size: 1.6rem;
    --h6-size: 1.4rem;
    --p-size: 1.2rem;
    --p-height: 1.8rem;
    --p-spacing: 1.2px;
    --p-secondary-size: 1rem;
    --p-secondary-height: 1.5rem;
    --p-secondary-spacing: 0.9px;

    /* Spacing */
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 32px;
    --spacing-xl: 64px;

    /* Border */
    --standard-border-radius: 8px;

    /* Shadow */
    --standard-box-shadow: 0px 2px 8px 0px rgba(60, 64, 67, 0.25);
    --modal-box-shadow: 0 5px 30px 0 rgb(0 0 0 / 10%);
    --input-focus-shadow: 0 0 0 1px var(--blue2) inset;

    /* Gradients */

}

/* Reset */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* General */

html, body {
    width: 100%;
    position: relative;
    overflow-x: hidden;
    padding: 0;
    margin: 0;

    &.stop-scrolling {
        height: 100%;
        overflow: hidden;
    }
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* align-items: center; */
    gap: var(--spacing-md);
    font-family: "Inter", sans-serif;
    background-color: var(--bg-primary);
    color: var(--p-primary-color);
}

main {
    width: 100%;
    /* max-width: var(--max-width); */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--spacing-xl) * 2);
    /* padding: 0 var(--spacing-xl); */
}

h1 {
    font-size: var(--h1-size);
    font-weight: 700;
    letter-spacing: var(--h1-spacing);
    line-height: var(--h1-height);
    & span {
        color: var(--blue1);
    }
}

h2 {
    font-size: var(--h2-size);
    letter-spacing: var(--h2-spacing);
    font-weight: 600;
}

h3 {
    font-size: var(--h3-size);
    font-weight: 600;
}

h4 {
    font-size: var(--h4-size);
    font-weight: 600;
}

h5 {
    font-size: var(--h5-size);
    font-weight: 600;
}

h6 {
    font-size: var(--h6-size);
    font-weight: 600;
}

p {
    color: var(--primary-text);
    font-size: var(--p-size);
    line-height: var(--p-height);
    margin: 0;
    padding: 0;
    &.secondary {
        font-size: var(--p-secondary-size);
        line-height: var(--p-secondary-height);
        color: var(--p-secondary-color);
    }

    &.title {
        font-weight: 600;

        & span.quantity {
            display: inline-block;
            box-sizing: border-box;
            line-height: 1;
            padding: 4px;
            border-radius: var(--standard-border-radius);
            box-shadow: var(--standard-box-shadow);
            font-weight: 400;
            font-size: calc(var(--p-size) / 1.5);
            transform: translate(4px, -8px);
        }
    }

    &.utmLink {
        color: var(--blue1);
    }
}

a {
    color: var(--p-size);
    text-decoration: none;
    font-weight: 400;
    transition: color .2s;
    &:hover {
        color: var(--blue1);
    }
}

button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background-color: var(--blue1);
    border: 2px solid var(--blue1);
    color: var(--white);
    border-radius: var(--standard-border-radius);
    font-weight: 500;
    font-size: var(--p-secondary);
    padding: var(--spacing-sm) var(--spacing-md);
    transition: background-color .2s, color .2s, border-color .2s;
    /* line-height: 0; */

    &.secondary {
        background-color: transparent;
        color: var(--blue1);
    }

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

/* Table */

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: var(--spacing-sm);
    text-align: center;
}

td {
    padding: var(--spacing-sm);
    text-align: center;
}

thead {
    color: #6b7280;
    border-bottom: 1px solid #d1d5db;
}

tbody tr {
     border-bottom: 1px solid #e5e7eb;
}

/* Form */

.formContainer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);

}

form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
    border-radius: var(--standard-border-radius);

    & .formRow {
        display: flex;
        gap: var(--spacing-md);
        flex-wrap: nowrap;

        & .formField {
            width: 50%;
        }
    }

    & .formField {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    & button {
        align-self: flex-start;
    }
}

label {
    display: block;
    /* margin-bottom: 0.25rem; */
}

input, select, textarea {
    box-sizing: border-box;
    font-family: "Inter", system-ui, sans-serif;
    width: 100%;
    padding: var(--spacing-sm);
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: var(--standard-border-radius);
    transition: box-shadow .1s;

    &:focus {
        outline: none;
        box-shadow: var(--input-focus-shadow);
    }
}

input[type=checkbox] {
    opacity: 0;
    width: 0;
    position: absolute;
    left: 0;

    &:checked + label {

        &::before {
            opacity: 1;
        }
    }
}

label.checkbox {
  position: relative;
  width: 16px;
  height: 16px;
  /* border-radius: var(--standard-border-radius); */
  border: 1px solid var(--p-primary-color);
  /* box-shadow: var(--standard-box-shadow); */
  /* background-color: red; */
  transition: background-color .05s;

  &::before {
    content: "";
    position: absolute;
    box-sizing: border-box;
    left: 0;
    bottom: 0;
    width: 18px;
    height: 10px;
    transform: rotate(-45deg) translate(35%, -45%);
    border-left: 1px solid green;
    border-bottom: 1px solid green;
    transition: opacity .2s;
    opacity: 0;
  }
}

textarea {
    resize: none;
}

/* Tabs */
body > .tabs {
    /* width: 100%; */
    display: flex;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
    margin: var(--spacing-sm) var(--spacing-sm) 0;
    padding: var(--spacing-md);
    gap: var(--spacing-md);
    border-radius: var(--standard-border-radius);
    box-shadow: var(--standard-box-shadow);
    overflow-x: auto;

    & .tab {
        box-sizing: border-box;
        padding: var(--spacing-sm);
        border-radius: var(--standard-border-radius);
        transition: background-color .2s;
        position: relative;

        &::after {
            content: "";
            width: 100%;
            height: 2px;
            background-color: transparent;
            position: absolute;
            bottom: 0;
            left: 0;
            border-radius: 1px;
            transition: background-color .2s;
        }

        &:hover {
            color: var(--p-primary-color);
            &::after {
                background-color: var(--blue2);
            }
        }

        &.active {
            /* color: var(--white); */
            &::after {
                background-color: var(--blue2);
            }
        }
    }

    & #logoutBtn {
        margin-left: auto;
    }
}

/* Content */
body > .content {
    /* width: 100%; */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: var(--spacing-md);
    box-sizing: border-box;
    margin: 0 var(--spacing-sm) var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--standard-border-radius);
    box-shadow: var(--standard-box-shadow);
}

/* Grid */
.content > .grid {
    width: 100%;
    display: grid;
    gap: var(--spacing-md);
    grid-template-columns: 1fr 1fr;

    & .card {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
        box-sizing: border-box;
        padding: var(--spacing-sm);
        border-radius: var(--standard-border-radius);
        box-shadow: var(--standard-box-shadow);

        & div.title {
            display: flex;
            align-items: center;
            gap: var(--spacing-sm);

            & svg {
                color: var(--blue2);
            }

            & p {
                font-weight: 500;
            }
        }

        & div.cardContent {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: var(--spacing-sm);

            & .pricingItem {
                font-size: var(--p-secondary-size);
                width: 100%;
                display: grid;
                gap: var(--spacing-sm);
                grid-template-columns: 3fr 1fr 1fr 1fr;

                &.header {
                    font-weight: 500;
                }

                & p {
                    width: 100%;
                    display: flex;
                    align-items: center;

                    & svg {
                        transition: color .2s;
                    }

                    &.deleteBtn {
                        &:hover {
                            cursor: pointer;
                            & svg {
                                color: var(--blue1);
                            }
                        }
                    }
                }
            }

            & .newPricingForm {
                display: flex;
                flex-direction: column;
                gap: var(--spacing-sm);
            }
        }
    }
}

/* PartnersContainer */
.content > .partnersContainer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);

    & .row {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 3fr 1fr;
        gap: var(--spacing-md);
        box-sizing: border-box;
        padding: var(--spacing-sm);
        border-radius: var(--standard-border-radius);
        box-shadow: var(--standard-box-shadow);

        & div.title {
            display: flex;
            align-items: center;
            gap: var(--spacing-sm);

            & svg {
                color: var(--blue2);
            }

            & p {
                font-weight: 500;
            }
        }

        & div.stats {
            width: 100%;
            display: grid;
            grid-template-columns: 1fr 1fr;
        }

        & div.deleteBtn {
            width: 32px;
            display: flex;
            align-items: center;
            justify-content: center;

            &:hover {
                cursor: pointer;
                & svg {
                    color: var(--blue1);
                }
            }
        }
    }

    & .card {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
        box-sizing: border-box;
        padding: var(--spacing-sm);
        border-radius: var(--standard-border-radius);
        box-shadow: var(--standard-box-shadow);

        & div.title {
            display: flex;
            align-items: center;
            gap: var(--spacing-sm);

            & svg {
                color: var(--blue2);
            }

            & p {
                font-weight: 500;
            }
        }

        & div.cardContent {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: var(--spacing-sm);

            & .pricingItem {
                font-size: var(--p-secondary-size);
                width: 100%;
                display: grid;
                gap: var(--spacing-sm);
                grid-template-columns: 3fr 1fr 1fr 1fr;

                &.header {
                    font-weight: 500;
                }

                & p {
                    width: 100%;
                    display: flex;
                    align-items: center;

                    & svg {
                        transition: color .2s;
                    }

                    &.deleteBtn {
                        &:hover {
                            cursor: pointer;
                            & svg {
                                color: var(--blue1);
                            }
                        }
                    }
                }
            }

            & .newPricingForm {
                display: flex;
                flex-direction: column;
                gap: var(--spacing-sm);
            }
        }
    }
}

/* PartnerDetailsContainer */
.content > .partnerDetailsContainer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);

    & div.title {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);

        & svg {
            color: var(--blue2);
        }

        & p {
            font-weight: 500;
        }
    }

    & div.partnerStatsContainer {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
        & div.partnerStatItem {
            &:not(:first-of-type) {
                padding: var(--spacing-sm);
                box-sizing: border-box;
                border-radius: var(--standard-border-radius);
                box-shadow: var(--standard-box-shadow);
            }
        }
    }

}

/* PromoTable */
.content > .promoTable {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: var(--spacing-md);

    box-sizing: border-box;
    padding: var(--spacing-md);
    border-radius: var(--standard-border-radius);
    box-shadow: var(--standard-box-shadow);

    & div.title {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);

        & svg {
            color: var(--blue2);
        }
    }

    & div.newUTMForm {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    & td.deletePromoBtn {
        & svg {

            transition: color .2s;
            &:hover {
                cursor: pointer;
                color: var(--blue1);
            }
        }
    }
}

/* UsersTable */
.content > .userTable {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: var(--spacing-md);

    box-sizing: border-box;
    padding: var(--spacing-md);
    border-radius: var(--standard-border-radius);
    box-shadow: var(--standard-box-shadow);

    & .header {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);

        & .search {
            padding: var(--spacing-sm);
            box-sizing: border-box;
            border-radius: var(--standard-border-radius);
            border: 1px solid #d1d5db;
            width: 100%;
            display: flex;
            align-items: center;
            gap: var(--spacing-sm);
            transition: box-shadow .2s;

            & svg {
                padding: 0 0 0 var(--spacing-sm);
            }

            & input {
                border: none;
                background-color: transparent;

                &:focus {
                    box-shadow: none;
                }
            }
        }
        
        & .search:focus-within {
            box-shadow: var(--input-focus-shadow);
        }
    }
    
    & .filters {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);

        & .filtersContainer {
            display: flex;
            flex-direction: column;
            gap: var(--spacing-sm);
            border-radius: var(--standard-border-radius);
            box-shadow: var(--standard-box-shadow);
            padding: var(--spacing-sm);
            box-sizing: border-box;

            & .filter {
                display: flex;
                align-items: center;
                gap: var(--spacing-sm);
            }
        }
    }

    & .paginator {
        width: 100%;

        & ul {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            gap: var(--spacing-sm);

            & li {
                position: relative;
                padding: var(--spacing-sm);

                &::after {
                    content: "";
                    width: 100%;
                    height: 2px;
                    background-color: transparent;
                    position: absolute;
                    bottom: 0;
                    left: 0;
                    border-radius: 1px;
                    transition: background-color .2s;
                }

                &.active {
                    color: var(--blue2);

                    &::after {
                        background-color: var(--blue2);
                    }
                }

                &:hover {
                    cursor: pointer;
                    color: var(--blue2);

                    &::after {
                        background-color: var(--blue2);
                    }
                }
            }
        }
    }
}

.content > .botContainer {

    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);

    & div.title {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);

        & svg {
            color: var(--blue2);
        }
    }

    & div.chartsContainer {
        box-sizing: border-box;
        padding: var(--spacing-md);
        /* border-radius: var(--standard-border-radius); */
        /* box-shadow: var(--standard-box-shadow); */
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: var(--spacing-md);

        & .chart {
            display: flex;
            flex-direction: column;
            gap: var(--spacing-sm);
            width: 100%;
            max-height: 400px;

            & canvas {
                max-height: 300px;
            }
        }
    }
}

.content > .signinForm {
    /* width: 100%; */
    /* min-height: 90vh; */
    box-sizing: border-box;
    padding: var(--spacing-md);
    border-radius: var(--standard-border-radius);
    /* box-shadow: var(--standard-box-shadow); */
    align-self: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
}