/* ─────────────────────────────────────────────
   Ramifans — Premium Dark Theme
   Mobile-first, fully responsive
   ───────────────────────────────────────────── */
:root {
    --bg: #0a0a0f;
    --bg2: #111118;
    --card: #17171f;
    --card2: #1e1e28;
    --border: #262633;
    --border2: #33333f;
    --accent: #e0b94c;
    --accent2: #f5d67a;
    --accent-glow: rgba(224,185,76,0.35);
    --text: #e6e6ee;
    --text2: #9a9aab;
    --text3: #6c6c7d;
    --danger: #e5484d;
    --danger-bg: #2a1517;
    --success: #30c46f;
    --radius: 14px;
    --radius-sm: 9px;
    --maxw: 1360px;
    --shadow: 0 8px 30px rgba(0,0,0,0.45);
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Light mode ─── */
[data-theme="light"] {
    --bg: #f7f7fb;
    --bg2: #eeedf4;
    --card: #ffffff;
    --card2: #f4f3f9;
    --border: #e4e3ee;
    --border2: #d4d3e0;
    --accent: #b87d14;
    --accent2: #9e6a10;
    --accent-glow: rgba(184,125,20,0.18);
    --text: #1e1e2a;
    --text2: #5c5b6e;
    --text3: #9392a5;
    --danger: #d92d32;
    --danger-bg: #fef0f0;
    --success: #1a9d50;
    --shadow: 0 4px 24px rgba(20,20,40,0.07), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(20,20,40,0.10), 0 2px 8px rgba(0,0,0,0.05);
}
[data-theme="light"] body {
    letter-spacing: 0.15px;
}
[data-theme="light"] .navbar {
    background: rgba(255,255,255,0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
[data-theme="light"] .logo {
    color: var(--accent);
    text-shadow: none;
    font-weight: 800;
}
[data-theme="light"] .btn {
    font-weight: 650;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
[data-theme="light"] .btn:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-1.5px);
}
[data-theme="light"] .btn-primary {
    background: var(--accent);
    color: #fff;
}
[data-theme="light"] .btn-primary:hover {
    background: var(--accent2);
    color: #fff;
}
[data-theme="light"] .btn-outline {
    background: var(--card);
    color: var(--text);
    border-color: var(--border2);
}
[data-theme="light"] .btn-outline:hover {
    background: var(--bg);
    border-color: var(--accent);
    color: var(--accent);
}
[data-theme="light"] .btn-danger {
    background: var(--danger);
    color: #fff;
}
[data-theme="light"] .btn-danger:hover {
    background: #c52429;
    color: #fff;
}
[data-theme="light"] .card,
[data-theme="light"] .analytics-card,
[data-theme="light"] .metric-card,
[data-theme="light"] .profile-card {
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
[data-theme="light"] .card:hover,
[data-theme="light"] .metric-card:hover {
    box-shadow: var(--shadow-lg);
}
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
    background: var(--card);
    border: 1.5px solid var(--border);
    color: var(--text);
}
[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184,125,20,0.12);
}
[data-theme="light"] .hero-card-header { background: var(--card2); }
[data-theme="light"] .play-overlay { background: rgba(0,0,0,0.15); color: #fff; border-color: rgba(255,255,255,0.5); }
[data-theme="light"] .hero-screen-glow {
    background: linear-gradient(to bottom, transparent 55%, rgba(0,0,0,0.3));
}
[data-theme="light"] .hero-badge {
    background: rgba(184,125,20,0.1);
    border-color: rgba(184,125,20,0.3);
}
[data-theme="light"] .nav-link { color: var(--text2); }
[data-theme="light"] .nav-link:hover { color: var(--text); }
[data-theme="light"] .alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: #f5c6cb;
}
[data-theme="light"] .modal-overlay {
    background: rgba(20,20,30,0.45);
}
[data-theme="light"] .modal-content {
    box-shadow: var(--shadow-lg);
}
[data-theme="light"] .table-wrapper table thead { background: var(--bg2); }
[data-theme="light"] .table-wrapper table td,
[data-theme="light"] .table-wrapper table th {
    border-color: var(--border);
}
[data-theme="light"] .status-badge.active { background: #e6f7ee; color: #1f9d55; }
[data-theme="light"] .status-badge.expired { background: #fdeaea; color: #d92d32; }
[data-theme="light"] .days-badge.warning { background: #fef4e2; color: #b8860b; }
[data-theme="light"] .days-badge.ok { background: #e6f7ee; color: #1f9d55; }
[data-theme="light"] .days-badge.critical { background: #fdeaea; color: #d92d32; }
[data-theme="light"] .gallery-tab { color: var(--text2); }
[data-theme="light"] .gallery-tab.active {
    background: var(--accent);
    color: #fff;
}
[data-theme="light"] .search-input {
    background: var(--card);
    border-color: var(--border);
}
[data-theme="light"] .video-title { color: var(--text); }
[data-theme="light"] .post-time { color: var(--text3); }
[data-theme="light"] .pagination-btn {
    background: var(--card);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="light"] .pagination-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
[data-theme="light"] .profile-stat-value { color: var(--text); }
[data-theme="light"] .bottom-nav {
    background: rgba(255,255,255,0.94);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(14px);
}
[data-theme="light"] .bn-item { color: var(--text3); }
[data-theme="light"] .bn-item.active { color: var(--accent); }
[data-theme="light"] .lightbox { background: rgba(0,0,0,0.92); }
[data-theme="light"] .lightbox-close { color: rgba(255,255,255,0.8); }
[data-theme="light"] .lightbox-nav { color: rgba(255,255,255,0.7); background: rgba(0,0,0,0.3); }
[data-theme="light"] .lightbox-caption { color: rgba(255,255,255,0.8); }

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.1px;
}

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

img { max-width: 100%; display: block; }

/* ─── Navbar ─── */
.navbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background: rgba(17,17,24,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.logo {
    font-family: "Baloo 2", "Plus Jakarta Sans", sans-serif;
    font-size: 1.5rem; font-weight: 800;
    color: var(--accent); letter-spacing: 0.5px;
    text-shadow: 0 0 22px var(--accent-glow);
    line-height: 1;
}
.nav-links { display: flex; align-items: center; gap: 0.9rem; font-size: 0.9rem; flex-wrap: wrap; }
.nav-link { color: var(--text2); }
.nav-link:hover { color: var(--text); }
.nav-user { color: var(--text2); font-size: 0.88rem; }
.nav-admin { color: var(--accent); }

/* ─── Container ─── */
.container { max-width: var(--maxw); margin: 0 auto; padding: 1.25rem; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.4rem; padding: 0.6rem 1.3rem;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.92rem; font-weight: 650; line-height: 1;
    color: #14140f; background: var(--accent);
    transition: all var(--transition); white-space: nowrap;
}
.btn:hover { background: var(--accent2); color: #14140f; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); }
.btn-outline {
    background: transparent; color: var(--text);
    border-color: var(--border2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-full { width: 100%; padding: 0.85rem; font-size: 1rem; }
.btn-lg { padding: 0.85rem 1.7rem; font-size: 1.02rem; border-radius: var(--radius-sm); }
.btn-sm { padding: 0.42rem 0.85rem; font-size: 0.82rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c93a3f; color: #fff; }

/* ─── Alerts ─── */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 0.9rem; }
.alert-error { background: var(--danger-bg); color: #ff7a7a; border: 1px solid #4a2023; }

/* ─────────────────────────────────────────────
   Landing page
   ───────────────────────────────────────────── */
.landing { max-width: var(--maxw); margin: 0 auto; }

.hero {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem;
    align-items: center; padding: 3.5rem 0 3rem;
}
.hero-badge {
    display: inline-block; padding: 0.3rem 0.8rem; font-size: 0.75rem;
    font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: var(--accent); background: rgba(224,185,76,0.12);
    border: 1px solid rgba(224,185,76,0.35); border-radius: 20px;
    margin-bottom: 1.2rem;
}
.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800;
    line-height: 1.1; letter-spacing: -0.5px; margin-bottom: 1rem;
}
.hero-sub { font-size: 1.1rem; color: var(--text2); margin-bottom: 1.8rem; max-width: 460px; }
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 2.2rem; }
.hero-stats { display: flex; gap: 2.2rem; }
.hero-stat { display: flex; flex-direction: column; }
.hero-stat .num { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.hero-stat .label { font-size: 0.78rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }

.hero-visual { display: flex; justify-content: center; }
.hero-card {
    width: 100%; max-width: 440px; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.hero-card-header {
    display: flex; align-items: center; gap: 6px; padding: 0.7rem 1rem;
    background: var(--card2); border-bottom: 1px solid var(--border);
}
.hero-url {
    margin-left: auto; font-size: 0.72rem; color: var(--text3);
    background: var(--bg2); padding: 3px 10px; border-radius: 12px;
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red { background: #ff5f57; } .dot.yellow { background: #febc2e; } .dot.green { background: #28c840; }
.hero-card-body { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.9rem; }

.hero-player { border-radius: 10px; overflow: hidden; background: #000; }
.hero-player-screen {
    position: relative; aspect-ratio: 16/9;
    background:
        radial-gradient(circle at 25% 30%, rgba(224,185,76,0.22), transparent 45%),
        radial-gradient(circle at 75% 70%, rgba(90,60,160,0.28), transparent 50%),
        linear-gradient(135deg, #14141e, #0a0a12);
    display: flex; align-items: center; justify-content: center;
}
.hero-play-btn {
    width: 70px; height: 70px; border-radius: 50%;
    background: rgba(224,185,76,0.95); color: #14140f;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; padding-left: 5px;
    box-shadow: 0 0 40px var(--accent-glow);
    animation: heroPulse 2.4s ease-in-out infinite;
}
@keyframes heroPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px var(--accent-glow); }
    50% { transform: scale(1.07); box-shadow: 0 0 55px var(--accent-glow); }
}
.hero-live-badge {
    position: absolute; top: 10px; left: 10px;
    font-size: 0.62rem; font-weight: 800; letter-spacing: 1px;
    color: #fff; background: rgba(229,72,77,0.9);
    padding: 3px 8px; border-radius: 4px;
}
.hero-screen-glow {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to bottom, transparent 55%, rgba(0,0,0,0.5));
}
.hero-player-bar { padding: 0.6rem 0.8rem; background: var(--card2); }
.hero-progress { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 0.5rem; }
.hero-progress-fill { width: 62%; height: 100%; background: var(--accent); border-radius: 2px; }
.hero-player-meta { display: flex; justify-content: space-between; font-size: 0.72rem; }
.hero-meta-title { color: var(--text); font-weight: 600; }
.hero-meta-time { color: var(--text3); }

.hero-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.hero-thumb {
    aspect-ratio: 3/4; border-radius: 7px; position: relative;
    background: var(--card2); overflow: hidden;
    border: 1px solid var(--border);
}
.hero-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-thumb.active { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.ht-play {
    position: absolute; inset: 0; margin: auto;
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(0,0,0,0.6); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem; padding-left: 2px;
}
.shimmer-row { display: flex; gap: 0.8rem; }
.shimmer-block {
    background: linear-gradient(110deg, var(--card2) 8%, #262636 18%, var(--card2) 33%);
    background-size: 200% 100%; border-radius: 8px;
    animation: shimmer 1.8s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.features {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
    padding: 2.5rem 0;
}
.feature {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.6rem;
    transition: transform var(--transition), border-color var(--transition);
}
.feature:hover { transform: translateY(-3px); border-color: var(--border2); }
.feature-icon { font-size: 2rem; margin-bottom: 0.8rem; }
.feature h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.feature p { font-size: 0.9rem; color: var(--text2); }

.cta-banner {
    text-align: center; padding: 3rem 1.5rem; margin: 1rem 0 2rem;
    background: linear-gradient(135deg, rgba(224,185,76,0.1), rgba(224,185,76,0.03));
    border: 1px solid rgba(224,185,76,0.25); border-radius: var(--radius);
}
.cta-banner h2 { font-size: 1.7rem; margin-bottom: 0.5rem; }
.cta-banner p { color: var(--text2); margin-bottom: 1.4rem; }

.site-footer { text-align: center; padding: 1.5rem; color: var(--text3); font-size: 0.82rem; }

/* ─────────────────────────────────────────────
   Auth page
   ───────────────────────────────────────────── */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: calc(100vh - 64px); padding: 1rem;
}
.auth-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2.2rem;
    width: 100%; max-width: 410px; text-align: center;
    box-shadow: var(--shadow);
}
.auth-logo { font-size: 2.6rem; margin-bottom: 0.5rem; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.auth-subtitle { color: var(--text2); margin-bottom: 1.6rem; font-size: 0.92rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-size: 0.84rem; color: var(--text2); font-weight: 600; }
.field input {
    padding: 0.78rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
    font-size: 0.98rem; transition: border-color var(--transition);
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.auth-footer { margin-top: 1.3rem; font-size: 0.85rem; color: var(--text2); }

/* ─────────────────────────────────────────────
   Dashboard
   ───────────────────────────────────────────── */
.dashboard { max-width: var(--maxw); margin: 0 auto; }
.welcome-banner {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1.2rem; flex-wrap: wrap; padding: 1.5rem 1.6rem;
    background: linear-gradient(135deg, rgba(224,185,76,0.08), var(--card));
    border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.4rem;
}
.welcome-text h1 { font-size: 1.5rem; }
.welcome-sub { color: var(--text2); margin-top: 0.3rem; font-size: 0.95rem; }
.status-active { color: var(--success); }
.sub-status-card {
    display: flex; flex-direction: column; gap: 0.2rem; text-align: right;
    padding: 0.8rem 1.2rem; background: var(--card2); border-radius: var(--radius-sm);
}
.sub-label { font-size: 0.75rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
.sub-value { font-size: 1.1rem; font-weight: 700; color: var(--success); }
.sub-expiry { font-size: 0.8rem; color: var(--text2); }

.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.8rem; }
.dash-stat {
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
    padding: 1.3rem; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); transition: transform var(--transition);
}
.dash-stat:hover { transform: translateY(-2px); border-color: var(--border2); }
.dash-num { font-size: 1.9rem; font-weight: 800; color: var(--accent); }
.dash-label { font-size: 0.82rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }

.section-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem;
}
.section-head h2 { font-size: 1.25rem; }
.recent-section { margin-bottom: 2rem; }

/* ─────────────────────────────────────────────
   Gallery
   ───────────────────────────────────────────── */
.gallery-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 1.4rem;
}
.gallery-header h1 { font-size: 1.5rem; }
.gallery-controls { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.gallery-tabs { display: flex; gap: 0.3rem; background: var(--card); padding: 0.25rem; border-radius: 22px; }
.tab-btn {
    padding: 0.42rem 1rem; border: none; border-radius: 18px;
    background: transparent; color: var(--text2);
    cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: all var(--transition);
}
.tab-btn.active, .tab-btn:hover { background: var(--accent); color: #14140f; }
.search-form { display: flex; gap: 0.4rem; }
.search-input {
    padding: 0.5rem 0.9rem; border: 1px solid var(--border);
    border-radius: 18px; background: var(--bg); color: var(--text);
    font-size: 0.88rem; min-width: 160px;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-note { color: var(--text2); font-size: 0.88rem; margin-bottom: 1rem; }

.media-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
.media-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: transform var(--transition), border-color var(--transition);
    position: relative;
}
.media-card[data-type="video"] { cursor: pointer; }
.media-card[data-type="image"] { cursor: zoom-in; }
.media-card:hover { transform: translateY(-2px); border-color: var(--border2); box-shadow: var(--shadow); }

.media-video-wrapper {
    position: relative; aspect-ratio: 1/1; background: #000;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.media-video-wrapper video { width: 100%; height: 100%; object-fit: cover; }
.thumb-poster {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 1;
}
.play-overlay { display: none; }
.media-img-wrapper { aspect-ratio: 1/1; overflow: hidden; background: var(--bg2); }
.media-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.media-card:hover .media-img-wrapper img { transform: scale(1.05); }
.media-info { padding: 0.7rem 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.media-badge { font-size: 0.72rem; padding: 3px 8px; border-radius: 5px; font-weight: 700; }
.badge-video { background: #2a1a3a; color: #c99af5; }
.badge-image { background: #14253d; color: #7fb5f5; }
.media-title { flex: 1; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.media-date { font-size: 0.74rem; color: var(--text3); }

/* Pagination */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 1rem; margin: 2rem 0;
}
.page-btn {
    padding: 0.5rem 1.1rem; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font-size: 0.88rem;
    transition: all var(--transition);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-info { color: var(--text2); font-size: 0.88rem; }

/* ─────────────────────────────────────────────
   Lightbox (with navigation)
   ───────────────────────────────────────────── */
.lightbox {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.95); z-index: 999;
    align-items: center; justify-content: center; flex-direction: column;
}
.lightbox.active { display: flex; }
.lightbox-close {
    position: absolute; top: 0.7rem; right: 1.4rem;
    font-size: 2.8rem; color: #fff; cursor: pointer; line-height: 1;
    z-index: 1002;
}
.lightbox-close:hover { color: var(--accent); }

.lightbox-media {
    width: 100%; height: 82vh;
    display: flex; align-items: center; justify-content: center;
    padding: 0 70px;
}
.lightbox-img-wrap, .lightbox-vid-wrap {
    max-width: 100%; max-height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.lightbox-img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 8px; }
.lightbox-video { max-width: 100%; max-height: 82vh; border-radius: 8px; outline: none; }

.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
    color: #fff; font-size: 2rem; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); z-index: 1002;
}
.lightbox-nav:hover { background: var(--accent); color: #14140f; border-color: var(--accent); }
.lightbox-prev { left: 1rem; padding-right: 4px; }
.lightbox-next { right: 1rem; padding-left: 4px; }

.lightbox-footer {
    display: flex; align-items: center; gap: 0.8rem;
    margin-top: 0.6rem; padding: 0 1rem;
}
.lightbox-counter {
    font-size: 0.8rem; color: var(--text3); font-weight: 700;
    white-space: nowrap;
}
.lightbox-caption { color: #ccc; font-size: 0.92rem; }

/* ─────────────────────────────────────────────
   Empty state
   ───────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 4.5rem 1rem; color: var(--text2);
    background: var(--card); border: 1px dashed var(--border2);
    border-radius: var(--radius); font-size: 1.05rem;
}

/* ─────────────────────────────────────────────
   Admin
   ───────────────────────────────────────────── */
.admin-page h1 { margin-bottom: 1.5rem; }
.admin-stats { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.2rem 1.5rem;
    text-align: center; min-width: 110px; flex: 1;
}
.stat-number { display: block; font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 0.78rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
.admin-section {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
}
.admin-section h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.admin-form { display: flex; flex-direction: column; gap: 0.8rem; }
.form-row { display: flex; flex-direction: column; gap: 0.3rem; }
.form-row label { font-size: 0.84rem; color: var(--text2); font-weight: 600; }
.admin-form input, .admin-form select {
    padding: 0.62rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
    font-size: 0.9rem;
}
.admin-form input:focus, .admin-form select:focus { outline: none; border-color: var(--accent); }
.inline-form { display: inline-flex; gap: 0.4rem; align-items: center; }

.user-create-form { flex-wrap: wrap; margin-bottom: 1rem; }
.user-create-form input { padding: 0.55rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }

.media-manage-tabs { display: flex; gap: 0.3rem; margin-bottom: 1rem; }
.media-manage-list { display: none; flex-direction: column; gap: 0.6rem; max-height: 420px; overflow-y: auto; }
.media-manage-list.active { display: flex; }
.media-manage-row {
    display: flex; align-items: center; gap: 0.8rem; padding: 0.55rem;
    background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.mm-thumb { width: 64px; height: 40px; object-fit: cover; border-radius: 5px; flex-shrink: 0; }
.mm-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 1.2rem; background: #000; }
.mm-title-form { flex: 1; }
.mm-title-input { flex: 1; padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 0.85rem; min-width: 120px; }
.mm-date { font-size: 0.78rem; color: var(--text3); flex-shrink: 0; }

.user-table-wrapper { overflow-x: auto; margin-top: 1rem; }
.user-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.user-table th, .user-table td { padding: 0.62rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.user-table th { color: var(--text3); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.5px; }
.user-table tr:hover td { background: var(--bg2); }
.actions-cell { display: flex; gap: 0.3rem; flex-wrap: wrap; }

/* ─────────────────────────────────────────────
   Error page
   ───────────────────────────────────────────── */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--accent); opacity: 0.7; }
.error-page h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.error-page p { color: var(--text2); margin-bottom: 1.5rem; }

/* ─────────────────────────────────────────────
   Profile page
   ───────────────────────────────────────────── */
.profile-page { max-width: 720px; margin: 0 auto; }
.profile-heading { margin-bottom: 1.5rem; }
.profile-section {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.4rem;
}
.profile-section h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.profile-info-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
.profile-info-item { display: flex; flex-direction: column; gap: 0.2rem; }
.pi-label { font-size: 0.76rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
.pi-value { font-size: 1rem; font-weight: 600; }
.status-expired { color: var(--danger); }
.profile-form { display: flex; flex-direction: column; gap: 1rem; max-width: 420px; }
.alert-success { background: #10251a; color: #4ade80; border: 1px solid #1d3a28; }
[data-theme="light"] .alert-success { background: #e6f7ee; color: #1f9d55; border: 1px solid #bfe6cf; }

/* ─────────────────────────────────────────────
   Theme options (profile)
   ───────────────────────────────────────────── */
.theme-options { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.theme-option { position: relative; cursor: pointer; }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-swatch {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.1rem; border: 2px solid var(--border);
    border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem;
    transition: all var(--transition); background: var(--bg2);
}
.theme-swatch.dark { background: #17171f; color: #e6e6ee; }
.theme-swatch.light { background: #f5f5f9; color: #1a1a26; }
.theme-option input:checked + .theme-swatch { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ─────────────────────────────────────────────
   Gate popup (landing)
   ───────────────────────────────────────────── */
.gate-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.72); backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 998; align-items: center; justify-content: center;
    padding: 1.2rem;
}
.gate-overlay.active { display: flex; }
.gate-modal {
    position: relative; width: 100%; max-width: 440px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 20px; padding: 2.4rem 2rem 2rem; text-align: center;
    overflow: hidden;
    animation: gateIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
@keyframes gateIn {
    from { opacity: 0; transform: translateY(24px) scale(0.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.gate-glow {
    position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
    width: 320px; height: 160px; border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    pointer-events: none;
}
.gate-close {
    position: absolute; top: 0.6rem; right: 1rem;
    font-size: 2rem; color: var(--text3); background: none; border: none;
    cursor: pointer; line-height: 1; z-index: 2;
}
.gate-close:hover { color: var(--text); }
.gate-icon { font-size: 3rem; margin-bottom: 0.8rem; }
.gate-modal h2 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.gate-sub { color: var(--text2); margin-bottom: 1.6rem; font-size: 0.95rem; }
.gate-cta { display: flex; flex-direction: column; gap: 0.7rem; }
.gate-cta .btn { width: 100%; }
.gate-foot { margin-top: 1.3rem; font-size: 0.78rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }

/* ─────────────────────────────────────────────
   Mobile bottom nav
   ───────────────────────────────────────────── */
.bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
    background: rgba(17,17,24,0.95); backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 0.4rem 0.3rem calc(0.4rem + env(safe-area-inset-bottom));
}
.bottom-nav .bn-item {
    display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
    color: var(--text2); font-size: 0.68rem; flex: 1; padding: 0.25rem 0;
}
.bottom-nav .bn-item:hover { color: var(--text); }
.bn-icon { font-size: 1.3rem; line-height: 1; }
.bn-logout { color: var(--danger); }
[data-theme="light"] .bottom-nav { background: rgba(255,255,255,0.95); }

/* ─────────────────────────────────────────────
   Lightbox fade transition
   ───────────────────────────────────────────── */
.lightbox-media { transition: opacity 0.18s ease; }
.lightbox-media.fading { opacity: 0; }
.lightbox-img, .lightbox-video { animation: lbFade 0.3s ease; }
@keyframes lbFade {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

/* ─────────────────────────────────────────────
   Responsive breakpoints
   ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; gap: 1.5rem; padding: 2.2rem 0 2rem; }
    .hero-visual { order: -1; }
    .features { grid-template-columns: 1fr; }
    .hero-stats { gap: 1.4rem; }
}

@media (max-width: 640px) {
    .container { padding: 0.9rem; }
    .navbar { padding: 0.65rem 0.9rem; }
    .logo { font-size: 1.15rem; }
    .nav-links { gap: 0.6rem; font-size: 0.82rem; }
    .nav-link { display: none; }
    .gallery-header { flex-direction: column; align-items: stretch; }
    .gallery-controls { flex-direction: column; align-items: stretch; }
    .gallery-tabs { overflow-x: auto; }
    .search-form { width: 100%; }
    .search-input { flex: 1; min-width: 0; }
    .media-grid { grid-template-columns: repeat(2, 1fr); gap: 4px; }
    .media-info { display: none; }
    .lightbox-media { padding: 0 8px; }
    .lightbox-nav { width: 40px; height: 40px; font-size: 1.5rem; }
    .lightbox-prev { left: 0.3rem; }
    .lightbox-next { right: 0.3rem; }
    .lightbox-video, .lightbox-img { max-height: 70vh; }
    .bottom-nav { display: flex; }
    body { padding-bottom: 62px; }
    .welcome-banner { flex-direction: column; align-items: stretch; text-align: left; }
    .sub-status-card { text-align: left; }
    .dash-stats { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
    .dash-num { font-size: 1.5rem; }
    .auth-card { padding: 1.6rem; }
    .admin-stats { flex-wrap: wrap; }
    .stat-card { flex: 1; min-width: 78px; padding: 0.9rem; }
    .stat-number { font-size: 1.4rem; }
    .user-table { font-size: 0.75rem; }
    .media-manage-row { flex-wrap: wrap; }
    .mm-title-form { min-width: 100%; }
    .hero-cta .btn { width: 100%; }
    .profile-info-grid { grid-template-columns: 1fr; }
}
/* ─────────────────────────────────────────────
   Analytics page
   ───────────────────────────────────────────── */
.analytics-page { max-width: var(--maxw); margin: 0 auto; }
.analytics-header { margin-bottom: 1.5rem; }
.analytics-header h1 { font-size: 1.6rem; }
.analytics-header p { color: var(--text2); margin-top: 0.2rem; }

.metrics-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem; margin-bottom: 1.8rem;
}
.metric-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.3rem 1.4rem;
    display: flex; flex-direction: column; gap: 0.3rem;
    transition: transform var(--transition), border-color var(--transition);
}
.metric-card:hover { transform: translateY(-2px); border-color: var(--border2); }
.metric-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.metric-label { font-size: 0.82rem; color: var(--text2); font-weight: 600; }
.metric-sub { font-size: 0.74rem; color: var(--text3); }
.metric-gold .metric-value { color: var(--accent); }
.metric-green .metric-value { color: var(--success); }
.metric-red .metric-value { color: var(--danger); }
.metric-blue .metric-value { color: #7fb5f5; }
.metric-purple .metric-value { color: #c99af5; }
.metric-cyan .metric-value { color: #7fd4d4; }

.analytics-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem;
    margin-bottom: 1.5rem;
}
.analytics-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem;
}
.analytics-card h3 { font-size: 1.05rem; margin-bottom: 1rem; }
.analytics-empty { color: var(--text3); font-size: 0.9rem; }

/* Bar chart */
.bar-chart { display: flex; flex-direction: column; gap: 0.6rem; }
.bar-row { display: flex; align-items: center; gap: 0.7rem; }
.bar-label { font-size: 0.78rem; color: var(--text2); min-width: 55px; font-weight: 600; }
.bar-track { flex: 1; height: 20px; background: var(--bg2); border-radius: 6px; overflow: hidden; }
.bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 6px; transition: width 0.6s ease; min-width: 2px;
}
.bar-value { font-size: 0.82rem; color: var(--text); font-weight: 700; min-width: 28px; text-align: right; }

/* Expiry table */
.expiry-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.expiry-table th, .expiry-table td { padding: 0.55rem 0.6rem; text-align: left; border-bottom: 1px solid var(--border); }
.expiry-table th { color: var(--text3); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.5px; }
.days-badge {
    display: inline-block; padding: 3px 8px; border-radius: 12px;
    font-size: 0.74rem; font-weight: 700;
}
.days-badge.critical { background: var(--danger-bg); color: var(--danger); }
.days-badge.warning { background: #2a2115; color: #f5c87a; }
.days-badge.ok { background: #10251a; color: #4ade80; }

/* Active users chips */
.active-users-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.active-user-chip {
    padding: 0.4rem 0.9rem; background: var(--bg2);
    border: 1px solid var(--border); border-radius: 16px;
    font-size: 0.82rem; color: var(--text); font-weight: 600;
}

/* Status badges */
.status-badge {
    display: inline-block; padding: 3px 9px; border-radius: 12px;
    font-size: 0.74rem; font-weight: 700;
}
.status-badge.active { background: #10251a; color: #4ade80; }
.status-badge.expired { background: var(--danger-bg); color: #ff7a7a; }

/* Table wrapper */
.table-wrapper { overflow-x: auto; }

/* Responsive */
@media (max-width: 900px) {
    .analytics-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .metric-card { padding: 1rem; }
    .metric-value { font-size: 1.3rem; }
    .analytics-card { padding: 1.1rem; }
}
