/* Sales details page: the expense details layout in the sales tone (green), plus the pieces only sales has */

#view-sales-details .edx {
    --edx-a: #4fc79a;
    --edx-b: #17805a;
    --edx-h1: #2fb27e;
    --edx-h2: #136b49;
    --edx-t: #1f9d6a;
}

/* date range fields (the older rules only know the expense page) */
#view-sales-details .ed-range-field {
    min-width: 0;
    display: grid;
    gap: 4px;
}

#view-sales-details .ed-range-field .date-picker-field {
    border-color: color-mix(in srgb, var(--edx-b) 24%, transparent);
    border-radius: 12px;
    background: var(--theme-glass, rgba(255,255,255,.73));
    cursor: pointer;
}

#view-sales-details .ed-range-field .date-picker-field:hover,
#view-sales-details .ed-range-field .date-picker-field.open {
    border-color: var(--edx-b);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--edx-b) 14%, transparent);
}

#view-sales-details .ed-range-field .date-picker-field.is-empty {
    color: var(--text2);
}

#view-sales-details .ed-range-field .date-picker-field i,
#view-sales-details .ed-range-separator {
    color: var(--edx-b);
}

#view-sales-details .ed-range-separator {
    width: 18px;
    height: 46px;
    display: grid;
    place-items: center;
    font-size: 14px;
}

/* average rate: one small chip per fuel */
.edx-rates {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.edx-rate {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px 1px 6px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 900;
    color: var(--text1);
    background: color-mix(in srgb, var(--c) 15%, transparent);
}

.edx-rate i {
    font-size: 15px;
    color: var(--c);
}

html[lang="ps"] .edx-rate {
    font-size: 14.5px;
}

.edx-count {
    font-style: normal;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text2);
}

/* customers */
.edx-cust {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.edx-cu {
    --c: #8a4fe0;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 6px 11px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--c) 28%, var(--theme-stroke, #fff));
    border-radius: 18px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--c) 10%, transparent), transparent 78%);
    animation: edxRise .5s both;
    transition: transform .25s cubic-bezier(.2,.9,.3,1.1), box-shadow .25s ease;
}

.edx-cu:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px color-mix(in srgb, var(--c) 20%, transparent);
}

.edx-cu-av {
    position: relative;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 19px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(145deg, color-mix(in srgb, var(--c) 58%, #fff), var(--c));
    box-shadow: 0 7px 16px color-mix(in srgb, var(--c) 32%, transparent);
}

.edx-cu-av em {
    position: absolute;
    top: -6px;
    inset-inline-start: -6px;
    width: 19px;
    height: 19px;
    display: grid;
    place-items: center;
    border: 2px solid var(--panel, #fff);
    border-radius: 50%;
    font-size: 10.5px;
    font-style: normal;
    font-weight: 900;
    color: #fff;
    background: #e8a23a;
}

.edx-cu-text {
    min-width: 0;
}

.edx-cu-text b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 900;
    color: var(--text1);
}

.edx-cu-text small {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text2);
}

.edx-cu-bar {
    display: block;
    height: 6px;
    margin-top: 4px;
    overflow: hidden;
    border-radius: 99px;
    background: color-mix(in srgb, var(--text2) 14%, transparent);
}

.edx-cu-bar span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--c) 60%, #fff), var(--c));
    animation: edxGrowBar .8s cubic-bezier(.2,.8,.2,1) both;
}

.edx-cu-amt {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px dashed color-mix(in srgb, var(--c) 30%, transparent);
}

.edx-cu-amt small {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text2);
}

.edx-cu-amt strong {
    font-size: 16px;
    font-weight: 900;
    color: var(--text1);
    white-space: nowrap;
}

.edx-cu-amt em {
    font-size: 11.5px;
    font-style: normal;
    font-weight: 800;
    color: var(--text2);
}

html[lang="ps"] .edx-cu-text b {
    font-size: 17px;
}

html[lang="ps"] .edx-cu-text small,
html[lang="ps"] .edx-cu-amt small {
    font-size: 14px;
}

html[lang="ps"] .edx-cu-amt strong {
    font-size: 17.5px;
}

/* cash and credit marks on a sale */
.edx-pay {
    display: inline-flex;
    align-items: center;
    margin-inline-start: 6px;
    padding: 0 9px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 900;
}

.edx-pay.is-cash {
    color: #157049;
    background: color-mix(in srgb, #1f9d6a 16%, transparent);
}

.edx-pay.is-debt {
    color: #a8730f;
    background: color-mix(in srgb, #e8a23a 22%, transparent);
}

html[data-theme="dark"] .edx-pay.is-cash {
    color: #6fe0b0;
}

html[data-theme="dark"] .edx-pay.is-debt {
    color: #f3c25f;
}

html[lang="ps"] .edx-pay {
    font-size: 13px;
}

@keyframes edxGrowBar {
    from { width: 0; }
}

@media (max-width: 900px) {
    .edx-cust {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .edx-cu,
    .edx-cu-bar span {
        animation: none !important;
    }
}
