:root {
    --gold: #C9A962;
    --gold-light: #E8D5A3;
    --gold-dark: #A8893A;
    --gold-hover: #B8975A;
    --gold-bg: rgba(201, 169, 98, 0.12);
    --black: #0A0A0A;
    --black-soft: #141414;
    --black-muted: #1F1F1F;
    --white: #FFFFFF;
    --primary: var(--gold);
    --primary-dark: var(--gold-dark);
    --primary-light: var(--gold-light);
    --primary-hover: var(--gold-hover);
    --accent: var(--gold);
    --accent-light: var(--gold-light);
    --star: var(--gold);
    --bg: var(--white);
    --bg-soft: #F5F5F5;
    --bg-card: var(--white);
    --text: var(--black);
    --text-muted: #666666;
    --text-on-dark: var(--white);
    --text-muted-on-dark: rgba(255, 255, 255, 0.65);
    --border: #E0E0E0;
    --border-light: #EBEBEB;
    --border-gold: rgba(201, 169, 98, 0.35);
    --fresh: var(--gold-dark);
    --fresh-bg: var(--gold-bg);
    --rotten: #555555;
    --rotten-bg: #F0F0F0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.14);
    --shadow-gold: 0 4px 20px rgba(201, 169, 98, 0.25);
    --radius: 12px;
    --radius-pill: 10px;
    --font-serif: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-sans: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-serif {
    font-family: var(--font-serif);
    color: var(--text);
    font-weight: 600;
}

a { color: inherit; }

/* ── Frontend: พื้นหลังขาว ── */
.site-front {
    background: #ffffff;
}

.site-front main {
    background: #ffffff;
    flex: 1;
}

/* ── Navbar ── */
.site-navbar {
    background: var(--white) !important;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    padding: 0.875rem 0;
}

.site-navbar .navbar-brand {
    padding: 0;
    display: flex;
    align-items: center;
}

.site-navbar .site-logo {
    display: block;
    height: 44px;
    width: auto;
    max-width: min(220px, 55vw);
}

.site-navbar .navbar-nav .nav-link {
    color: var(--black) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1rem !important;
    border-radius: var(--radius-pill);
    transition: background 0.15s, color 0.15s;
}

.site-navbar .navbar-nav .nav-link:hover {
    background: var(--bg-soft);
    color: var(--gold-dark) !important;
}

.site-navbar .navbar-toggler {
    border-color: var(--border);
}

.site-navbar .navbar-toggler-icon {
    filter: none;
}

/* Search pill */
.search-pill {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.2s;
    max-width: 320px;
    width: 100%;
}

.search-pill:focus-within {
    box-shadow: var(--shadow-gold);
    border-color: var(--gold);
}

.search-pill input {
    border: none;
    background: transparent;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    flex: 1;
    min-width: 0;
    outline: none;
    color: var(--text);
}

.search-pill input::placeholder { color: var(--text-muted); }

.search-pill-btn {
    background: var(--gold);
    border: none;
    color: var(--black);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
    font-weight: 700;
}

.search-pill-btn:hover { background: var(--gold-light); }

.btn-register {
    background: var(--gold) !important;
    color: var(--black) !important;
    border-radius: var(--radius-pill) !important;
    padding: 0.55rem 1rem !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    margin-left: 0.25rem;
    border: none !important;
}

.btn-register:hover {
    background: var(--gold-light) !important;
    color: var(--black) !important;
}

.site-navbar .nav-link-login {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--black) !important;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.35rem 0.35rem 0.75rem !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-pill) !important;
    background: var(--white) !important;
    box-shadow: var(--shadow);
}

.user-menu-btn:hover {
    border-color: var(--gold) !important;
    box-shadow: var(--shadow-md) !important;
}

.user-menu-btn .bi-list { font-size: 1.1rem; color: var(--black); }

.nav-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
/*    border: 2px solid var(--border-light);
    background: var(--bg-soft);*/
}

.nav-user-avatar .user-avatar-img {
    object-fit: cover;
}

.user-menu-btn:hover .nav-user-avatar {
    border-color: var(--gold);
}

.nav-user-card-modal .modal-content {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.nav-user-card-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-light);
    background: var(--bg-soft);
}

.nav-user-card-avatar .user-avatar-img {
    object-fit: cover;
}

.nav-user-card-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.75rem 0 0.5rem;
}

.nav-user-card-stats .bi {
    color: var(--gold);
}

.dropdown-menu .nav-user-card-trigger {
    cursor: pointer;
}

.dropdown-menu .nav-user-card-trigger:hover {
    background: var(--gold-bg);
    color: var(--black);
}

.dropdown-menu {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.dropdown-item:hover { background: var(--gold-bg); color: var(--black); }

@media (max-width: 991.98px) {
    .site-navbar .navbar-collapse {
        overflow: visible;
    }

    .site-navbar .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0.25rem;
        transform: none !important;
    }
}

/* ── Hero ── */
.site-front .hero {
    background: #ffffff;
    color: var(--text);
    padding: 4rem 0 4.5rem;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.site-front .hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.site-front .hero h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    color: var(--black);
}

.site-front .hero p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 520px;
    line-height: 1.5;
}

.hero {
    background: var(--black);
    color: var(--text-on-dark);
    padding: 4rem 0 4.5rem;
    border-bottom: 1px solid var(--border-gold);
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    color: var(--white);
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-muted-on-dark);
    max-width: 520px;
    line-height: 1.5;
}

.hero-search {
    margin-top: 2rem;
    max-width: 480px;
}

.hero-search .search-pill {
    max-width: 100%;
    padding-left: 0.25rem;
}

.hero-search .search-pill input {
    padding: 1rem 1.25rem;
    font-size: 1rem;
}

.hero-search .search-pill-btn {
    width: 48px;
    height: 48px;
    margin: 6px;
    font-size: 1rem;
}

.hero-stats {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.site-front .hero-stat {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    min-width: 100px;
    box-shadow: var(--shadow);
}

.site-front .hero-stat .number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gold-dark);
    letter-spacing: -0.02em;
}

.site-front .hero-stat .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.hero-stat {
    background: var(--black-soft);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    min-width: 100px;
}

.hero-stat .number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: -0.02em;
}

.hero-stat .label {
    font-size: 0.8rem;
    color: var(--text-muted-on-dark);
    margin-top: 0.15rem;
}

/* ── Sections ── */
.section-title {
    font-size: 1.625rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    display: block;
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--gold);
    border-radius: 1px;
}

/* ── Cards (Airbnb listing style) ── */
.card-brand-logo {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    background: transparent;
    border: none;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.card-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0;
}

.perfume-card {
    background: transparent;
    border: none;
    border-radius: var(--radius);
    overflow: visible;
    transition: transform 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.perfume-card:hover { transform: none; }

.perfume-card .card-img-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    background: transparent;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.perfume-card:hover .card-img-wrap {
    box-shadow: none;
}

.perfume-card .card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.perfume-card:hover .card-img-wrap img { transform: scale(1.03); }

.perfume-card .card-body {
    padding: 0 0.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.perfume-card .brand-name {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.perfume-card .perfume-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.15rem 0 0.35rem;
    color: var(--text);
    line-height: 1.3;
}

.perfume-card .card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.25rem;
}

.perfume-card .gender-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Home page — ใช้การ์ดโปร่งใสเหมือนหน้าอื่น ไม่มีพื้นสีรูป */
.home-products .perfume-card {
    background: transparent;
    border: none;
    border-radius: var(--radius);
    overflow: visible;
    box-shadow: none;
}

.home-products a:hover .perfume-card {
    border-color: transparent;
    box-shadow: none;
}

.home-products .perfume-card .card-img-wrap {
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    border-bottom: none;
    background: transparent;
}

.home-products .perfume-card .card-img-wrap img {
    object-fit: contain;
}

.home-products .perfume-card .card-body {
    padding: 0 0.25rem;
}

/* ── Vote meter ── */
.tomato-meter {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.tomato-meter i,
.tomato-meter .tomato-meter-icon.vote-emoji {
    line-height: 1;
}

.tomato-percent {
    font-weight: 700;
    line-height: 1;
}

.tomato-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tomato-sm {
    flex-direction: row;
    gap: 0.3rem;
}

.tomato-sm i { font-size: 0.95rem; }
.tomato-sm .tomato-meter-icon.vote-emoji { font-size: 0.95rem; }
.tomato-sm .tomato-percent { font-size: 0.82rem; }
.tomato-sm .tomato-label { display: none; }

.tomato-md i { font-size: 1.15rem; }
.tomato-md .tomato-meter-icon.vote-emoji { font-size: 1.15rem; }
.tomato-md .tomato-percent { font-size: 0.9rem; }

.tomato-lg i { font-size: 1.75rem; }
.tomato-lg .tomato-meter-icon.vote-emoji { font-size: 1.75rem; }
.tomato-lg .tomato-percent { font-size: 1.35rem; }
.tomato-lg .tomato-label { font-size: 0.75rem; }

.tomato-xl {
    flex-direction: column;
    gap: 0.35rem;
}

.tomato-xl i { font-size: 4rem; }
.tomato-xl .tomato-meter-icon.vote-emoji { font-size: 4rem; line-height: 1; }
.tomato-xl .tomato-label { font-size: 0.85rem; }

.tomato-meter-detail {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 5.5rem;
    padding: 0rem 0;
}

.tomato-fresh .tomato-label { color: var(--gold-dark); }
.tomato-rotten .tomato-label { color: var(--rotten); }

.stars { color: var(--star); }
.stars.star-sm i { font-size: 0.8rem; }
.stars.star-lg {
    display: inline-flex;
    gap: 0.2rem;
    align-items: center;
}
.stars.star-lg i { font-size: 1.5rem; }

/* ── Detail page ── */
.site-front .perfume-detail-header {
    background: #ffffff;
}

.perfume-detail-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
}

.perfume-detail-img {

    
    aspect-ratio: 1 / 1;
    width: 100%;
}

.perfume-detail-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.perfume-detail-img.carousel .carousel-item {
    aspect-ratio: 1 / 1;
}

.perfume-thumb-btn {
    width: 56px;
    height: 56px;
    padding: 0;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-soft);
    cursor: pointer;
    transition: border-color 0.15s;
}

.perfume-thumb-btn.active,
.perfume-thumb-btn:hover {
    border-color: var(--gold);
}

.perfume-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(1);
}

.score-panel {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.score-panel h6 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

.vote-count-text {
    width: 100%;
    text-align: left;
}

.vote-count-rows {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.vote-count-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.vote-count-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.vote-count-label .vote-emoji {
    font-size: 1rem;
}

.vote-count-value {
    font-weight: 600;
    color: var(--text);
    min-width: 1.25rem;
    text-align: right;
}

.vote-count-total {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.note-layer {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.note-layer h6 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gold-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.note-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.note-tag {
    background: var(--bg-soft);
    border: 1px solid var(--border-gold);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    color: var(--text);
}

.perfume-sidebar-sticky {
    position: sticky;
    top: 5.5rem;
}

.perfume-sidebar-banners {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.perfume-sidebar-banner {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
    box-shadow: var(--shadow);
}

.perfume-sidebar-banner img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 2;
    object-fit: cover;
}

.perfume-sidebar-banner-link {
    display: block;
    transition: opacity 0.15s ease;
}

.perfume-sidebar-banner-link:hover {
    opacity: 0.92;
}

.admin-banner-preview.perfume-sidebar-banner {
    min-height: 220px;
}

.admin-banner-preview.perfume-sidebar-banner img {
    aspect-ratio: 1 / 1.6;
}

.admin-banner-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 220px;
    color: var(--text-muted);
    background: var(--bg-soft, #f8f9fa);
}

.admin-banner-placeholder i {
    font-size: 2rem;
}

.vote-section {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.vote-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.vote-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1.1em;
}

.vote-btn .vote-emoji.h4 {
    font-size: 1.25rem;
}

.vote-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
    background: var(--bg);
    flex: 1 1 calc(33.333% - 0.5rem);
    min-width: 88px;
}

.vote-btn-5 { border-color: #C2185B; color: #C2185B; }
.vote-btn-5:hover:not(.active), .vote-btn-5.active { background: #C2185B; color: #fff; border-color: #C2185B; }
.vote-btn-4 { border-color: #2E7D32; color: #2E7D32; }
.vote-btn-4:hover:not(.active), .vote-btn-4.active { background: #2E7D32; color: #fff; border-color: #2E7D32; }
.vote-btn-3 { border-color: #F9A825; color: #F9A825; }
.vote-btn-3:hover:not(.active), .vote-btn-3.active { background: #F9A825; color: #fff; border-color: #F9A825; }
.vote-btn-2 { border-color: #757575; color: #757575; }
.vote-btn-2:hover:not(.active), .vote-btn-2.active { background: #757575; color: #fff; border-color: #757575; }
.vote-btn-1 { border-color: #212529; color: #212529; }
.vote-btn-1:hover:not(.active), .vote-btn-1.active { background: #212529; color: #fff; border-color: #212529; }

.vote-btn.active {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.vote-meter-love i,
.vote-meter-love .tomato-percent,
.vote-meter-love .tomato-label { color: #C2185B; }
.vote-meter-like i,
.vote-meter-like .tomato-percent,
.vote-meter-like .tomato-label { color: #2E7D32; }
.vote-meter-ok i,
.vote-meter-ok .tomato-percent,
.vote-meter-ok .tomato-label { color: #F9A825; }
.vote-meter-dislike i,
.vote-meter-dislike .tomato-percent,
.vote-meter-dislike .tomato-label { color: #757575; }
.vote-meter-dislike .tomato-meter-icon.vote-emoji { color: inherit; }
.vote-meter-hate i,
.vote-meter-hate .tomato-percent,
.vote-meter-hate .tomato-label { color: #212529; }
.vote-meter-hate .tomato-meter-icon.vote-emoji { color: inherit; }
.vote-meter-empty i,
.vote-meter-empty .tomato-label { color: var(--text-muted); }

.profile-vote-badge.vote-badge-5 { background: #fce4ec; color: #C2185B; }
.profile-vote-badge.vote-badge-4 { background: #e8f5e9; color: #2E7D32; }
.profile-vote-badge.vote-badge-3 { background: #fff8e1; color: #F9A825; }
.profile-vote-badge.vote-badge-2 { background: #f5f5f5; color: #757575; }
.profile-vote-badge.vote-badge-1 { background: #ececec; color: #212529; }

@media (min-width: 768px) {
    .vote-btn {
        flex: 1 1 auto;
    }
}

.review-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.review-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--border-light);
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.review-meta .username {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.review-vote-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
}

.review-vote-badge.vote-badge-5 { background: #fce4ec; color: #C2185B; }
.review-vote-badge.vote-badge-4 { background: #e8f5e9; color: #2E7D32; }
.review-vote-badge.vote-badge-3 { background: #fff8e1; color: #F9A825; }
.review-vote-badge.vote-badge-2 { background: #f5f5f5; color: #757575; }
.review-vote-badge.vote-badge-1 { background: #ececec; color: #212529; }

.review-filter-tabs .nav-link {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.65rem 0.85rem;
}

.review-filter-tabs .nav-link.active {
    color: var(--black);
    background: transparent;
    border-bottom-color: var(--gold);
}

.review-filter-tabs .nav-link:hover:not(.active) {
    color: var(--black);
    border-bottom-color: var(--border-light);
}

.review-card-own {
    border-color: var(--border-gold);
}

#reviewOwnPinned .review-card {
    margin-bottom: 0;
}
.review-meta .date { font-size: 0.8rem; color: var(--text-muted); }

.filter-bar {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.perfumes-page-header {
    position: relative;
    margin-bottom: 1.5rem;
}

.perfumes-page-heading {
    padding-right: 6.5rem;
}

.perfumes-page-heading .section-title {
    margin-bottom: 0;
}

.perfumes-filter-wrap {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 30;
}

.perfumes-filter-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: min(calc(100vw - 2rem), 760px);
    margin-bottom: 0;
}

.perfumes-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    border-color: var(--border-light);
    color: var(--text);
    padding: 0.5rem 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    background: var(--bg);
}

.perfumes-filter-toggle:hover,
.perfumes-filter-toggle[aria-expanded="true"] {
    border-color: var(--gold);
    color: var(--black);
    background: var(--gold-light, rgba(201, 169, 98, 0.12));
}

.perfumes-filter-toggle[aria-expanded="true"] .bi-funnel {
    transform: rotate(180deg);
}

.perfumes-filter-toggle .bi-funnel {
    transition: transform 0.2s ease;
}

.perfumes-filter-badge {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 2px var(--bg);
}

.perfumes-page .filter-bar:not(.show) {
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .perfumes-page-heading {
        padding-right: 3.25rem;
    }

    .perfumes-filter-panel {
        width: min(calc(100vw - 1.5rem), 360px);
    }

    .perfumes-filter-toggle span:not(.perfumes-filter-badge) {
        display: none;
    }

    .perfumes-filter-toggle {
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
        justify-content: center;
    }
}

/* ── Brand cards ── */
.brand-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
    transition: box-shadow 0.2s;
    height: 100%;
    box-shadow: var(--shadow);
}

.brand-card:hover {
    transform: none;
    box-shadow: var(--shadow-gold);
    border-color: var(--gold);
}

.brand-card h5 { margin: 0.75rem 0 0.25rem; font-weight: 600; }
.brand-card .country { font-size: 0.875rem; color: var(--text-muted); }

.brand-card .perfume-count {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.3rem 0.85rem;
    background: var(--gold-bg);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    color: var(--black);
    font-weight: 500;
}

.brand-logo-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 0;
    overflow: hidden;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0;
    background: transparent;
}

.brand-logo-thumb {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    padding: 2px;
}

.brand-logo-preview {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: var(--radius);
    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    padding: 4px;
}

.img-preview-square {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    aspect-ratio: 1 / 1;
}

/* ── Auth ── */
.auth-container { max-width: 568px; margin: 3rem auto; }

.auth-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.auth-card h2 { text-align: left; margin-bottom: 0.5rem; font-size: 1.375rem; }
.auth-card .subtitle { text-align: left; color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }

.auth-card .form-control {
    border-radius: 8px;
    border-color: var(--border);
    padding: 0.75rem;
}

.auth-card .form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    background: #fff;
    border: 1px solid var(--border);
    color: #3c4043;
    font-weight: 500;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-google:hover {
    background: #f8f9fa;
    color: #202124;
    box-shadow: var(--shadow-md);
}

.btn-google-icon,
.btn-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-facebook {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    background: #1877F2;
    border: 1px solid #1877F2;
    color: #fff;
    font-weight: 500;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
    color: #fff;
    box-shadow: var(--shadow-md);
}

.settings-container { max-width: 720px; }

.settings-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.settings-section {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.settings-section:last-of-type {
    border-bottom: none;
    margin-bottom: 2rem;
    padding-bottom: 0;
}

.settings-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.settings-avatar-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.settings-avatar-preview {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
}

.settings-card .form-control {
    border-radius: 8px;
    border-color: var(--border);
    padding: 0.75rem;
}

.settings-card .form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
}

/* ── Buttons ── */
.btn-primary {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--black);
    border-radius: 8px;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--gold-light);
    border-color: var(--gold-light);
    color: var(--black);
}

.btn-accent {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--black);
    font-weight: 600;
    border-radius: 8px;
}

.btn-accent:hover {
    background: var(--gold-light);
    border-color: var(--gold-light);
    color: var(--black);
}

.btn-outline-primary {
    color: var(--black);
    border-color: var(--black);
    border-radius: 8px;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background: var(--black);
    border-color: var(--black);
    color: var(--white);
}

.btn-outline-secondary {
    border-radius: 8px;
    font-weight: 500;
    color: var(--text);
    border-color: var(--border);
}

/* ── Footer ── */
.site-front .site-footer {
    background: #ffffff;
    color: var(--text);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-light);
}

.site-front .site-footer h5,
.site-front .site-footer h6 {
    color: var(--black);
    font-weight: 600;
    font-size: 0.875rem;
}

.site-front .site-footer p.text-muted {
    color: var(--text-muted) !important;
}

.site-front .footer-links a {
    color: var(--text-muted);
}

.site-front .footer-links a:hover {
    color: var(--gold-dark);
}

.site-front .site-footer hr {
    border-color: var(--border-light);
    opacity: 1;
}

.site-front .site-footer .text-muted.small {
    color: var(--text-muted) !important;
}

.site-footer {
    background: var(--black);
    color: var(--text-on-dark);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-gold);
}

.site-footer h5, .site-footer h6 {
    color: var(--gold);
    font-weight: 600;
    font-size: 0.875rem;
}

.site-footer p.text-muted { color: var(--text-muted-on-dark) !important; }

.footer-links a {
    color: var(--text-muted-on-dark);
    text-decoration: none;
    line-height: 2.2;
    font-size: 0.875rem;
    transition: color 0.15s;
}

.footer-links a:hover { color: var(--gold); text-decoration: none; }

.site-footer hr { border-color: var(--border-gold); opacity: 1; }

.site-footer .text-muted.small { color: var(--text-muted-on-dark) !important; }

/* ── Admin ── */
.admin-navbar {
    background: var(--black) !important;
    border-bottom: 1px solid var(--border-gold);
    box-shadow: var(--shadow-md);
}

.admin-navbar .navbar-brand { color: var(--gold) !important; font-weight: 700; }

.admin-sidebar {
    background: var(--black-soft);
    min-height: calc(100vh - 57px);
    padding: 1rem 0;
    border-right: 1px solid var(--border-gold);
}

.admin-sidebar .nav-link {
    color: var(--text-muted-on-dark);
    padding: 0.7rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.admin-sidebar .nav-link:hover {
    color: var(--gold-light);
    background: rgba(255, 255, 255, 0.05);
}

.admin-sidebar .nav-link.active {
    color: var(--gold);
    background: rgba(201, 169, 98, 0.1);
    border-left-color: var(--gold);
    font-weight: 600;
}

.admin-sidebar .nav-link i { width: 24px; }

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card .stat-number {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gold-dark);
    letter-spacing: -0.02em;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 500;
}

.profile-stats-row .profile-stat-card {
    padding: 0.65rem 0.5rem;
}

.profile-stats-row .profile-stat-card .stat-number {
    font-size: 1.35rem;
}

.profile-stats-row .profile-stat-card .stat-label {
    font-size: 0.65rem;
    letter-spacing: 0;
}

.collection-btn {
    padding: 0.45rem 1rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
}

.collection-btn:hover, .collection-btn.active {
    background: var(--black);
    color: var(--gold);
    border-color: var(--gold);
}

.profile-collection-heading {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.profile-collection-heading .bi {
    color: var(--gold-dark);
    font-size: 0.95rem;
}

.profile-collection-group + .profile-collection-group {
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.profile-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
}

.profile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.profile-nav-link .bi {
    font-size: 1.05rem;
    color: var(--text-muted);
    transition: color 0.15s;
}

.profile-nav-link:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.profile-nav-link.active {
    background: var(--black);
    color: var(--gold);
}

.profile-nav-link.active .bi {
    color: var(--gold);
}

.profile-vote-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-vote-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.profile-vote-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    overflow: hidden;
}

.profile-vote-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-vote-info {
    flex: 1;
    min-width: 0;
}

.profile-vote-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
}

.profile-vote-badge.fresh {
    background: rgba(46, 125, 50, 0.12);
    color: #2E7D32;
    border: 1px solid rgba(46, 125, 50, 0.35);
}

.profile-vote-badge.rotten {
    background: rgba(198, 40, 40, 0.12);
    color: #C62828;
    border: 1px solid rgba(198, 40, 40, 0.35);
}

.perfume-card-compact .card-img-wrap {
    margin-bottom: 0.5rem;
}

.perfume-card-compact .card-brand-logo {
    width: 2.25rem;
    height: 2.25rem;
    top: 0.35rem;
    left: 0.35rem;
}

.perfume-card-compact .brand-name {
    font-size: 0.75rem;
}

.perfume-card-compact .perfume-name {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.rating-input { display: flex; gap: 0.25rem; flex-direction: row-reverse; justify-content: flex-end; position: relative; }
.rating-input input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0, 0, 0, 0);
    overflow: hidden;
}
.rating-input label { cursor: pointer; font-size: 1.5rem; color: var(--border); transition: color 0.15s; }
.rating-input label:hover, .rating-input label:hover ~ label, .rating-input input:checked ~ label { color: var(--star); }
.rating-input.is-invalid label { color: #dc3545; }

.form-select, .form-control {
    border-color: var(--border);
    border-radius: 8px;
}

.form-select:focus, .form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
}

.metric-dropdown-toggle {
    min-height: 3.25rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    position: relative;
    border-color: var(--border);
    border-radius: 8px;
    background: var(--bg-card);
}

.metric-dropdown-toggle::after {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    margin-top: 0;
    transform: translateY(-50%);
}

.metric-dropdown-toggle:focus,
.metric-dropdown-toggle.show {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
}

.metric-dropdown-title {
    display: block;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text);
}

.metric-dropdown-subtitle,
.metric-option-subtitle {
    display: block;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.metric-dropdown-menu {
    max-height: 280px;
    overflow-y: auto;
    padding: 0.35rem;
}

.metric-dropdown-item {
    white-space: normal;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
}

.metric-dropdown-item.active,
.metric-dropdown-item:active {
    background: var(--gold-bg);
    color: var(--black);
}

.metric-option-title {
    display: block;
    font-weight: 500;
    line-height: 1.3;
}

.review-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.review-metric-label {
    font-weight: 600;
    margin-right: 0.35rem;
}

.review-metric-value {
    font-weight: 500;
}

.review-metric-subtitle {
    margin-top: 0.1rem;
}

.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; color: var(--text); }

.pagination .page-link {
    color: var(--text);
    border-color: var(--border);
    border-radius: 8px;
    margin: 0 2px;
}

.pagination .page-item.active .page-link {
    background: var(--black);
    border-color: var(--black);
    color: var(--gold);
}

.table-admin {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.table-admin th {
    background: var(--bg-soft);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
}

.badge-gender-male { background: var(--black); color: var(--white); }
.badge-gender-female { background: var(--gold-bg); color: var(--gold-dark); border: 1px solid var(--border-gold); }
.badge-gender-unisex { background: var(--bg-soft); color: var(--black); border: 1px solid var(--border); }

.alert { border-radius: var(--radius); border: none; }

/* ── Tier List ── */
.tierlist-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.tierlist-search-wrap {
    position: relative;
    min-width: 240px;
    flex: 1;
    max-width: 320px;
}

.tierlist-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-height: 280px;
    overflow-y: auto;
    z-index: 20;
}

.tierlist-search-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    border-bottom: 1px solid var(--border-light);
    background: var(--white);
    text-align: left;
    cursor: pointer;
}

.tierlist-search-item:last-child { border-bottom: none; }
.tierlist-search-item:hover { background: var(--bg-soft); }

.tierlist-search-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.tierlist-board {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tier-row {
    display: flex;
    align-items: stretch;
    min-height: 72px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.tier-label {
    width: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--black);
}

.tier-dropzone {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-soft);
    min-height: 72px;
}

.tier-dropzone-pool {
    background: #f8f9fa;
}

.tier-item {
    position: relative;
    width: 80px;
    height: 80px;
    padding: 0;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: grab;
    user-select: none;
    overflow: hidden;
    flex-shrink: 0;
}

.tier-item:active { cursor: grabbing; }

.tier-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tier-item-name {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
    background: rgba(10, 10, 10, 0.82);
    color: var(--white);
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.tier-item:hover .tier-item-name {
    opacity: 1;
}

.tier-item-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 2;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.tier-item:hover .tier-item-remove {
    opacity: 1;
}

.tier-item-remove:hover { color: #C62828; }

.tier-item-ghost { opacity: 0.4; }
.tier-item-drag { box-shadow: var(--shadow-md); }

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 0.75rem; }
    .hero-stat { padding: 0.75rem 1rem; min-width: 80px; }
    .search-pill { max-width: 100%; }
    .site-navbar .navbar-collapse { padding-top: 0.75rem; }
    .tierlist-search-wrap { max-width: 100%; }
    .tier-label { width: 44px; font-size: 1rem; }
    .tier-item { width: 72px; height: 72px; }
}

.category-drag-handle {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.category-drag-handle:active {
    cursor: grabbing;
}

.category-sort-ghost {
    opacity: 0.45;
    background: var(--bg-soft, #f8f9fa);
}

.perfume-sort-brand-list .list-group-item {
    border-left: 0;
    border-right: 0;
}

.perfume-sort-brand-list .list-group-item.active small {
    color: rgba(255, 255, 255, 0.85);
}

.admin-brand-group {
    padding: 1rem 1.25rem;
    border: 1px solid var(--border, #dee2e6);
    border-radius: 0.75rem;
    background: var(--surface, #fff);
}

/* ── Profile Gallery ── */
.gallery-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.gallery-grid-item {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: none;
    background: var(--bg-soft);
    overflow: hidden;
    cursor: pointer;
}

.gallery-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.gallery-grid-item:hover img {
    transform: scale(1.03);
}

.gallery-grid-caption {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
}

.gallery-grid-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: var(--text-muted);
    border: 2px dashed var(--border-light);
    font-size: 0.85rem;
}

.gallery-grid-empty i {
    font-size: 1.75rem;
}

.gallery-upload-preview {
    aspect-ratio: 1;
    background: var(--bg-soft);
    border-radius: var(--radius);
    overflow: hidden;
}

.gallery-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-view-modal .gallery-view-image-wrap {
    background: #000;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-view-modal .gallery-view-image-wrap img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
}

.hero-stat-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.15s;
}

.hero-stat-link:hover {
    opacity: 0.85;
    color: inherit;
}

.users-search-form .search-pill {
    min-width: 260px;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s, transform 0.15s;
    color: inherit;
}

.user-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: inherit;
}

.user-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.user-card-body {
    flex: 1;
    min-width: 0;
}

.user-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-card-stats .bi {
    margin-right: 0.2rem;
}

.user-card-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

.tierlist-readonly .tier-item-remove {
    display: none;
}

.dupe-search-form {
    min-width: min(100%, 320px);
}

.dupe-groups {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.dupe-group {
    display: grid;
    grid-template-columns: minmax(160px, 220px) auto 1fr;
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.dupe-group-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.dupe-group-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--gold-bg);
    color: var(--gold-dark);
    font-size: 1.1rem;
}

.dupe-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.dupe-perfume-tile {
    display: block;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dupe-perfume-tile:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-gold);
}

.dupe-perfume-tile-alt {
    background: var(--bg-soft);
}

.dupe-perfume-img {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-soft);
}

.dupe-perfume-img > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dupe-perfume-body {
    padding: 0.65rem 0.75rem 0.75rem;
}

.dupe-perfume-body .brand-name {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.dupe-perfume-body .perfume-name {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
}

.dupe-similarity {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold-dark);
}

.dupe-note {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.dupe-multi-select {
    min-height: 220px;
}

.dupe-master-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.dupe-master-sidebar {
    position: sticky;
    top: 5.5rem;
    padding: 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.dupe-original-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 520px;
    overflow-y: auto;
}

.dupe-original-item {
    display: block;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    background: var(--bg-soft);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.dupe-original-item:hover {
    border-color: var(--border-gold);
    color: inherit;
}

.dupe-original-item.active {
    border-color: var(--gold);
    background: var(--gold-bg);
    box-shadow: var(--shadow-gold);
}

.dupe-original-brand {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dupe-original-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.dupe-original-count {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: var(--gold-dark);
    font-weight: 600;
}

.dupe-browse-search .search-pill {
    min-width: 260px;
}

.dupe-original-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.dupe-original-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    background: transparent;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dupe-original-card:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-gold);
    color: inherit;
}

.dupe-original-card-img {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: transparent;
}

.dupe-original-card-img > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.dupe-original-card-body {
    padding: 0.7rem 0.75rem 0.8rem;
    text-align: center;
}

.dupe-original-card-body .dupe-table-name {
    font-size: 0.88rem;
    line-height: 1.35;
}

.dupe-original-card-body .dupe-original-count {
    margin-top: 0.35rem;
}

.dupe-master-content {
    min-width: 0;
}

.dupe-master-header .dupe-selected-original {
    max-width: 100%;
}

.dupe-original-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: transparent;
    color: inherit;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dupe-original-hero:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-gold);
    color: inherit;
}

.dupe-original-hero-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 10px;
    border: none;
    background: transparent;
}

.dupe-original-hero-img .card-brand-logo {
    width: 2.5rem;
    height: 2.5rem;
    top: 0.35rem;
    left: 0.35rem;
}

.dupe-original-hero-img > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.dupe-original-hero-body {
    width: 100%;
    min-width: 0;
}

.dupe-original-hero-body .dupe-table-name {
    font-size: 0.92rem;
    line-height: 1.35;
}

.dupe-table-panel {
    padding: 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.dupe-table {
    margin-bottom: 0;
}

.dupe-table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    border-bottom-color: var(--border-light);
}

.dupe-table-product {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
}

.dupe-table-product:hover {
    color: inherit;
}

.dupe-table-product:hover .dupe-table-name {
    color: var(--gold-dark);
}

.dupe-table-thumb {
    width: 80px;
    height: 80PX;
    object-fit: contain;
    border-radius: 8px;
    border: none;
    background: transparent;
    flex-shrink: 0;
    padding: 0;
}

.dupe-table-brand {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dupe-table-name {
    font-weight: 600;
    line-height: 1.35;
}

.dupe-table-rating {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.dupe-similarity-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--gold-bg);
    color: var(--gold-dark);
    font-size: 0.78rem;
    font-weight: 600;
}

.dupe-rank-panel {
    padding: 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.dupe-rank-panel-modal {
    padding: 0;
    border: none;
    background: transparent;
}

.dupe-rank-modal .modal-header {
    align-items: flex-start;
}

.dupe-rank-modal .modal-body {
    padding-top: 0.5rem;
}

.dupe-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.dupe-rank-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.5rem;
   border: 1px solid var(--border-light);
    border-radius: 10px;
    cursor: grab;
}

.dupe-rank-item:focus {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

.dupe-rank-item-ghost {
    opacity: 0.45;
}

.dupe-rank-item-chosen {
    cursor: grabbing;
    box-shadow: var(--shadow-md);
    border-color: var(--gold);
}

.dupe-rank-item:active {
    cursor: grabbing;
}

.dupe-rank-handle {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
}

.dupe-rank-number {
    min-width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: var(--black);
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.dupe-rank-thumb {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    border: none;
    background: transparent;
    flex-shrink: 0;
    padding: 0;
}

.dupe-rank-info {
    min-width: 0;
}

.dupe-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: var(--black);
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
}

.dupe-rank-badge-user {
    background: var(--gold-bg);
    color: var(--gold-dark);
}

.dupe-user-rankings-panel {
    padding: 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.dupe-user-rank-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dupe-user-rank-card {
    padding: 0.85rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--white);
}

.dupe-user-rank-card.is-me {
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}

.dupe-user-rank-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.dupe-user-rank-card-meta {
    min-width: 0;
}

.dupe-user-rank-name {
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

.dupe-user-rank-name:hover {
    color: var(--gold-dark);
}

.dupe-rank-list-readonly {
    margin-top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dupe-rank-item-readonly {
    cursor: default;
    width: fit-content;
}

.dupe-rank-thumb-link {
    display: block;
    flex-shrink: 0;
    line-height: 0;
}

.dupe-rank-thumb-link:hover .dupe-rank-thumb {
    border-color: var(--gold);
}

.dupe-rank-item-readonly .dupe-table-name:hover {
    color: var(--gold-dark);
}

@media (max-width: 991.98px) {
    .dupe-master-layout {
        grid-template-columns: 1fr;
    }

    .dupe-master-sidebar {
        position: static;
    }

    .dupe-original-list {
        max-height: 280px;
    }
}

@media (max-width: 767.98px) {
    .dupe-group {
        grid-template-columns: 1fr;
    }

    .dupe-group-arrow {
        transform: rotate(90deg);
        margin: 0 auto;
    }
}

.dupe-export-wrap {
    position: fixed;
    left: -9999px;
    top: 0;
    z-index: -1;
    pointer-events: none;
}

.dupe-export-card {
    width: 820px;
    box-sizing: border-box;
    padding: 28px 32px 36px;
    background: #fff;
    color: #1a1a1a;
    font-family: var(--font-serif);
}


/*แก้ โลโก้ ด้านบน*/
.dupe-export-logo {   
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 28px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gold-dark);
    letter-spacing: 0.02em;
}


.dupe-export-logo .bi {
    color: var(--gold);
    font-size: 2.5rem;
}

.dupe-export-body {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-height: 640px;
}

.dupe-export-original-col,
.dupe-export-dupe-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding:20px 20px;

    /*background: #e52b50;*/
 
}

.dupe-export-original-col {
    flex: 0 0 44%;
    border-right: 1px solid var(--border-light);
    padding: 10px 8px 14px;
    align-items: stretch;
}

.dupe-export-original-col .dupe-export-original-title {
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1.25;

}




.dupe-export-original-col .dupe-export-col-label {
    flex-shrink: 0;
    margin-top: 6px;
    width: 100%;
    text-align: center;
}

.dupe-export-dupe-col {
    flex: 1;
    min-width: 0;
}

.dupe-export-original-title,
.dupe-export-dupe-name {
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
    color: #000;
    max-width: 100%;
}

.dupe-export-original-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
   
}

.dupe-export-original-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;

    box-sizing: border-box;

    /*border-radius: 16px;
    background-color:#606060;*/
}

.dupe-export-original-frame img,
.dupe-export-original-frame canvas {
    display: block;
    width: 100%;
    height: auto;
}

.dupe-export-dupe-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 20px;
    width: 100%;
    flex: 1;
    align-content: center;
    padding: 8px 0 20px;
}

.dupe-export-dupe-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.dupe-export-dupe-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 120px;
}

.dupe-export-dupe-image img {
    width: auto;
    height: auto;
    max-width: 110px;
    max-height: 130px;
}

.dupe-export-dupe-image canvas {
    display: block;
    width: auto;
    height: auto;
    max-width: 110px;
    max-height: 130px;
}

.dupe-export-dupe-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    line-height: 1;
}

.dupe-export-dupe-rating .stars {
    color: #c9a962;
}

.dupe-export-dupe-rating .stars.star-sm i {
    font-size: 0.95rem;
}

.dupe-export-rating-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.dupe-export-col-label {
    font-size: 3.25rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    color: var(--gold-dark);
    letter-spacing: -0.02em;
}
