:root {
    --red: #b41f2c;
    --gray: #CCCCCC;
    --light-gray: #f0f0f1;
    --dark-gray: #777777;
    --green: #0B8209;
    --orange: #FF9900;
}

body {
    margin: 20px;
    min-height: calc(100% - 40px);
}

p.success {
    border: 1px solid var(--green);
    padding: 5px;
    color: var(--green);
    border-radius: 5px;
    position: relative;
    display: flex;
    gap: 3px;
    align-items: center;
}

p.success:before {
    content: '\f12a';
    font-family: Dashicons;
    font-size: 16px;
}

p.success:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--green);
    left: 0;
    top: 0;
    opacity: .1;
    z-index: 1;
}

.dashboard {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(3, 1fr);
}

a,
a:active {
    color: var(--red);
    text-decoration: none;
}

a:hover {
    color: var(--red);
    text-decoration: underline;
}

section {
    padding: 0;
}

header {
    border-bottom: 1px solid var(--gray);
    padding-bottom: 20px;
}

header,
.title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    text-align: right;
}

header > img {
    max-width: 40px;
}

.title h2 {
    margin: 0;
}

.button,
button,
.wp-block-button__link {
    background: var(--red);
    border: none !important;
    color: white;
    text-decoration: none;
    font-size: 13px;
    margin: 0;
    padding: 5px 10px;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    -webkit-appearance: none;
    border-radius: 3px;
    white-space: nowrap;
    box-sizing: border-box;
    transition: all .3s;
}

.button:hover,
button:hover,
.wp-block-button__link:hover {
    text-decoration: none;
    color: white;
    transform: scale(1.1);
}

.button-primary {
    background: black;
    border-color: black;
    color: white;
}

.button-primary:focus,
.button-primary:hover {
    background: var(--red);
    border-color: var(--red);
    color: white;
}

.login {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 40px);
}

.login img {
    display: block;
    margin: 0 auto 20px;
}

.login .error {
    color: var(--red);
    text-align: center;
    margin-top: 40px;
}

form.loading > * {
    opacity: 0.1;
    pointer-events: none;
}

form.loading:before {
    content: 'carregando informações...';
    position: fixed;
    left: calc(50% - 80px);
    top: calc(50vh - 10px);
    z-index: 9999;
    font-weight: 700;
}

form,
form > fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 500px;
    width: 100%;
}

form > fieldset {
    margin-bottom: 20px;
}

form > fieldset > legend {
    font-weight: 700;
    margin-bottom: 20px;
}

form .form-field,
form p {
    min-width: 100%;
    min-width: 100%;
    margin: 0;
}

form .form-field.flex {
    display: flex;
    flex-wrap: wrap;
    column-gap: 10px;
}

form .form-field.flex > * {
    flex: 1;
}

form .form-field.flex label {
    min-width: 100%;
}

form .form-field input[type=text],
form .form-field input[type=email],
form .form-field input[type=number],
form .form-field input[type=date],
form .form-field select,
form > p input[type=text],
form > p input[type=password] {
    width: calc(100% - 2px);
}

form input:invalid,
form select:invalid {
    color: var(--red);
}

form .form-field select {
    padding: 0 5px;
    min-height: 30px;
    max-width: 100%;
    font-size: 14px;
}

form > p:last-child {
    margin-top: 10px;
}

form .form-field label,
form > p label {
    display: block;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px;
}

/* STATS */

section.stats {
    grid-column: 1 / span 3;
}

section.stats form {
    display: flex;
    max-width: 195px;
    position: relative;
}

section.stats form .form-field {
    min-width: initial;
    flex: 1;
}

section.stats form .form-field:first-child {
    max-width: 75px;
}

section.leaders {
    grid-column: 1 / span 3;
}

/* TABLE */

table,
table th,
table td {
    white-space: nowrap;
    border: 1px solid var(--light-gray);
}

table .userinfo {
    position: relative;
    overflow-x: auto;
}

table strong {
    color: var(--red);
    font-size: 1rem;
}

table .dashicons {
    font-size: 18px;
    color: var(--red);
}

section.qrs {
    grid-column: 1 / span 3;
}

/* COMMISSION */

section.commission {
    grid-column: 1 / span 3;
}

section.commission span {
    font-weight: 700;
    color: var(--red);
}

section.commission li {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray);
}

section.commission li:last-child {
    border: none;
    padding-bottom: 0;
}

section.commission li:before {
    content: "\f18e";
    font-family: Dashicons;
    margin-right: 5px;
    font-size: 20px;
    line-height: 20px;
    vertical-align: -5px;
    color: var(--red);
}

/* NEW CUSTOMER */

.new-customer .qr {
    text-align: center;
}

.new-customer .qr figure {
    width: 300px;
    height: 300px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray);
    background: white;
    margin: 20px auto;
}

.new-customer .qr figure:before {
    content: 'carregando QR...';
    position: absolute;
}

.new-customer .qr figure img {
    z-index: 1;
}

.new-customer .qr .button {
    display: inline-block;
}

section.box {
    background-color: white;
    padding: 15px;
    border: 1px solid var(--gray);
}

section.chart {
    padding: 15px 5px;
}

/* PROFILE */

section.profile {
    grid-column: 1 / span 1;
}

section.profile .info-section:not(:last-child){
    border-bottom: 1px solid var(--gray);
}

/* STORE */

section.store {
    grid-column: 2 / span 2;
}

section.store a {
    word-break: break-all;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* GOALS */

section.goals {
    grid-column: 1 / span 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 100px;
}

section.goals .legend {
    background: var(--light-gray);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 5px;
}

section.goals .legend p {
    font-weight: bold;
    font-size: 1rem;
    color: black;
}

section.goals .dashicons {
    display: block;
    font-size: 2rem;
    line-height: 1rem;
    margin: 0 auto;
    margin-bottom: 10px;
}

section.goals .legend span {
    color: var(--red);
}

section.goals .legend strong {
    color: var(--red);
    font-weight: 400;
}

section.bonus ul,
section.goals ul {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0 0;
}

section.bonus li,
section.goals li {
    padding-left: 15px;
    color: var(--dark-gray);
    border-bottom: 1px solid var(--gray);
    padding-bottom: 10px;
}

section.bonus li:last-child,
section.goals li:last-child {
    border: none;
    padding-bottom: 0;
}

section.goals li strong {
    color: black;
}

section.bonus li span,
section.goals li span {
    color: var(--red);
    font-weight: bold;
}

section.bonus li li:before,
section.goals li strong:before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 100%;
    background-color: var(--red);
    display: inline-block;
    margin-left: -15px;
    margin-right: 5px;
    vertical-align: -1px;
}

section.goals li strong {
    display: block;
}

section.sellers {
    grid-column: 1 / span 3;
}

section.sellers-table {
    grid-column: 1 / span 3;
}

/* QR */

section.qr {
    margin-top: 30px;
}

section.qr img {
    width: 100%;
    max-width: 200px;
}

/* TUTORIALS */

section.tutorials {
    grid-column: 1 / span 2;
}

section.tutorials ul {
    font-weight: 700;
    margin: 0;
}

section.tutorials ul > li {
    border-bottom: 1px solid var(--gray);
    padding: 10px 0;
    cursor: pointer;
    margin: 0;
}

section.tutorials ul > li:hover,
section.tutorials ul > li.active {
    color: var(--red);
}

section.tutorials ul > li > ul > li {
    color: initial;
    font-weight: initial;
}

section.tutorials ul > li:last-child {
    border: none;
}

section.tutorials li:not(.active) > ul {
    display: none;
}

section.tutorials iframe,
section.tutorials img {
    max-width: 100%;
    min-height: 200px;
    border-radius: 5px;
    margin: 10px 0;
}

section.tutorials p {
    margin-top: 0;
}

section.faq {
    grid-column: 3 / span 1;
}

section.customers {
    grid-column: 1 / span 3;
}

section.bonus {
    grid-column: 1 / span 3;
    display: flex;
    flex-wrap: wrap;
}

section.bonus .container {
    flex: 1;
}

section.bonus strong {
    font-size: 1.2em;
    display: block;
    margin-bottom: 10px;
}

section.bonus ul {
    margin: 0;
    padding: 15px 15px 0;
    min-width: 250px;
    flex: 1;
}

section.bonus ul ul {
    padding: 10px 15px;
}

section.bonus li {
    padding: 0;
}

section.bonus li li {
    border: none;
}

section.sales {
    grid-column: 1 / span 3;
}

footer {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    border-top: 1px solid var(--gray);
}

@media (max-width: 782px) {

    table .col-sales {
        width: 47px;
    }

    table .col-plans {
        width: 80px;
    }

    table .col-bonus {
        width: 52px;
    }

    form .form-field select {
        min-height: 40px;
        font-size: 16px;
    }

    .button,
    button {
        font-size: 16px;
    }

    section.goals {
        display: block;
    }

    section.goals .legend {
        border-radius: 0;
        margin-top: 30px;
    }

    section.goals .legend p {
        margin: 0;
    }

    section.goals .dashicons {
        display: inline-block;
        font-size: 20px;
        line-height: 20px;
        margin-bottom: 0;
        
    }

    section.profile,
    section.store,
    section.tutorials {
        grid-column: 1 / span 3;
    }
    
}