.site-header {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 3rem 1.5rem 2.2rem;
    background: linear-gradient(135deg, rgba(255, 224, 234, .85), rgba(240, 230, 246, .85), rgba(232, 248, 242, .85));
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 179, 198, .25);
}

.admin-badge {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.admin-badge a, .admin-badge button {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .42rem 1rem;
    border-radius: 50px;
    font-family: 'Quicksand', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all .25s;
    border: none;
}

.badge-login {
    background: white;
    color: var(--mid);
    border: 1.5px solid var(--pink) !important;
}

.badge-login:hover {
    background: var(--pink-soft);
    transform: translateY(-1px);
}

.badge-admin {
    background: linear-gradient(135deg, #ffb3c6, #d4b8e0);
    color: var(--dark);
    box-shadow: 0 3px 10px rgba(255, 179, 198, .35);
    font-weight: bolder;
}

.badge-admin:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(255, 179, 198, .5);
}

.badge-logout {
    background: white;
    color: #c0395a;
    border: 1.5px solid var(--pink) !important;
    font-size: .78rem;
}

.badge-logout:hover {
    background: #fff0f3;
}

.header-emoji {
    font-size: 2.8rem;
    display: block;
    margin-bottom: .4rem;
    animation: bounce 2s ease-in-out infinite;
}

.site-header h1 {
    font-family: 'Pacifico', cursive;
    font-size: clamp(1.9rem, 7vw, 3.8rem);
    background: linear-gradient(135deg, #e07fad, #9b72cf, #5eb8a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: .4rem;
    filter: drop-shadow(0 2px 4px rgba(180, 100, 160, .18));
}

.site-header p {
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    ;
    color: var(--mid);
    font-weight: 500;
}

/* ── GALLERY ── */
.gallery-wrap {
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2.5rem 2rem 1.5rem;
}

/* Masonry — rộng 340px, ảnh to */
.masonry {
    columns: 3 340px;
    column-gap: 24px;
}

.g-item {
    break-inside: avoid;
    margin-bottom: 24px;
    border-radius: var(--r);
    overflow: hidden;
    background: white;
    box-shadow: var(--sh);
    cursor: pointer;
    transition: all .35s cubic-bezier(.34, 1.56, .64, 1);
    animation: fadeUp .4s ease both;
}

.g-item:hover {
    transform: translateY(-8px) scale(1.012);
    box-shadow: var(--sh2);
}

.g-item:nth-child(5n+1) {
    border-top: 3px solid var(--pink);
}

.g-item:nth-child(5n+2) {
    border-top: 3px solid var(--lav);
}

.g-item:nth-child(5n+3) {
    border-top: 3px solid var(--mint);
}

.g-item:nth-child(5n+4) {
    border-top: 3px solid var(--yellow);
}

.g-item:nth-child(5n+5) {
    border-top: 3px solid var(--peach);
}

.g-item img {
    width: 100%;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
    transition: transform .45s ease;
    user-select: none;
    min-height: 220px;
    object-fit: cover;
}

.g-item:hover img {
    transform: scale(1.05);
}

/* ── EMPTY ── */
.empty {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--soft);
}

.empty .ico {
    font-size: 4.5rem;
    display: block;
    margin-bottom: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

.empty h3 {
    font-size: 1.4rem;
    margin-bottom: .5rem;
    color: var(--mid);
}

/* ── PAGINATION ── */
.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: 1.5rem 1rem 4rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.pg-info {
    font-size: .85rem;
    color: var(--soft);
    font-weight: 600;
    margin: 0 .5rem;
    white-space: nowrap;
}

.pg-btn {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: white;
    color: var(--mid);
    font-family: 'Quicksand', sans-serif;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .22s ease;
    box-shadow: var(--sh);
    padding: 0 .3rem;
}

.pg-btn:hover:not(:disabled) {
    background: var(--pink-soft);
    border-color: var(--pink);
    transform: translateY(-2px);
    box-shadow: var(--sh2);
}

.pg-btn.active {
    background: linear-gradient(135deg, #ffb3c6, #d4b8e0);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(255, 179, 198, .45);
    transform: scale(1.1);
}

.pg-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.pg-btn.arrow {
    font-size: 1.2rem;
}

.pg-ellipsis {
    color: var(--soft);
    font-weight: 700;
    font-size: .95rem;
    line-height: 40px;
}

/* Ô nhập số trang */
.pg-goto {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-left: .6rem;
}

.pg-goto label {
    font-size: .82rem;
    color: var(--soft);
    font-weight: 600;
    white-space: nowrap;
}

.pg-goto input {
    width: 50px;
    height: 36px;
    border-radius: 50px;
    border: 2px solid rgba(212, 184, 224, .6);
    background: white;
    font-family: 'Quicksand', sans-serif;
    font-size: .88rem;
    font-weight: 700;
    color: var(--dark);
    text-align: center;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    -moz-appearance: textfield;
}

.pg-goto input::-webkit-outer-spin-button,
.pg-goto input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.pg-goto input:focus {
    border-color: var(--lav);
    box-shadow: 0 0 0 3px rgba(212, 184, 224, .2);
}

/* Nút cuộn trang — cố định góc phải màn hình */
.scroll-fabs {
    position: fixed;
    right: 1.4rem;
    bottom: 2.2rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    z-index: 600;
}

.scroll-fab {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 2px solid rgba(212, 184, 224, .5);
    box-shadow: var(--sh);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--mid);
    transition: all .22s cubic-bezier(.34, 1.56, .64, 1);
    opacity: .82;
}

.scroll-fab:hover {
    background: linear-gradient(135deg, #ffb3c6, #d4b8e0);
    color: white;
    border-color: transparent;
    transform: scale(1.12);
    opacity: 1;
    box-shadow: 0 5px 18px rgba(255, 179, 198, .45);
}

@media(max-width:600px) {
    .scroll-fabs {
        right: .9rem;
        bottom: 1.4rem;
    }

    .pg-goto {
        margin-left: 0;
        margin-top: .3rem;
    }
}

/* ── RESPONSIVE ── */
@media(max-width:1000px) {
    .masonry {
        columns: 2 260px;
        column-gap: 18px;
    }
}

@media(max-width:600px) {
    .masonry {
        columns: 2 140px;
        column-gap: 12px;
    }

    .g-item {
        margin-bottom: 12px;
    }

    .g-item img {
        min-height: 140px;
    }

    .gallery-wrap {
        padding: 1.8rem 1rem 1rem;
    }

    .admin-badge {
        top: .7rem;
        right: .7rem;
    }

    .admin-badge a, .admin-badge button {
        padding: .35rem .75rem;
        font-size: .75rem;
    }
}