* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #e94560;
    color: #fff;
}

.btn-primary:hover {
    background: #ff6b6b;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-facebook {
    background: #1877f2;
    color: #fff;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-facebook:hover {
    background: #166fe5;
}

.btn-google {
    background: #fff;
    color: #333;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border: 1px solid #ddd;
}

.btn-google:hover {
    background: #f5f5f5;
}

.btn-google.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}


.btn-whatsapp {
    background: #25D366;
    color: #fff;
}

.btn-whatsapp:hover {
    background: #1da851;
}

.btn-large {
    padding: 1.5rem 3rem;
    font-size: 1.2rem;
}

/* Screens */
.screen {
    display: none;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.screen.active {
    display: block;
}


/* Seller Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h2 {
    font-size: 1.8rem;
}

/* Sales List */
.sales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.sale-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sale-card:hover {
    border-color: #e94560;
    transform: translateY(-2px);
}

.sale-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.sale-card .meta {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}
a.seller-link { color: rgba(255,255,255,0.75); text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,0.4); }
a.seller-link:hover { color: #fff; border-bottom-color: #fff; }

.sale-card .status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.status.active {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.status.closed {
    background: rgba(244, 67, 54, 0.2);
    color: #e57373;
}

.status.paused {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e94560;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.pricing-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pricing-option {
    flex: 1;
    min-width: 150px;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.pricing-option:hover,
.pricing-option.selected {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

.pricing-option h4 {
    margin-bottom: 0.25rem;
}

.pricing-option p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Card Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.card-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.card-item:hover {
    border-color: #e94560;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
}

.card-item img {
    width: 100%;
    aspect-ratio: 0.72;
    object-fit: cover;
    display: block;
}

.card-image-wrapper .foil-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
}

.card-item .card-info {
    padding: 1rem;
}

.card-item .card-name {
    font-weight: bold;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-item .card-set {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.card-item .card-price {
    font-size: 1.1rem;
    color: #e94560;
    font-weight: bold;
    margin-top: 0.5rem;
}

.card-item .card-price.price-override {
    color: #ffa726;
}

.card-item .card-qty {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.card-item .card-condition {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Foil Cards */
.card-item.foil-card {
    position: relative;
    border: 2px solid gold;
}

.foil-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ffd700, #ffec8b);
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Rainbow Foil Overlay Effect */
.foil-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 0, 0, 0.1) 0%,
        rgba(255, 127, 0, 0.1) 14%,
        rgba(255, 255, 0, 0.1) 28%,
        rgba(0, 255, 0, 0.1) 42%,
        rgba(0, 127, 255, 0.1) 57%,
        rgba(75, 0, 130, 0.1) 71%,
        rgba(148, 0, 211, 0.1) 85%,
        rgba(255, 0, 0, 0.1) 100%
    );
    background-size: 400% 400%;
    animation: rainbow-shift 3s ease infinite;
    pointer-events: none;
    z-index: 2;
    border-radius: 8px;
    mix-blend-mode: overlay;
}

@keyframes rainbow-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.card-item {
    position: relative;
}

.card-item.foil-card img {
    position: relative;
}

/* Import Methods */
.import-methods {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.file-upload-btn {
    cursor: pointer;
}

.file-upload-btn input[type="file"] {
    display: none;
}

.import-divider {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Cards Add Grid */
.cards-add-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-add-item {
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.card-add-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.card-add-item.foil-card {
    border-color: rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), rgba(255, 255, 255, 0.02));
}

.card-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(233, 69, 96, 0.8);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.card-remove-btn:hover {
    background: #e94560;
    transform: scale(1.1);
}

.card-add-image {
    position: relative;
    flex-shrink: 0;
    width: 80px;
}

.card-add-image img {
    width: 80px;
    border-radius: 6px;
}

.card-add-item.foil-card .card-add-image img {
    border: 2px solid gold;
}

.card-add-item .foil-overlay {
    border-radius: 6px;
}

.card-add-item .foil-badge {
    top: 4px;
    right: 4px;
    font-size: 0.6rem;
    padding: 1px 4px;
}

.card-add-details {
    flex: 1;
    min-width: 0;
}

.card-add-name {
    font-weight: bold;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-add-set {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.25rem;
}

.card-add-price {
    font-size: 0.85rem;
    color: #81c784;
    margin-bottom: 0.5rem;
}

.card-add-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.control-group label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

/* Quantity Control */
.qty-control {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.qty-btn:hover {
    background: #e94560;
}

.qty-control input {
    width: 40px;
    height: 28px;
    border: none;
    background: transparent;
    color: white;
    text-align: center;
    font-size: 0.9rem;
    -moz-appearance: textfield;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Condition Select */
.condition-select {
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.9);
    color: black;
    font-size: 0.85rem;
    cursor: pointer;
}

.condition-select:focus {
    outline: none;
    border-color: #e94560;
}

.condition-select option {
    background: white;
    color: black;
}

/* Rounding Picker */
.rounding-picker {
    margin-bottom: 0.75rem;
}

.rounding-picker > label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.rounding-options {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.rounding-btn {
    flex: 1;
    padding: 0.5rem 0.25rem;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    transition: all 0.15s ease;
}

.rounding-btn:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.rounding-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rounding-btn.active {
    background: rgba(233, 69, 96, 0.2);
    color: #fff;
    border-color: rgba(233, 69, 96, 0.3);
}

.rounding-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.rounding-example {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Color Filter Bar */
.color-filter-bar {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.color-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s ease;
}

.color-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.color-filter-btn.active {
    background: rgba(233, 69, 96, 0.2);
    border-color: rgba(233, 69, 96, 0.4);
    color: #fff;
}

/* Mana pips */
.mana-pip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 0, 0, 0.3);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.mana-w { background: linear-gradient(135deg, #f9faf4, #e8e4c9); color: #333; }
.mana-u { background: linear-gradient(135deg, #0e68ab, #a4d4f0); color: #fff; }
.mana-b { background: linear-gradient(135deg, #2b2a2a, #6b6b6b); color: #fff; }
.mana-r { background: linear-gradient(135deg, #d3202a, #f5a58e); color: #fff; }
.mana-g { background: linear-gradient(135deg, #00733e, #a3c095); color: #fff; }
.mana-m { background: linear-gradient(135deg, #c9a83e, #f0e68c); color: #333; }
.mana-c { background: linear-gradient(135deg, #9da1a6, #cdd1d6); color: #333; }

/* Price Input */
.price-input {
    width: 70px;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.85rem;
}

.price-input:focus {
    outline: none;
    border-color: #e94560;
}

/* Empty Message */
.empty-cards-message {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.5);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

/* Cards Summary */
.cards-add-summary {
    text-align: center;
    padding: 0.75rem;
    background: rgba(233, 69, 96, 0.1);
    border-radius: 8px;
    color: #e94560;
    font-weight: bold;
}

.card-item .btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* Card Actions (Edit/Delete) */
.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.card-actions .btn {
    flex: 1;
    width: auto;
    margin-top: 0;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
}

/* Danger Button */
.btn-danger {
    background: rgba(244, 67, 54, 0.8);
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: #f44336;
}

/* My Claims Section */
.my-claims-section {
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.my-claims-section h3 {
    margin-bottom: 1rem;
    color: #e94560;
}

.my-claims-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.my-claim-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.my-claim-item.foil-item {
    border-color: rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), rgba(255, 255, 255, 0.02));
}

.my-claim-item .claim-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.my-claim-item .claim-name {
    font-weight: bold;
}

.my-claim-item .claim-details {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.my-claim-item .claim-price {
    font-weight: bold;
    color: #e94560;
    min-width: 80px;
    text-align: right;
}

.my-claim-item .btn {
    width: auto;
    margin-top: 0;
}

.foil-tag {
    color: gold;
    font-size: 0.75em;
    font-weight: bold;
}

.my-claims-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
    font-size: 1.2rem;
    font-weight: bold;
    color: #e94560;
}

/* Responsive My Claims */
@media (max-width: 768px) {
    .my-claim-item {
        flex-wrap: wrap;
    }

    .my-claim-item .claim-info {
        flex: 1 1 100%;
    }

    .my-claim-item .claim-price {
        text-align: left;
    }
}

/* Search Results */
.search-container {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-result-item:hover {
    background: rgba(233, 69, 96, 0.2);
    cursor: pointer;
}

.search-result-item:active {
    background: rgba(233, 69, 96, 0.4);
}

.search-result-item img {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
}

.search-result-item .info {
    flex: 1;
}

.search-result-item .name {
    font-weight: bold;
}

.search-result-item .set {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab:hover {
    color: #fff;
}

.tab.active {
    color: #e94560;
    border-bottom-color: #e94560;
}

/* Entries Table */
.entries-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.entries-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 400px;
}

.entries-table th {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.entries-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.entries-table td img {
    width: 50px;
    border-radius: 4px;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-info {
    background: rgba(33, 150, 243, 0.2);
    border: 1px solid rgba(33, 150, 243, 0.5);
}

.alert-success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.alert-error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #e94560;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Back button */
.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    background: none;
    border: none;
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.back-btn:hover {
    color: #fff;
}

/* Manabox Import */
.import-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.import-section h4 {
    margin-bottom: 1rem;
}

/* Cards to Add List */
#cards-to-add-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

#cards-to-add {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Search Results Improvements */
.search-results {
    max-height: 350px;
}

.search-result-item img {
    flex-shrink: 0;
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Claims List */
.claims-list {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
}

.claim-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.claim-item:last-child {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
    .screen {
        padding: 1rem;
    }

    .modal {
        width: 95%;
        padding: 1rem;
    }

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

    .pricing-options {
        flex-direction: column;
    }
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Profile Form */
.required {
    color: #e94560;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
}

.bank-inputs {
    display: flex;
    gap: 0.75rem;
}

.bank-inputs select {
    flex: 1;
    min-width: 0;
}

.bank-inputs input {
    flex: 1.5;
    min-width: 0;
}

/* Period Inputs */
.period-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.period-inputs-datetime {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.period-inputs-datetime input[type="datetime-local"] {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
}

.period-inputs-datetime input[type="datetime-local"]:focus {
    outline: none;
    border-color: #e94560;
}

/* Fix calendar/time picker icon color for dark theme */
.period-inputs-datetime input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.period-field {
    display: flex;
    flex-direction: column;
}

.period-field label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.6);
}

.period-field input {
    text-align: center;
}

.period-info {
    color: #81c784 !important;
    font-size: 0.85rem !important;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Unavailable Cards */
.card-item.unavailable {
    opacity: 0.5;
    filter: grayscale(50%);
}

.card-item.unavailable img {
    filter: grayscale(70%);
}

/* Share Link Container */
.share-link-container {
    display: flex;
    gap: 0.5rem;
}

.share-link-container input {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.9rem;
}

/* Buyer Report */
.buyer-report-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.buyer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.buyer-info-header h4 {
    margin-bottom: 0.25rem;
}

.buyer-phone {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.buyer-phone a {
    color: #81c784;
    text-decoration: none;
}

.buyer-phone a:hover {
    text-decoration: underline;
}

.buyer-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.entries-table tfoot tr {
    background: rgba(233, 69, 96, 0.1);
}

.entries-table tfoot td {
    border-bottom: none;
}

/* Status Badge Updates */
.status.ended {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

/* View toggle */
.filter-bar { display: flex; gap: 10px; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.filter-bar select { min-width: 140px; padding: 0.5rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); color: #fff; font-size: 0.9rem; }
.filter-bar select:focus { outline: none; border-color: #e94560; }
.view-toggle { display: flex; gap: 2px; margin-left: auto; }
.view-btn {
    width: 32px; height: 32px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.05);
    color: #fff; border-radius: 6px; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center;
}
.view-btn.active { background: #e94560; border-color: #e94560; }

/* Compact card view */
.cards-grid.compact { grid-template-columns: 1fr !important; gap: 0.5rem; }
.cards-grid.compact .card-item {
    display: flex; flex-direction: row; align-items: center; gap: 0.75rem; border-radius: 8px;
}
.cards-grid.compact .card-image-wrapper { width: 45px; flex-shrink: 0; }
.cards-grid.compact .card-item img { aspect-ratio: auto; height: 63px; width: 45px; object-fit: cover; border-radius: 4px; }
.cards-grid.compact .card-image-wrapper .foil-overlay { display: none; }
.cards-grid.compact .foil-badge { display: none; }
.cards-grid.compact .card-info { display: flex; flex-direction: row; align-items: center; gap: 0.75rem; padding: 0.5rem; flex: 1; min-width: 0; }
.cards-grid.compact .card-info .card-name { flex: 1; min-width: 0; margin-bottom: 0; }
.cards-grid.compact .card-info .card-set { display: none; }
.cards-grid.compact .card-info .card-condition { display: none; }
.cards-grid.compact .card-info .card-price { margin-top: 0; white-space: nowrap; }
.cards-grid.compact .card-info .card-qty { display: none; }
.cards-grid.compact .card-info button { padding: 4px 10px; font-size: 0.8rem; }
.cards-grid.compact .card-item.foil-card .card-name::after { content: ' FOIL'; color: gold; font-size: 0.75em; }

/* Responsive Period Inputs */
@media (max-width: 768px) {
    .period-inputs {
        grid-template-columns: repeat(2, 1fr);
    }

    .period-inputs-datetime {
        grid-template-columns: 1fr;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
    }

    .buyer-report-card {
        padding: 0.75rem;
    }

    .entries-table {
        font-size: 0.8rem;
    }

    .entries-table th,
    .entries-table td {
        padding: 0.35rem;
    }

    .buyer-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .buyer-actions {
        width: 100%;
    }

    .buyer-actions .btn {
        flex: 1;
    }

    .bank-inputs {
        flex-direction: column;
    }
}

/* Token Display */
.token-display {
    color: #81c784;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.token-display span {
    font-weight: bold;
}

/* User Search Results (Give Token Modal) */
.user-search-results {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.user-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.user-search-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-search-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-search-info {
    flex: 1;
    min-width: 0;
}

.user-search-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-search-email {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-search-tokens {
    font-size: 0.8rem;
    color: #81c784;
    white-space: nowrap;
}

.no-results {
    text-align: center;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Selected User Card */
.selected-user-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.selected-user-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.selected-user-card img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.selected-user-details {
    flex: 1;
}

.selected-user-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.selected-user-email {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.selected-user-tokens {
    font-size: 0.85rem;
    color: #81c784;
    margin-top: 0.25rem;
}

/* Modal Header Actions */
.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Print Labels - Hidden on screen */
.print-only {
    display: none;
}

/* Print Styles */
@media print {
    /* Hide all body siblings except print container - display:none removes layout space entirely */
    body > *:not(#print-labels-container) { display: none !important; }

    #print-labels-container {
        display: block;
        position: static;
        left: auto;
        top: auto;
        width: 100%;
    }

    /* A4 page setup */
    @page {
        size: A4 portrait;
        margin: 0;
    }

    /* Labels wrapper - 2 columns, 5 rows */
    .print-labels-wrapper {
        display: flex;
        flex-wrap: wrap;
        width: 210mm;
        margin: 0;
    }

    /* Each label box: 2 columns on A4 (210mm width, no margin) = 105mm each */
    .print-label {
        width: 105mm;
        height: 59.4mm;
        border: 1px solid #000;
        box-sizing: border-box;
        display: flex;
        page-break-inside: avoid;
        font-family: Arial, sans-serif;
        font-size: 9pt;
        color: #000;
        background: #fff;
    }

    /* Section A - Info (40% width) */
    .label-section-a {
        width: 40%;
        padding: 3mm;
        border-right: 1px solid #ccc;
        display: flex;
        flex-direction: column;
    }

    .label-title {
        font-weight: bold;
        font-size: 8pt;
        text-align: center;
        margin-bottom: 2mm;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .label-divider {
        border-bottom: 1px solid #ccc;
        margin: 2mm 0;
    }

    .label-info {
        flex: 1;
    }

    .label-row {
        font-size: 8pt;
        margin-bottom: 1mm;
        line-height: 1.3;
    }

    .label-row strong {
        font-size: 7pt;
    }

    /* Section B - Pickup (35% width) */
    .label-section-b {
        width: 35%;
        padding: 3mm;
        border-right: 1px solid #ccc;
        display: flex;
        flex-direction: column;
    }

    .label-pickup-title {
        font-weight: bold;
        font-size: 8pt;
        text-align: center;
        margin-bottom: 3mm;
    }

    .label-field {
        display: flex;
        align-items: flex-end;
        margin-bottom: 4mm;
        font-size: 8pt;
    }

    .label-field span:first-child {
        white-space: nowrap;
        margin-right: 2mm;
    }

    .label-underline {
        flex: 1;
        border-bottom: 1px solid #000;
        min-width: 15mm;
        height: 12pt;
    }

    /* Section C - Blank (25% width) */
    .label-section-c {
        width: 25%;
        padding: 3mm;
    }

    /* Page break */
    .print-page-break {
        page-break-after: always;
        width: 100%;
        height: 0;
    }
}

/* How-to Drawer */
.how-to-drawer {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.how-to-drawer summary {
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(255,255,255,0.85);
    transition: background 0.2s;
}
.how-to-drawer summary:hover { background: rgba(255,255,255,0.04); }
.how-to-drawer summary::-webkit-details-marker { display: none; }
.how-to-drawer summary::after {
    content: '\25BC';
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    transition: transform 0.3s;
}
.how-to-drawer[open] summary::after { transform: rotate(180deg); }
.how-to-content {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.how-to-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.step-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #e94560;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.how-to-step strong { font-size: 0.95rem; }
.how-to-step p { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-top: 2px; white-space: normal; }
.how-to-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    padding: 0 1.25rem 1.25rem;
}
.how-to-col {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1rem;
}
.how-to-col .how-to-content { padding: 0; }
.how-to-col-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 0.75rem;
}
.buyer-title { background: rgba(100,181,246,0.15); color: #64b5f6; }
.seller-title { background: rgba(233,69,96,0.15); color: #e94560; }
@media (max-width: 640px) {
    .how-to-columns { grid-template-columns: 1fr; }
}

/* Guard loading overlay */
#guard-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

#guard-overlay.active {
    display: flex;
}

.guard-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: rgba(30, 30, 60, 0.95);
    padding: 2rem 3rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
}

.guard-overlay-content .spinner {
    width: 36px;
    height: 36px;
}

.no-link-msg {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(255,255,255,0.04);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    max-width: 480px;
    margin: 2rem auto;
}

.no-link-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.no-link-msg h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.no-link-msg p {
    color: rgba(255,255,255,0.6);
    font-size: 0.95rem;
}

.landing-disclaimer {
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.3);
    max-width: 480px;
    margin: 0.5rem auto 2rem;
    line-height: 1.6;
}
