/* Till attendant history: wide dialog, and its print sheet (shares the till report sheet styles). */

.till-history-modal {
    --th-gold: #c08a1e;
    --th-gold2: #e5b04a;
    --th-green: #1f7a4d;
    --th-red: #c4553a;
    --th-violet: #8454c7;
    --th-ease: cubic-bezier(.2, .9, .3, 1.1);
    width: min(1100px, 95vw) !important;
    max-width: 1100px !important;
    max-height: 92vh;
    overflow-y: auto;
    padding: 22px;
}

html[data-theme="dark"] .till-history-modal {
    --th-gold: #f0b64a;
    --th-gold2: #c58a1b;
    --th-green: #5fd391;
    --th-red: #f09479;
    --th-violet: #bb9aee;
}

.till-history-modal .th-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.till-history-modal .th-head h3 {
    margin: 0;
    font-size: 18px;
}

.till-history-modal .th-head p {
    margin: 2px 0 0;
    color: var(--text2);
    font-size: 12px;
}

.till-history-modal .th-head-ico,
.till-history-modal .th-stat-ico {
    display: grid;
    place-items: center;
    flex: none;
    color: #fff;
    background: linear-gradient(145deg, var(--th-gold2), var(--th-gold));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--th-gold) 32%, transparent);
}

.till-history-modal .th-head-ico {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    font-size: 25px;
}

.till-history-modal .th-acts {
    margin-inline-start: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.till-history-modal .th-act {
    --c: #1f9488;
    --c2: #4cc3b4;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px;
    border: 1px solid color-mix(in srgb, var(--c) 35%, var(--border));
    border-radius: 14px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--c2) 20%, var(--panel, #fff)), color-mix(in srgb, var(--c) 9%, var(--panel, #fff)));
    color: color-mix(in srgb, var(--c) 80%, var(--text1));
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s var(--th-ease), box-shadow .2s ease;
}

.till-history-modal .th-act.is-excel {
    --c: #1f7a4d;
    --c2: #4cbb82;
}

.till-history-modal .th-act:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px color-mix(in srgb, var(--c) 26%, transparent);
}

.till-history-modal .th-act i {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    font-size: 17px;
    background: linear-gradient(145deg, var(--c2), var(--c));
}

.till-history-modal .th-close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel, #fff);
    color: var(--text2);
    font-size: 18px;
    cursor: pointer;
}

.till-history-modal .th-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.till-history-modal .th-stat {
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--c2) 16%, var(--panel, #fff)), var(--panel, #fff));
    animation: thRise .5s var(--th-ease) backwards;
}

.till-history-modal .th-stat:nth-child(2) { animation-delay: .06s; }
.till-history-modal .th-stat:nth-child(3) { animation-delay: .12s; }
.till-history-modal .th-stat:nth-child(4) { animation-delay: .18s; }

.till-history-modal .th-stat-ico {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 20px;
    background: linear-gradient(145deg, var(--c2), var(--c));
}

.till-history-modal .th-stat > span:not(.th-stat-ico) {
    color: var(--text2);
    font-size: 12px;
}

.till-history-modal .th-stat b {
    font-size: 19px;
}

.till-history-modal .th-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 14px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--th-gold) 8%, var(--panel, #fff));
}

.till-history-modal .th-filters button {
    padding: 7px 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text2);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.till-history-modal .th-filters button.is-on {
    color: #fff;
    background: linear-gradient(135deg, var(--th-gold2), var(--th-gold));
}

.till-history-modal .th-list {
    display: grid;
    gap: 12px;
}

.till-history-modal .th-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1.6fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel, #fff);
    transition: transform .25s var(--th-ease), box-shadow .25s ease;
    animation: thRise .5s var(--th-ease) backwards;
}

.till-history-modal .th-row[hidden] {
    display: none;
}

.till-history-modal .th-row:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 26px rgba(197, 138, 27, .16);
}

.till-history-modal .th-row.is-current {
    border-color: color-mix(in srgb, var(--th-green) 45%, var(--border));
    background: linear-gradient(145deg, color-mix(in srgb, var(--th-green) 9%, var(--panel, #fff)), var(--panel, #fff));
}

.till-history-modal .th-avatar {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(145deg, var(--th-gold2), var(--th-gold));
}

.till-history-modal .is-emergency .th-avatar {
    background: linear-gradient(145deg, #e58a70, var(--th-red));
}

.till-history-modal .is-first .th-avatar {
    background: linear-gradient(145deg, #b08ae6, #8454c7);
}

.till-history-modal .th-who {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.till-history-modal .th-who b {
    font-size: 15px;
}

.till-history-modal .th-who small {
    color: var(--text2);
    font-size: 12px;
}

.till-history-modal .th-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    margin-top: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.till-history-modal .th-tag.is-ok,
.till-history-modal .th-tag.is-live {
    color: var(--th-green);
    background: color-mix(in srgb, var(--th-green) 12%, transparent);
}

.till-history-modal .th-tag.is-em {
    color: var(--th-red);
    background: color-mix(in srgb, var(--th-red) 12%, transparent);
}

.till-history-modal .th-tag.is-in {
    color: var(--th-violet);
    background: color-mix(in srgb, var(--th-violet) 12%, transparent);
}

.till-history-modal .th-money {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.till-history-modal .th-money > div {
    padding: 8px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--th-gold) 5%, var(--panel, #fff));
}

.till-history-modal .th-money span {
    display: block;
    color: var(--text2);
    font-size: 11px;
}

.till-history-modal .th-money b {
    display: inline-block;
    direction: ltr;
    font-size: 14px;
}

.till-history-modal .th-money .is-neg b {
    color: var(--th-red);
}

.till-history-modal .th-money .is-zero b {
    color: var(--th-green);
}

.till-history-modal .th-docs {
    display: grid;
    gap: 4px;
    justify-items: end;
}

.till-history-modal .th-docs span {
    padding: 2px 8px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text2);
    font-size: 11px;
}

.till-history-modal .th-empty {
    padding: 28px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 18px;
    color: var(--text2);
}

@keyframes thRise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

@media (max-width: 860px) {
    .till-history-modal .th-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .till-history-modal .th-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .till-history-modal .th-money,
    .till-history-modal .th-docs {
        grid-column: 1 / -1;
    }

    .till-history-modal .th-docs {
        justify-items: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .till-history-modal .th-stat,
    .till-history-modal .th-row {
        animation: none;
    }
}

/* the button in the settings card */
.till-role-settings-card .till-role-history-open {
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid color-mix(in srgb, #c08a1e 40%, var(--border));
    border-radius: 12px;
    background: linear-gradient(135deg, color-mix(in srgb, #e5b04a 22%, var(--panel, #fff)), var(--panel, #fff));
    color: var(--text1);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

@media print {
    #reportPrintTemplate .th-sheet .tr-table .num {
        text-align: left;
    }

    #reportPrintTemplate .th-sheet .th-doc {
        direction: ltr;
        text-align: right;
        font-size: 7.5pt;
    }

    #reportPrintTemplate .th-sheet tr.is-current td {
        font-weight: 900;
    }

    #reportPrintTemplate .th-sheet .th-sum {
        grid-template-columns: repeat(4, 1fr);
    }
}
