.transactions-page {
    width: 100%;
}

.transactions-heading {
    max-width: 760px;
    padding: 10px 0 24px;
}

.transactions-heading h1 {
    margin: 0;
    color: #f7f6ed;
    font-size: 46px;
    line-height: 1.05;
}

.transactions-page .public-eyebrow {
    letter-spacing: 0;
}

.transactions-heading > p:last-child {
    margin: 12px 0 0;
    color: #aebdb8;
}

.transactions-toolbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px 16px;
    padding: 10px;
    border: 1px solid #314642;
    border-radius: 6px;
    background: #172321;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .24);
}

.transactions-filter-group {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.transactions-filter-group legend,
.transactions-search span,
.transactions-metals strong {
    color: #e7b950;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.transactions-filter-group legend {
    float: left;
    margin-right: 2px;
}

.transactions-filter-group label,
.transactions-metals label,
.transactions-metals > span {
    color: #c5d0cc;
    font-size: 12px;
    white-space: nowrap;
}

.transactions-filter-group label,
.transactions-metals label {
    cursor: pointer;
}

.transactions-toolbar input[type="checkbox"],
.transactions-toolbar input[type="radio"] {
    accent-color: #53fc18;
}

.transactions-search {
    display: grid;
    min-width: min(100%, 210px);
    gap: 3px;
}

.transactions-search input,
.metal-price-input,
#metals-menu input {
    min-height: 32px;
    border: 1px solid #3e5651;
    border-radius: 4px;
    background: #0d1514;
    color: #f4f7f4;
}

.transactions-search input {
    width: 100%;
    padding: 5px 8px;
}

.transactions-search input:focus,
.metal-price-input:focus,
#metals-menu input:focus {
    border-color: #53fc18;
    outline: 1px solid #53fc18;
}

.transactions-metals {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 12px;
    padding-top: 7px;
    border-top: 1px solid #2a3a37;
}

.transactions-metals label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.transactions-metals b {
    color: #fff;
}

.metal-price-input {
    width: 68px;
    min-height: 26px;
    padding: 2px 5px;
}

#metals-estimation {
    color: #9fe680;
}

.transactions-result-summary {
    margin: 10px 0 6px;
    color: #879b96;
    font-size: 11px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
}

.card {
    position: relative;
    min-width: 0;
    overflow: visible;
    border: 1px solid #2c403c;
    border-left: 3px solid #60716d;
    border-radius: 6px;
    background: #15201f;
    color: #dfe7e3;
}

.card[hidden] {
    display: none;
}

.card[data-category="1"] { border-left-color: #d9c663; }
.card[data-category="2"] { border-left-color: #69c27d; }
.card[data-category="3"] { border-left-color: #9ca8a7; }
.card[data-category="4"] { border-left-color: #df7777; }
.card[data-category="5"] { border-left-color: #d77bc8; }

.transaction-image-button {
    display: block;
    width: 100%;
    height: 128px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 3px 3px 0 0;
    background: #0a100f;
    cursor: zoom-in;
}

.transaction-image-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title {
    padding: 7px 8px 9px;
}

.title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid #2b3a37;
}

.date {
    color: #9baca7;
    font: 700 10px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.direction-badge {
    padding: 1px 5px;
    border: 1px solid currentColor;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.direction-purchase {
    color: #76b9e8;
}

.direction-sale {
    color: #79d48a;
}

.item-name {
    margin: 7px 0 0;
    overflow-wrap: anywhere;
    color: #f3f5f1;
    font-size: 13px;
    line-height: 1.3;
}

.metals-display {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-top: 6px;
    font-size: 10px;
    line-height: 1.35;
}

.metal-line {
    display: block;
}

.metal-gold {
    color: #e7c95e;
}

.metal-silver {
    color: #bdc9cc;
}

.card-metal-estimate {
    color: #a9e28f;
    font-weight: 700;
    text-align: right;
}

.counterparty {
    margin: 6px 0 0;
    color: #839994;
    font-size: 10px;
}

.seller {
    color: #9edc85;
}

.settings {
    position: absolute;
    z-index: 3;
    top: 4px;
    right: 4px;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #536762;
    border-radius: 4px;
    background: rgba(10, 16, 15, .9);
    color: #fff;
    cursor: pointer;
}

.menu {
    position: absolute;
    z-index: 12;
    top: 34px;
    right: 4px;
    display: none;
    min-width: 150px;
    padding: 6px;
    border: 1px solid #48615b;
    border-radius: 4px;
    background: #101918;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .55);
}

.menu button {
    width: 100%;
    margin: 1px 0;
    padding: 5px;
    border: 1px solid #354b46;
    border-radius: 3px;
    background: #1d2b28;
    color: #e9efeb;
    cursor: pointer;
}

#metals-menu {
    display: grid;
    gap: 3px;
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px solid #354843;
    font-size: 10px;
}

#metals-menu input {
    width: 100%;
    min-height: 28px;
    padding: 3px 5px;
}

.popin {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(3, 7, 7, .92);
    cursor: zoom-out;
}

.popin[hidden] {
    display: none;
}

.popin img {
    max-width: 96%;
    max-height: 94vh;
    border: 1px solid #435b55;
    border-radius: 4px;
}

.transactions-empty {
    padding: 30px 0;
    color: #91a49f;
    text-align: center;
}

@media (min-width: 900px) {
    .transactions-page {
        width: min(1380px, 100%);
        margin: 0 auto;
    }

    .transactions-page .cards {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 767px) {
    .transactions-heading h1 {
        font-size: 32px;
    }

    .transactions-toolbar {
        position: static;
        z-index: auto;
        max-height: none;
        overflow: visible;
    }

    .transactions-filter-group {
        flex: 1 1 100%;
        flex-wrap: wrap;
    }

    .transactions-search {
        flex: 1 1 100%;
    }

    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .transaction-image-button {
        height: 110px;
    }
}
