body {
    background-color: #000;
}

/* Card shell */
.voucher-row {
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    overflow: hidden;
}

.voucher-row--blocked {
    border-color: rgba(255, 193, 7, 0.45);
}

.voucher-row--deleted {
    border-color: rgba(220, 53, 69, 0.45);
    opacity: 0.82;
}

/* Inner layout */
.voucher-row-inner {
    display: flex;
    gap: 14px;
    padding: 12px;
    align-items: stretch;
}

/* Left image column */
.voucher-media {
    flex: 0 0 140px;
    display: flex;
    align-items: center;
}

.voucher-thumb {
    width: 140px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid #2b2b2b;
    background: #0c0c0c;
}

.voucher-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.85rem;
}

/* Right info column */
.voucher-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Top line: code + badge */
.voucher-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.voucher-code {
    font-weight: 700;
    letter-spacing: 0.3px;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* User/meta grid */
.voucher-meta {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
}

.voucher-meta-item {
    display: flex;
    gap: 10px;
    align-items: baseline;
    min-width: 0;
}

.voucher-meta-label {
    color: #b5b5b5;
    font-size: 0.85rem;
    min-width: 86px;
}

.voucher-meta-value {
    color: #eaeaea;
    font-size: 0.9rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Bottom stats bar */
.voucher-stats {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #242424;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.voucher-stat {
    min-width: 140px;
}

.voucher-stat--right {
    margin-left: auto;
    min-width: 200px;
}

.voucher-stat-label {
    color: #b5b5b5;
    font-size: 0.8rem;
}

.voucher-stat-value {
    color: #f1f1f1;
    font-size: 0.92rem;
    font-weight: 600;
}

.voucher-actions {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #242424;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.voucher-empty {
    border-radius: 14px;
}

/* Make badges look consistent on dark bg */
.badge {
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Responsive: stack on small screens */
@media (max-width: 576px) {
    .voucher-row-inner {
        flex-direction: column;
    }

    .voucher-media {
        flex: 0 0 auto;
        justify-content: center;
    }

    .voucher-thumb {
        width: 100%;
        height: auto;
        max-height: 260px;
    }

    .voucher-meta {
        grid-template-columns: 1fr;
    }

    .voucher-stat--right {
        margin-left: 0;
        min-width: 140px;
    }
}

/* Toolbar container */
.toolbar {
    border-radius: 14px;
}

/* Keep search from stretching too much on wide screens */
.toolbar-search {
    width: 100%;
    max-width: 420px;
}

/* Filters shouldn't wrap weirdly */
.toolbar-filters {
    flex-wrap: wrap;
}

/* Active filter visual state (Bootstrap outline buttons don't show active strongly) */
.filter.active {
    box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22) !important;
}

/* On small screens, make filters full width and wrap nicely */
@media (max-width: 576px) {
    .toolbar-filters {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .toolbar-filters .btn {
        width: 100%;
        border-radius: 10px !important;
    }

    .toolbar-search {
        max-width: 100%;
    }
}

.toolbar {
    border-radius: 14px;
}

.toolbar-search {
    width: 100%;
    max-width: 460px;
    /* slightly wider since it's centered */
}

.filter.active {
    box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22) !important;
}

/* Mobile: stack nicely */
@media (max-width: 576px) {
    .toolbar-filters {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .toolbar-filters .btn {
        width: 100%;
        border-radius: 10px !important;
    }

    .toolbar-search {
        max-width: 100%;
    }
}

.refresh-controls {
    padding: 6px 10px;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
}

#refreshCountdown {
    display: inline-block;
    min-width: 38px;
    text-align: right;
}

#actionFeedback .alert {
    border-radius: 14px;
}

@media (max-width: 576px) {
    .voucher-actions .btn {
        flex: 1 1 100%;
    }
}
