/* ════════════════════════════════════════
   CSS Variables
════════════════════════════════════════ */
:root {
    --background:      #1a1a1a;
    --surface-2:       #2a2a2a;
    --surface-3:       #252525;
    --sf-bg:           #151515;
    --accent:          #e8b04b;
    --border:          rgba(255, 255, 255, 0.09);
    --text-primary:    #f0f0f0;
    --text-muted:      #8a9bb0;
    --card-radius:     14px;
    --img-height:      240px;
    --gap:             1.25rem;
    --selected-glow:   0 0 0 3px var(--accent), 0 8px 32px rgba(232, 176, 75, 0.35);
    --card-shadow:     0 2px 12px rgba(0, 0, 0, 0.35);
    --card-shadow-hover: 0 12px 36px rgba(0, 0, 0, 0.55);
    --fab-shadow:      0 4px 16px rgba(0, 0, 0, 0.5);
    --navbar-shadow:   0 2px 20px rgba(0, 0, 0, 0.4);
}

/* ════════════════════════════════════════
   Base
════════════════════════════════════════ */
body {
    font-family: 'Marcellus SC', serif;
    background-color: var(--background);
    padding-top: 64px;
    padding-bottom: 80px;
}

/* ════════════════════════════════════════
   Navbar
════════════════════════════════════════ */
.navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: rgba(20, 20, 20, 0.72) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--accent) !important;
    box-shadow: var(--navbar-shadow);
}

/* Side drawer */
#navMenu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 240px;
    background: var(--sf-bg);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 32px rgba(0,0,0,0.5);
    z-index: 1300;
    padding: 1.5rem 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transform: translateX(100%);
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

#navMenu.show {
    transform: translateX(0);
    pointer-events: auto;
}

.nav-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1290;
}

.nav-drawer-backdrop.open {
    display: block;
}

.nav-drawer-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    align-self: flex-end;
    display: flex;
    align-items: center;
    padding: 0;
    margin-bottom: 0.5rem;
    transition: color 0.15s;
}

.nav-drawer-close:hover { color: var(--text-primary); }

.nav-drawer-close .material-symbols-rounded { font-size: 22px; }

/* Cart */
.nav-cart-wrap { position: relative; }

.nav-cart-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
}

.nav-cart-btn:hover { color: var(--accent); }

.nav-cart-btn .material-symbols-rounded {
    font-size: 22px;
    font-variation-settings: "FILL" 0, "wght" 400;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent);
    color: #1a1000;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
}

.cart-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: var(--sf-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.55);
    z-index: 1200;
    overflow: hidden;
}

.cart-dropdown.open { display: block; }

.cart-dropdown-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0;
    padding: 0.75rem 1rem 0.4rem;
}

.cart-dropdown-list {
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    padding: 0 0 0.4rem;
}

.cart-empty-msg {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.75rem 1rem;
    margin: 0;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 1rem;
    gap: 0.5rem;
    transition: background 0.12s;
}

.cart-item:hover { background: var(--surface-3); }

.cart-item-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    flex: 1;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
    transition: color 0.12s;
    flex-shrink: 0;
}

.cart-item-remove:hover { color: #f87171; }

.cart-item-remove .material-symbols-rounded {
    font-size: 16px;
    font-variation-settings: "FILL" 1, "wght" 500;
}

.cart-dropdown-footer {
    padding: 0.6rem 0.75rem 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-price-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

.cart-price-total-label {
    color: var(--text-muted);
    font-weight: 600;
}

.cart-price-total-value {
    color: var(--accent);
    font-weight: 800;
    font-size: 1rem;
}

/* ════════════════════════════════════════
   Game Grid & Cards
════════════════════════════════════════ */
.games-grid-container {
    padding: 1.5rem 1rem;
}

.games-grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

@media (max-width: 992px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

.game-card {
    background: var(--surface-2);
    border-radius: var(--card-radius);
    overflow: hidden;
    cursor: default;
    position: relative;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
}

.game-card:hover:not(.unavailable) {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.game-card.selected {
    border-color: var(--accent);
    box-shadow: var(--selected-glow);
}

.game-card.unavailable {
    opacity: 0.38;
    cursor: not-allowed;
}

.game-card.unavailable::before {
    content: "";
    position: absolute;
    inset: 0;
    backdrop-filter: grayscale(60%);
    -webkit-backdrop-filter: grayscale(60%);
    pointer-events: none;
    z-index: 10;
}

.game-card.sf-hidden { display: none; }

.game-card.overdue {
    border-color: rgba(232, 176, 75, 0.6);
    animation: overdue-pulse 2.5s ease-in-out infinite;
}

@keyframes overdue-pulse {
    0%, 100% { box-shadow: var(--card-shadow), 0 0 0 0 rgba(232,176,75,0); }
    50%       { box-shadow: var(--card-shadow), 0 0 0 6px rgba(232,176,75,0.2); }
}

/* ── Image area ── */
.card-img-wrap {
    position: relative;
    width: 100%;
    height: var(--img-height);
    overflow: hidden;
    background: #0a0a0a;
    flex-shrink: 0;
}

@media (max-width: 992px) {
    .card-img-wrap {
        height: 180px;
    }
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.3s ease;
}

.game-card:hover:not(.unavailable) .card-img-wrap img {
    transform: scale(1.04);
}

/* gradient for title readability */
.card-img-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(10,10,20,0.85) 100%);
    pointer-events: none;
    z-index: 1;
}

/* ── Category pills — top-right of image ── */
.top-right-labels {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.category-label {
    background: rgba(15, 15, 15, 0.82);
    color: #c8d0ff;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(200, 200, 200, 0.35);
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expansion-label {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.55);
}

/* ── Selected checkmark — top-left ── */
.selected-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s, transform 0.2s;
}

.selected-indicator .material-symbols-rounded {
    font-size: 16px;
    color: #1a1000;
    font-variation-settings: "FILL" 1, "wght" 700;
}

.game-card.selected .selected-indicator {
    opacity: 1;
    transform: scale(1);
}

/* ── Game title — bottom-left overlay ── */
.card-title-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 0.5rem 0.7rem 0.55rem;
    pointer-events: none;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}

/* ── Renter banner ── */
.renter-banner {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.9);
    color: #e0e8ff;
    font-size: 0.68rem;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 4;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.renter-icon {
    font-size: 13px !important;
    flex-shrink: 0;
    font-variation-settings: "FILL" 1, "wght" 400;
    color: #7986cb;
}

.renter-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 600;
}

.renter-dates {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
}

/* ── Unavailable / Overdue banners ── */
.unavailable-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(200, 40, 40, 0.75);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    padding: 4px 0;
    z-index: 4;
}

.overdue-banner {
    background: rgba(232, 176, 75, 0.85) !important;
    color: #1a1000 !important;
}

/* ── Card body ── */
.card-body {
    padding: 0.6rem 0.8rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.card-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 0;
    flex-shrink: 0;
}

/* ── Info rows ── */
.card-info {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

/* Split row: left content + right pills */
.info-row-split {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
}

.info-row-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.info-row-right-pills {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

/* Plain icon + value row */
.info-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.info-icon {
    font-size: 22px;
    flex-shrink: 0;
    font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

.info-row-left .value {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
}

/* Bottom row: BGG left, Add button right */
.info-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* ── Tier / Age meta pills ── */
.meta-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 9px;
    border-radius: 20px;
    border: 1px solid transparent;
}

.meta-tier {
    background: rgba(232, 176, 75, 0.18);
    border-color: rgba(232, 176, 75, 0.4);
    color: var(--accent);
}

.meta-age {
    background: rgba(20, 20, 20, 0.7);
    border-color: rgba(255,255,255,0.12);
    color: #d0d8ff;
}

/* ── BGG score pill ── */
.bgg-score {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(232, 176, 75, 0.15);
    border: 1px solid rgba(232, 176, 75, 0.3);
    border-radius: 20px;
    padding: 3px 10px 3px 7px;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.18s, border-color 0.18s;
    margin-left: auto;
}

.bgg-score:hover {
    background: rgba(232, 176, 75, 0.28);
    border-color: rgba(232, 176, 75, 0.6);
    color: var(--accent);
}

.bgg-icon {
    width: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ── Add to cart button ── */
.btn-add-cart {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--accent);
    color: #1a1000;
    border: none;
    border-radius: 20px;
    padding: 5px 13px 5px 9px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    line-height: 1;
    font-family: inherit;
    white-space: nowrap;
}

.btn-add-cart:hover {
    background: #f5c55a;
    transform: scale(1.04);
}

.btn-add-cart:active { transform: scale(0.97); }

.btn-add-cart .material-symbols-rounded {
    font-size: 15px;
    font-variation-settings: "FILL" 1, "wght" 700;
}

.btn-add-cart.in-cart {
    background: rgba(255, 100, 100, 0.15);
    color: #f87171;
    border: 1px solid rgba(255, 100, 100, 0.3);
}

.btn-add-cart.in-cart:hover {
    background: rgba(255, 100, 100, 0.28);
    transform: scale(1.04);
}

.game-card.unavailable .btn-add-cart { display: none; }

/* ════════════════════════════════════════
   Floating Action Buttons
════════════════════════════════════════ */
.fab {
    position: fixed;
    bottom: 30px;
    z-index: 900;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--fab-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.2s ease;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: inherit;
}

.fab:hover { transform: scale(1.08); }

.fab-right {
    right: 30px;
    background: #2e7d32;
    color: #fff;
    opacity: 0;
    pointer-events: none;
}

.fab-right.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Pill variant */
.fab-pill {
    width: auto;
    border-radius: 28px;
    padding: 0 20px 0 24px;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.fab-left {
    left: 30px;
    bottom: 30px;
    background: var(--sf-bg);
    color: var(--text-primary);
    border: 1px solid var(--accent);
}

.fab-left.active {
    background: var(--accent);
    color: #1a1000;
}

/* ════════════════════════════════════════
   Sort & Filter Panel
════════════════════════════════════════ */
.sf-panel {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 300px;
    max-height: calc(100vh - 160px);
    background: var(--sf-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 800;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    transform: translateY(20px) scale(0.97);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

@media (max-width: 992px) {
    .sf-panel {
        width: 50%;
    }
}

.sf-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.sf-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 799;
}

.sf-backdrop.open { display: block; }

.sf-panel-inner { padding: 1rem 1rem 0.5rem; }

.sf-section { margin-bottom: 0.75rem; }

.sf-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.sf-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0 0.75rem;
}

.sf-sort-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sf-sort-btn {
    background: var(--surface-3);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.sf-sort-btn:hover,
.sf-sort-btn.active {
    background: var(--accent);
    color: #1a1000;
    border-color: var(--accent);
}

.sf-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.sf-search-icon {
    position: absolute;
    left: 10px;
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
    font-variation-settings: "FILL" 0, "wght" 400;
}

.sf-search-input {
    width: 100%;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 12px 6px 36px;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.sf-search-input:focus { border-color: rgba(232,176,75,0.5); }
.sf-search-input::placeholder { color: var(--text-muted); }

.sf-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.sf-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.15s;
}

.sf-clear-btn:hover { color: var(--accent); }

.sf-group-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0.5rem 0 0.3rem;
}

.sf-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.sf-filter-badge {
    background: var(--surface-3);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sf-filter-badge:hover,
.sf-filter-badge.active {
    background: var(--accent);
    color: #1a1000;
    border-color: var(--accent);
}

/* ════════════════════════════════════════
   Modals
════════════════════════════════════════ */
.modal-content {
    background: var(--sf-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); }
.modal-title  { color: var(--text-primary); }

.btn-close { filter: invert(1) grayscale(1) brightness(2); }

.modal-dialog-centered { margin-top: 72px; min-height: calc(100% - 72px); }

/* Form controls inside modals */
.form-control {
    background: var(--surface-3);
    border-color: var(--border);
    color: var(--text-primary);
}

.form-control:focus {
    background: var(--surface-3);
    border-color: rgba(232, 176, 75, 0.5);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(232, 176, 75, 0.15);
}

.form-control::placeholder { color: var(--text-muted); }

.form-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

/* Game chips in rent modal */
.modal-games-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.game-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 10px 3px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.game-chip-remove {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    transition: color 0.15s;
    line-height: 1;
}

.game-chip-remove:hover { color: #e05252; }

.game-chip-remove .material-symbols-rounded {
    font-size: 15px;
    font-variation-settings: "FILL" 1, "wght" 500;
}

/* Rental price summary row in rent modal */
.rental-price-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    margin-top: 0.25rem;
}

.rental-price-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

.rental-price-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
}

/* ════════════════════════════════════════
   Pagination
════════════════════════════════════════ */
.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 1.5rem 0 2rem;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: inherit;
}

.page-btn:hover:not(:disabled) {
    background: var(--surface-3);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.18);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1000;
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.page-btn .material-symbols-rounded {
    font-size: 18px;
    font-variation-settings: "FILL" 0, "wght" 400;
}

/* ════════════════════════════════════════
   Game Management (Games/Index)
════════════════════════════════════════ */
.mgmt-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

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

.mgmt-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.mgmt-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}

.mgmt-search-icon {
    position: absolute;
    left: 10px;
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
    font-variation-settings: "FILL" 0, "wght" 400;
}

.mgmt-search-input {
    width: 100%;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 12px 6px 36px;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.mgmt-search-input:focus { border-color: rgba(232,176,75,0.5); }
.mgmt-search-input::placeholder { color: var(--text-muted); }

.mgmt-table-wrap {
    background: var(--sf-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.mgmt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.mgmt-table th {
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.65rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.mgmt-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.mgmt-table tbody tr:last-child td { border-bottom: none; }

.mgmt-table tbody tr:hover td { background: var(--surface-3); }

.name-col   { font-weight: 600; }
.actions-col { width: 90px; white-space: nowrap; }

.mgmt-row { cursor: pointer; }
.mgmt-row:hover td { background: var(--surface-3); }

/* Availability badge */
.avail-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid transparent;
}

.avail-yes {
    background: rgba(46, 160, 67, 0.18);
    border-color: rgba(46, 160, 67, 0.4);
    color: #4caf50;
}

.avail-no {
    background: rgba(200, 40, 40, 0.18);
    border-color: rgba(200, 40, 40, 0.4);
    color: #f87171;
}

/* Action buttons */
.mgmt-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.mgmt-btn:hover            { background: var(--surface-2); color: var(--text-primary); }
.mgmt-btn-edit:hover       { border-color: #4d94ff; color: #4d94ff; }
.mgmt-btn-delete:hover     { border-color: #f87171; color: #f87171; }

.mgmt-btn .material-symbols-rounded {
    font-size: 15px;
    font-variation-settings: "FILL" 0, "wght" 400;
}

/* Game info modal */
.game-info-cover-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.game-info-cover {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: var(--surface-3);
}

.game-info-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: flex-start;
}

.game-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
}

.info-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-field-full { grid-column: 1 / -1; }

.info-field-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.info-field-value {
    font-size: 0.88rem;
    color: var(--text-primary);
    font-weight: 500;
}

.info-field-link {
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.info-field-link:hover { text-decoration: underline; }

/* ════════════════════════════════════════
   Rental History
════════════════════════════════════════ */
.rental-history-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.history-heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.history-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.history-empty .material-symbols-rounded {
    font-size: 48px;
    display: block;
    margin-bottom: 0.75rem;
    font-variation-settings: "FILL" 0, "wght" 300;
}

/* Filters */
.history-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.history-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    min-width: 160px;
}

/* Autocomplete */
.autocomplete-wrap { position: relative; }

.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--sf-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 500;
    max-height: 200px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.autocomplete-dropdown.open { display: block; }

.autocomplete-dropdown li {
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.12s;
}

.autocomplete-dropdown li:hover { background: var(--surface-3); }

/* Stats bar */
.history-stats-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.history-stats-sep { color: var(--border); }

.history-stats-total {
    color: var(--accent);
    font-weight: 800;
}

/* Order cards */
.history-order-card {
    background: var(--sf-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: border-color 0.15s;
}

.history-order-card:hover { border-color: rgba(255,255,255,0.18); }

.history-order-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem 0.5rem;
    flex-wrap: wrap;
}

.history-order-id {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.history-order-renter {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.history-order-phone {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.history-status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid transparent;
}

.badge-open {
    background: rgba(46, 160, 67, 0.18);
    border-color: rgba(46, 160, 67, 0.4);
    color: #4caf50;
}

.badge-overdue {
    background: rgba(232, 176, 75, 0.18);
    border-color: rgba(232, 176, 75, 0.4);
    color: var(--accent);
}

.badge-closed {
    background: rgba(255,255,255,0.06);
    border-color: var(--border);
    color: var(--text-muted);
}

.history-order-body {
    padding: 0 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-order-dates {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.history-received-date { color: #4caf50; }

.history-order-games {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.history-game-chip {
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-order-footer {
    padding: 0.4rem 1rem 0.6rem;
    border-top: 1px solid var(--border);
}

.recorded-at {
    font-size: 0.72rem;
    color: var(--text-muted);
}

#sortFilterBtn {
    background: linear-gradient(135deg, var(--sf-bg) 0%, #c48f35 100%);
    transition: background 0.2s ease;
}

#sortFilterBtn:hover {
    background: linear-gradient(135deg, var(--sf-bg) 0%, var(--accent) 100%);
}

#clearFiltersBtn{
    color: var(--accent);
}
