@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d1d1d6;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;
    --accent: #18181b;
    --accent-hover: #3f3f46;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --warning: #ca8a04;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --sidebar-width: 240px;
    --transition: 150ms ease;
}

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

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ─── AUTH PAGES ─────────────────────────────────────────────── */
body.auth-page {
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-brand {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 0.6rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.4rem;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.5;
}

/* Forms */
.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-800);
    font-size: 0.9rem;
    font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control:focus {
    border-color: var(--gray-400);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    white-space: nowrap;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-primary {
    background: var(--gray-900);
    color: var(--white);
    border-color: var(--gray-900);
}

.btn-primary:hover {
    background: var(--gray-700);
    border-color: var(--gray-700);
}

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border-color: var(--gray-200);
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--gray-200);
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
}

.btn-danger:hover {
    background: var(--danger-light);
    border-color: #fca5a5;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
}

/* Divider */
.auth-divider {
    border: none;
    border-top: 1px solid var(--gray-100);
    margin: 1.5rem 0;
}

.auth-footer {
    font-size: 0.825rem;
    color: var(--gray-500);
    text-align: center;
    margin-top: 1.25rem;
}

.auth-footer a {
    color: var(--gray-800);
    font-weight: 500;
}

/* Alert */
.alert {
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    line-height: 1.5;
}

.alert-error {
    background: var(--danger-light);
    border-color: #fecaca;
    color: #991b1b;
}

.alert-success {
    background: var(--success-light);
    border-color: #bbf7d0;
    color: #166534;
}

/* ─── USER DASHBOARD ─────────────────────────────────────────── */
body.dashboard-page {
    background: var(--gray-50);
    min-height: 100vh;
}

.dashboard-nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-brand {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.nav-brand span {
    font-weight: 300;
    color: var(--gray-400);
    margin: 0 0.5rem;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-username {
    font-size: 0.82rem;
    color: var(--gray-500);
    font-weight: 400;
}

.nav-logout {
    font-size: 0.82rem;
    color: var(--gray-600);
    font-weight: 500;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-logout:hover {
    background: var(--gray-100);
    color: var(--gray-800);
    text-decoration: none;
}

.dashboard-body {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

.page-heading {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.page-heading h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.page-heading p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Image gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.gallery-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.gallery-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--gray-300);
}

.gallery-item-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: var(--gray-100);
}

.gallery-item-info {
    padding: 0.9rem 1rem;
}

.gallery-item-caption {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 0.35rem;
}

.gallery-item-date {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    background: var(--gray-100);
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--gray-400);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-state h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.empty-state p {
    font-size: 0.825rem;
    color: var(--gray-400);
    line-height: 1.6;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.96);
    transition: transform 200ms ease;
}

.lightbox-overlay.active .lightbox-inner {
    transform: scale(1);
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: var(--radius);
    object-fit: contain;
}

.lightbox-caption {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.8rem;
}

.lightbox-close {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

/* ─── ADMIN PANEL ────────────────────────────────────────────── */
body.admin-page {
    background: var(--gray-50);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    padding: 1.4rem 1.25rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-logo-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.sidebar-logo-sub {
    font-size: 0.72rem;
    color: var(--gray-400);
    margin-top: 0.15rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    padding: 0.75rem 0;
    flex: 1;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-400);
    padding: 0.6rem 1.25rem 0.3rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.855rem;
    color: var(--gray-600);
    font-weight: 400;
    transition: all var(--transition);
    text-decoration: none;
    border-radius: 0;
}

.sidebar-link svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link:hover {
    background: var(--gray-50);
    color: var(--gray-900);
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--gray-50);
    color: var(--gray-900);
    font-weight: 500;
}

.sidebar-link.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-100);
}

.sidebar-user {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.sidebar-user strong {
    color: var(--gray-700);
    font-weight: 500;
    display: block;
}

/* Admin main */
.admin-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

.admin-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-topbar-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
}

.admin-inner {
    padding: 2rem 1.75rem;
    max-width: 1100px;
}

/* Stats row */
.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    flex: 1;
}

.stat-val {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-lbl {
    font-size: 0.78rem;
    color: var(--gray-500);
    font-weight: 400;
}

/* Filter row */
.filter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-field {
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font);
    color: var(--gray-700);
    background: var(--white);
    transition: all var(--transition);
    outline: none;
    width: 220px;
}

.search-field:focus {
    border-color: var(--gray-400);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.filter-count {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-left: auto;
}

/* User cards */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.25rem;
}

.user-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.user-card-head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-initial {
    width: 34px;
    height: 34px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    flex-shrink: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
}

.user-meta {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.1rem;
}

.user-card-body {
    padding: 1.1rem 1.25rem;
}

/* Existing images thumbnails */
.thumbs-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 0.6rem;
}

.thumbs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}

.thumb-wrap {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
    flex-shrink: 0;
}

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

.thumb-del {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.thumb-wrap:hover .thumb-del {
    opacity: 1;
}

.thumb-del-btn {
    width: 28px;
    height: 28px;
    background: rgba(220,38,38,0.9);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    font-family: var(--font);
}

.thumb-del-btn:hover {
    background: var(--danger);
}

.thumb-del-btn svg {
    width: 13px;
    height: 13px;
    stroke: white;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.no-photos {
    font-size: 0.8rem;
    color: var(--gray-400);
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
}

/* Upload form */
.upload-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 0.6rem;
    display: block;
    margin-top: 0.25rem;
}

.upload-dropzone {
    border: 1.5px dashed var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
    background: var(--gray-50);
    margin-bottom: 0.7rem;
}

.upload-dropzone:hover,
.upload-dropzone.over {
    border-color: var(--gray-400);
    background: var(--white);
}

.upload-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.dropzone-icon {
    margin: 0 auto 0.5rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--gray-300);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dropzone-text {
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.4;
}

.dropzone-hint {
    font-size: 0.72rem;
    color: var(--gray-400);
    margin-top: 0.2rem;
}

.preview-img {
    max-height: 100px;
    max-width: 100%;
    border-radius: 4px;
    object-fit: contain;
    display: none;
    margin: 0 auto;
}

.caption-field {
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: var(--font);
    color: var(--gray-700);
    background: var(--white);
    transition: all var(--transition);
    outline: none;
    margin-bottom: 0.7rem;
}

.caption-field:focus {
    border-color: var(--gray-400);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.caption-field::placeholder {
    color: var(--gray-400);
}

.upload-btn {
    width: 100%;
    padding: 0.6rem;
    background: var(--gray-900);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.855rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: background var(--transition);
}

.upload-btn:hover {
    background: var(--gray-700);
}

.upload-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Flash */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.855rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.flash-success {
    background: var(--success-light);
    border-color: #bbf7d0;
    color: #166534;
}

.flash-error {
    background: var(--danger-light);
    border-color: #fecaca;
    color: #991b1b;
}

/* No users state */
.no-users {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-400);
    font-size: 0.9rem;
}

/* Toast */
.toast-bar {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--gray-900);
    color: var(--white);
    padding: 0.75rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.855rem;
    font-weight: 400;
    box-shadow: var(--shadow-md);
    transform: translateY(10px);
    opacity: 0;
    transition: all 300ms ease;
    z-index: 9999;
    pointer-events: none;
}

.toast-bar.visible {
    transform: translateY(0);
    opacity: 1;
}

/* ─── BOTTOM NAV BAR (mobile only) ──────────────────────────── */
.mobile-bottom-nav {
    display: none; /* hidden on desktop */
}

/* ─── TOAST ──────────────────────────────────────────────────── */
.toast-bar {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--gray-900);
    color: var(--white);
    padding: 0.75rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.855rem;
    font-weight: 400;
    box-shadow: var(--shadow-md);
    transform: translateY(10px);
    opacity: 0;
    transition: all 300ms ease;
    z-index: 9999;
    pointer-events: none;
    max-width: calc(100vw - 2rem);
}

.toast-bar.visible {
    transform: translateY(0);
    opacity: 1;
}

/* ─── MOBILE BREAKPOINT ──────────────────────────────────────── */
@media (max-width: 768px) {

    /* Hide sidebar completely on mobile */
    .sidebar {
        display: none !important;
    }

    /* Content takes full width */
    .admin-content {
        margin-left: 0;
    }

    /* Add bottom padding so content isn't hidden behind bottom nav */
    .admin-inner {
        padding: 1rem 1rem 5.5rem;
    }

    .admin-topbar {
        padding: 0 1rem;
    }

    /* Show bottom nav on mobile */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--white);
        border-top: 1px solid var(--gray-200);
        z-index: 500;
        align-items: stretch;
    }

    .mobile-bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        font-size: 0.65rem;
        font-weight: 500;
        color: var(--gray-400);
        text-decoration: none;
        transition: color var(--transition), background var(--transition);
        padding: 0 0.5rem;
        border-top: 2px solid transparent;
        letter-spacing: 0.02em;
    }

    .mobile-bottom-nav a svg {
        width: 20px;
        height: 20px;
        stroke: currentColor;
        fill: none;
        stroke-width: 1.75;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-bottom-nav a:hover {
        color: var(--gray-700);
        text-decoration: none;
    }

    .mobile-bottom-nav a.active {
        color: var(--gray-900);
        border-top-color: var(--gray-900);
    }

    .mobile-bottom-nav a.nav-logout {
        color: var(--danger);
        border: none;
    }

    .mobile-bottom-nav a.nav-logout:hover {
        background: var(--danger-light);
        color: var(--danger);
    }

    /* Move toast above bottom nav */
    .toast-bar {
        bottom: 4.5rem;
        right: 1rem;
    }

    /* Upload area improvements */
    .upload-dropzone {
        padding: 1.75rem 1rem;
        min-height: 110px;
    }

    .dropzone-text {
        font-size: 0.875rem;
    }

    .upload-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .caption-field {
        padding: 0.7rem 0.8rem;
        font-size: 0.875rem;
    }

    /* Thumb grid */
    .thumbs-row {
        gap: 0.4rem;
    }

    .thumb-wrap {
        width: 54px;
        height: 54px;
    }

    /* Always show delete button on touch screens */
    .thumb-del {
        opacity: 1;
        background: transparent;
        align-items: flex-start;
        justify-content: flex-end;
        padding: 2px;
    }

    .thumb-del-btn {
        width: 22px;
        height: 22px;
        background: rgba(220,38,38,0.85);
        border-radius: 3px;
    }

    .thumb-del-btn svg {
        width: 11px;
        height: 11px;
    }

    /* Stats row: 3 columns */
    .stats-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }

    .stat-box {
        padding: 0.9rem 0.75rem;
    }

    .stat-val {
        font-size: 1.4rem;
    }

    /* Full width user cards */
    .user-grid {
        grid-template-columns: 1fr;
    }

    /* Gallery grid */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }

    /* Dashboard page */
    .dashboard-body {
        padding: 1.25rem 1rem;
    }

    .dashboard-nav {
        padding: 0 1rem;
    }

    /* Filter row stacks */
    .filter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .search-field {
        width: 100%;
    }

    .filter-count {
        margin-left: 0;
    }

    /* Auth */
    .auth-card {
        padding: 2rem 1.5rem;
    }
}

/* ─── LIHAT PESANAN BUTTON (per-user card in admin/index.php) ──────── */
.btn-lihat-pesanan {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font);
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 180ms ease;
}

.btn-lihat-pesanan svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.btn-lihat-pesanan:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.5);
    color: #4f46e5;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.18);
}

.btn-lihat-pesanan:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ─── PESANAN BUTTON (per-row in admin/users.php table) ───────────── */
.btn-view-pesanan {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font);
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
    transition: all 180ms ease;
}

.btn-view-pesanan svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.btn-view-pesanan:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
    color: #4f46e5;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15);
}


/* ─── ADMIN PREVIEW BANNER ───────────────────────────────────────── */
.admin-preview-banner {
    position: sticky;
    top: 0;
    z-index: 999;
    width: 100%;
    background: linear-gradient(90deg, #1e1b4b 0%, #312e81 40%, #4c1d95 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25);
    animation: bannerSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bannerSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.admin-preview-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}

.admin-preview-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.admin-preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.25);
    animation: dotPulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.25); }
    50%       { box-shadow: 0 0 0 6px rgba(167, 139, 250, 0.0);  }
}

.admin-preview-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #a78bfa;
}

.admin-preview-sep {
    color: rgba(167, 139, 250, 0.4);
    font-size: 0.8rem;
}

.admin-preview-info {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
}

.admin-preview-info strong {
    color: #ffffff;
    font-weight: 600;
}

.admin-preview-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.775rem;
    font-weight: 600;
    font-family: var(--font);
    color: #1e1b4b;
    background: #c4b5fd;
    border-radius: 20px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: all 180ms ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.admin-preview-back svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.admin-preview-back:hover {
    background: #ddd6fe;
    color: #1e1b4b;
    text-decoration: none;
    transform: translateX(-2px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.admin-preview-back:active {
    transform: translateX(0);
}

/* Offset dashboard body when banner is visible */
body.dashboard-page .admin-preview-banner + .dashboard-nav {
    /* nav follows naturally after banner */
}

@media (max-width: 600px) {
    .admin-preview-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    .admin-preview-back {
        width: 100%;
        justify-content: center;
    }
    .admin-preview-sep {
        display: none;
    }
}
