/* ==========================================================
   Editwave — creative 3D theme
   ========================================================== */
:root {
    --bg: #07051a;
    --bg2: #120c33;
    --text: #eef0ff;
    --muted: #a3a6c9;
    --panel: rgba(255, 255, 255, .055);
    --panel-2: rgba(255, 255, 255, .09);
    --border: rgba(255, 255, 255, .12);
    --c1: #8b5cf6;
    --c2: #22d3ee;
    --c3: #f472b6;
    --ok: #34d399;
    --err: #fb7185;
    --grad: linear-gradient(135deg, var(--c1), var(--c2));
    --grad-2: linear-gradient(135deg, var(--c3), var(--c1));
    --radius: 18px;
    --topbar: 68px;
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, .7);
    --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Outfit', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    background: radial-gradient(1200px 800px at 80% -10%, #1f1458 0%, transparent 60%),
                radial-gradient(900px 700px at -10% 110%, #0c2a4a 0%, transparent 60%),
                var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--c2); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video, iframe { display: block; max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 1rem; }
.inline { display: inline; margin: 0; }
.row-gap { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.gradient-text {
    background: linear-gradient(90deg, #fff, var(--c2) 40%, var(--c3) 80%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    background-size: 200% auto; animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

.glass {
    background: var(--panel);
    border: 1px solid var(--border);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
}

/* ---------- Animated aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora span {
    position: absolute; width: 45vmax; height: 45vmax; border-radius: 50%;
    filter: blur(90px); opacity: .35; mix-blend-mode: screen;
    animation: float 22s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: var(--c1); top: -15%; left: -10%; }
.aurora span:nth-child(2) { background: var(--c2); bottom: -20%; right: -10%; animation-delay: -7s; }
.aurora span:nth-child(3) { background: var(--c3); top: 30%; left: 40%; width: 30vmax; height: 30vmax; animation-delay: -14s; opacity: .22; }
@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(8vw, 6vh) scale(1.15); }
    100% { transform: translate(-6vw, -4vh) scale(.95); }
}

/* ---------- Buttons ---------- */
.btn {
    --b: var(--grad);
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .7rem 1.2rem; border-radius: 12px; border: 0; cursor: pointer;
    font: 600 .95rem/1 inherit; color: #fff; text-decoration: none !important;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
    position: relative; isolation: isolate; white-space: nowrap;
}
.btn-sm { padding: .55rem .9rem; font-size: .88rem; }
.btn-block { width: 100%; }
.btn-primary {
    background: var(--b);
    box-shadow: 0 10px 25px -10px var(--c1), inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 0 #4c2a9a;
    transform: translateY(-2px);
}
.btn-primary:hover { transform: translateY(-4px); box-shadow: 0 18px 30px -10px var(--c1), inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 0 #4c2a9a; }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 6px 15px -8px var(--c1), 0 1px 0 #4c2a9a; }
.btn-ghost { background: var(--panel-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255, 255, 255, .15); transform: translateY(-2px); }
.btn.loading { pointer-events: none; opacity: .85; }
.btn.loading i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
    display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
    background: var(--panel-2); border: 1px solid var(--border); color: var(--text); cursor: pointer;
    transition: transform .2s var(--ease), background .2s; text-decoration: none !important;
}
.icon-btn:hover { background: rgba(255, 255, 255, .18); transform: translateY(-2px) rotate(-4deg); }
.icon-btn.danger:hover { background: rgba(251, 113, 133, .3); }

.pill {
    display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 999px;
    font-size: .78rem; background: rgba(34, 211, 238, .14); color: #a5f3fc; border: 1px solid rgba(34, 211, 238, .3);
}
.pill-pink { background: rgba(244, 114, 182, .14); color: #fbcfe8; border-color: rgba(244, 114, 182, .35); }

/* ---------- Top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50; height: var(--topbar);
    display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem;
    border-width: 0 0 1px; border-radius: 0;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: .6rem; }
.topbar-right { margin-left: auto; }
.spacer { flex: 1; }
.brand { display: flex; align-items: center; gap: .8rem; color: #fff; text-decoration: none !important; }
.brand-name { font-weight: 800; font-size: 1.45rem; letter-spacing: .5px; }
.brand-name::first-letter { color: var(--c2); }
.brand-cube {
    --s: 26px; width: var(--s); height: var(--s); position: relative;
    transform-style: preserve-3d; animation: cube 10s linear infinite; margin: 0 4px;
}
.brand-cube span {
    position: absolute; inset: 0; border: 2px solid rgba(255, 255, 255, .85); border-radius: 4px;
    background: linear-gradient(135deg, rgba(139, 92, 246, .65), rgba(34, 211, 238, .55));
}
.brand-cube .f1 { transform: translateZ(calc(var(--s) / 2)); }
.brand-cube .f2 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.brand-cube .f3 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.brand-cube .f4 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.brand-cube .f5 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, rgba(244, 114, 182, .7), rgba(139, 92, 246, .5)); }
.brand-cube .f6 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
@keyframes cube { from { transform: rotateX(-25deg) rotateY(0); } to { transform: rotateX(-25deg) rotateY(360deg); } }

.search {
    flex: 1; max-width: 560px; margin: 0 auto; position: relative;
}
.search i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
    width: 100%; padding: .8rem 1rem .8rem 2.6rem; border-radius: 14px; color: var(--text);
    background: rgba(255, 255, 255, .06); border: 1px solid var(--border); font: inherit; outline: none;
    transition: border-color .25s, box-shadow .25s, background .25s;
}
.search input:focus { border-color: var(--c2); background: rgba(255, 255, 255, .1); box-shadow: 0 0 0 4px rgba(34, 211, 238, .15); }

.user-chip { display: flex; align-items: center; gap: .5rem; padding: .3rem .7rem .3rem .3rem; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-2); font-weight: 800; }

.flash {
    position: fixed; top: calc(var(--topbar) + 12px); left: 50%; transform: translateX(-50%); z-index: 90;
    padding: .8rem 1.2rem; border-radius: 12px; background: rgba(52, 211, 153, .18); border: 1px solid rgba(52, 211, 153, .5);
    backdrop-filter: blur(12px); animation: flashIn .5s var(--ease), flashOut .5s 4s forwards; max-width: 92vw;
}
.flash + .flash { top: calc(var(--topbar) + 66px); }
.flash-error { background: rgba(251, 113, 133, .18); border-color: rgba(251, 113, 133, .5); }
@keyframes flashIn { from { opacity: 0; transform: translate(-50%, -20px) rotateX(60deg); } }
@keyframes flashOut { to { opacity: 0; transform: translate(-50%, -20px); visibility: hidden; } }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; padding: 1.5rem; align-items: start; }
.sidebar {
    position: sticky; top: calc(var(--topbar) + 1.5rem); max-height: calc(100vh - var(--topbar) - 3rem);
    border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-head { display: flex; justify-content: space-between; align-items: center; padding: .25rem .5rem .75rem; text-transform: uppercase; letter-spacing: 2px; font-size: .75rem; color: var(--muted); }
.menu-list { overflow-y: auto; display: flex; flex-direction: column; gap: .35rem; padding: .2rem; perspective: 600px; }
.menu-item {
    display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: 14px; color: var(--text);
    text-decoration: none !important; position: relative; border: 1px solid transparent;
    transition: transform .35s var(--ease), background .3s, border-color .3s;
    animation: slideIn .6s var(--ease) both; animation-delay: var(--d);
}
.menu-item:hover { background: rgba(255, 255, 255, .07); transform: translateX(6px) rotateY(-8deg); }
.menu-item.active { background: linear-gradient(135deg, rgba(139, 92, 246, .35), rgba(34, 211, 238, .2)); border-color: rgba(255, 255, 255, .18); box-shadow: 0 10px 25px -15px var(--c1); }
.menu-item.active::before { content: ''; position: absolute; left: -1px; top: 20%; bottom: 20%; width: 4px; border-radius: 4px; background: var(--grad); }
.menu-icon {
    width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0;
    background: rgba(255, 255, 255, .08); transition: transform .4s var(--ease);
}
.menu-item:hover .menu-icon, .menu-item.active .menu-icon { background: var(--grad); transform: rotate(-8deg) scale(1.08); box-shadow: 0 8px 18px -8px var(--c2); }
.menu-name { flex: 1; font-weight: 600; font-size: .95rem; }
.menu-count { font-size: .75rem; padding: .15rem .5rem; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.sidebar-foot { font-size: .78rem; padding: .8rem .5rem 0; border-top: 1px solid var(--border); margin-top: .8rem; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-30px) rotateY(30deg); } }

.content { min-width: 0; }
.content-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.content-head h1 { margin: .1rem 0 0; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 3px; font-size: .75rem; color: var(--c2); }

/* ---------- Gallery: 3D cards ---------- */
.gallery { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); perspective: 1400px; }
.gallery.image-mode { display: block; columns: 4 260px; column-gap: 1.25rem; }
.gallery.image-mode .card { break-inside: avoid; margin-bottom: 1.25rem; }

.card {
    --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
    position: relative; border-radius: var(--radius); transform-style: preserve-3d;
    animation: cardIn .8s var(--ease) both; animation-delay: var(--d, 0ms);
}
.card-inner {
    position: relative; border-radius: var(--radius); overflow: hidden;
    background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
    border: 1px solid var(--border);
    box-shadow: 0 25px 45px -25px rgba(0, 0, 0, .9), 0 0 0 0 rgba(139, 92, 246, 0);
    transform: rotateX(var(--rx)) rotateY(var(--ry));
    transform-style: preserve-3d;
    transition: transform .25s ease-out, box-shadow .4s var(--ease), border-color .4s;
}
.card:hover .card-inner { box-shadow: 0 35px 60px -25px rgba(0, 0, 0, .95), 0 0 40px -10px rgba(139, 92, 246, .55); border-color: rgba(255, 255, 255, .25); }
.card-glare {
    position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0; transition: opacity .3s;
    background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .22), transparent 45%);
}
.card:hover .card-glare { opacity: 1; }
@keyframes cardIn {
    from { opacity: 0; transform: translateY(50px) rotateX(-25deg) scale(.92); }
    to { opacity: 1; transform: none; }
}

.media {
    position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; cursor: zoom-in;
    transform: translateZ(30px);
}
.image-mode .media { aspect-ratio: auto; min-height: 140px; }
.media > img, .media > video.thumb-video {
    width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .5s;
}
.image-mode .media > img { height: auto; }
.card:hover .media > img, .card:hover .media > video.thumb-video { transform: scale(1.08); }
.media .live {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; opacity: 0;
    transition: opacity .45s; background: #000; pointer-events: none;
}
.media .live.show { opacity: 1; }
.media iframe.live { transform: scale(1.35); } /* hide YouTube chrome on hover preview */
.media::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, transparent 55%, rgba(7, 5, 26, .75));
}
.badge {
    position: absolute; top: .7rem; left: .7rem; z-index: 2; font-size: .7rem; font-weight: 600;
    padding: .3rem .6rem; border-radius: 8px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px);
    text-transform: uppercase; letter-spacing: 1px;
}
.badge.yt i { color: #ff4d4d; }
.badge.git i { color: #f0883e; }
.play-hint {
    position: absolute; left: 50%; top: 50%; z-index: 2; width: 58px; height: 58px; margin: -29px 0 0 -29px;
    border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .35); transition: opacity .3s, transform .4s var(--ease);
}
.play-hint::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); animation: pulse 2s infinite; }
@keyframes pulse { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.card.playing .play-hint { opacity: 0; transform: scale(.4); }
.expand {
    position: absolute; top: .6rem; right: .6rem; z-index: 4; opacity: 0; transform: translateY(-8px) scale(.8);
    transition: opacity .3s, transform .3s var(--ease); background: rgba(0, 0, 0, .5);
}
.card:hover .expand, .card:focus-within .expand { opacity: 1; transform: none; }
.progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--grad); z-index: 3; transition: width .2s linear; }

.card-body { padding: 1rem 1.1rem 1.1rem; transform: translateZ(20px); }
.card-title { margin: 0 0 .35rem; font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.card-sub { font-size: .8rem; color: var(--muted); margin-bottom: .6rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.tag { padding: .12rem .5rem; border-radius: 6px; background: rgba(255, 255, 255, .07); font-size: .72rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.dl-count { font-size: .8rem; color: var(--muted); }
.lock-note { font-size: .7rem; color: var(--muted); }

/* skeleton */
.skeleton { border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--border); }
.skeleton .sk-media { aspect-ratio: 16/9; }
.skeleton .sk-line { height: 12px; margin: 1rem; border-radius: 6px; }
.skeleton .sk-line.short { width: 50%; }
.skeleton .sk-media, .skeleton .sk-line {
    background: linear-gradient(90deg, rgba(255, 255, 255, .05) 25%, rgba(255, 255, 255, .13) 50%, rgba(255, 255, 255, .05) 75%);
    background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* empty */
.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty-cube { width: 70px; height: 70px; margin: 0 auto 1.5rem; position: relative; transform-style: preserve-3d; animation: cube 6s linear infinite; }
.empty-cube span { position: absolute; inset: 0; border: 2px solid var(--c1); border-radius: 10px; }
.empty-cube span:nth-child(2) { transform: rotateY(60deg); border-color: var(--c2); }
.empty-cube span:nth-child(3) { transform: rotateY(120deg); border-color: var(--c3); }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; visibility: hidden; perspective: 1500px; }
.modal.open { visibility: visible; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 3, 15, .8); opacity: 0; transition: opacity .35s; backdrop-filter: blur(6px); }
.modal.open .modal-backdrop { opacity: 1; }
.modal-box {
    position: relative; width: min(1100px, 100%); max-height: 94vh; border-radius: 22px; overflow: hidden;
    display: flex; flex-direction: column; background: rgba(18, 12, 51, .85);
    opacity: 0; transform: rotateX(25deg) translateY(60px) scale(.9); transition: transform .5s var(--ease), opacity .4s;
}
.modal.open .modal-box { opacity: 1; transform: none; }
.modal-box.small { width: min(420px, 100%); padding: 2rem; }
.modal-close { position: absolute; top: .8rem; right: .8rem; z-index: 5; background: rgba(0, 0, 0, .55); }
.modal-media { background: #000; display: grid; place-items: center; min-height: 200px; }
.modal-media video, .modal-media iframe { width: 100%; aspect-ratio: 16/9; max-height: 75vh; border: 0; background: #000; }
.modal-media img { max-height: 78vh; width: auto; max-width: 100%; object-fit: contain; cursor: zoom-in; transition: transform .4s var(--ease); }
.modal-media img.zoomed { transform: scale(1.8); cursor: zoom-out; }
.modal-media.image-scroll { overflow: auto; max-height: 78vh; }
.modal-info { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.3rem; flex-wrap: wrap; }
.modal-info h3 { margin: 0; }
.modal-info p { margin: .25rem 0 0; }
.lock-3d {
    width: 74px; height: 74px; margin: 0 auto 1rem; border-radius: 22px; display: grid; place-items: center; font-size: 1.8rem;
    background: var(--grad); box-shadow: 0 18px 30px -12px var(--c1), inset 0 -6px 0 rgba(0, 0, 0, .2);
    animation: bob 3s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-8px) rotate(-6deg); } }

/* ---------- Toasts ---------- */
.toast-wrap { position: fixed; right: 1rem; bottom: 1rem; z-index: 120; display: flex; flex-direction: column; gap: .6rem; max-width: calc(100vw - 2rem); }
.toast {
    display: flex; gap: .7rem; align-items: center; padding: .85rem 1.1rem; border-radius: 14px;
    background: rgba(18, 12, 51, .92); border: 1px solid var(--border); box-shadow: var(--shadow);
    animation: toastIn .5s var(--ease) both;
}
.toast.ok i { color: var(--ok); }
.toast.err i { color: var(--err); }
.toast.info i { color: var(--c2); }
.toast.out { animation: toastOut .4s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(60px) rotateY(-40deg); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(60px); } }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - var(--topbar)); display: grid; place-items: center; padding: 2rem 1rem; perspective: 1200px; }
.auth-card { width: min(430px, 100%); padding: 2.2rem; border-radius: 24px; text-align: left; animation: cardIn .8s var(--ease) both; }
.auth-card h2 { text-align: center; margin: 0 0 .2rem; font-size: 1.9rem; }
.auth-card > p.muted { text-align: center; margin-top: 0; }
.field { display: block; margin: 1rem 0; }
.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }
.field input, .field select, .field textarea, .filters input, .filters select {
    width: 100%; padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--border);
    background: rgba(255, 255, 255, .06); color: var(--text); font: inherit; outline: none; transition: border-color .25s, box-shadow .25s;
}
.field select option, .filters select option { background: var(--bg2); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--c2); box-shadow: 0 0 0 4px rgba(34, 211, 238, .15); }
.alert { padding: .7rem 1rem; border-radius: 12px; background: rgba(251, 113, 133, .15); border: 1px solid rgba(251, 113, 133, .4); margin: .6rem 0; font-size: .9rem; }
.check { display: flex; align-items: center; gap: .5rem; margin: .8rem 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--c1); }

/* ---------- Admin ---------- */
.admin-wrap { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }
.admin-tabs { display: flex; gap: .4rem; padding: .5rem; border-radius: 16px; margin-bottom: 1.5rem; overflow-x: auto; }
.admin-tabs a { display: flex; align-items: center; gap: .5rem; padding: .65rem 1rem; border-radius: 11px; color: var(--text); white-space: nowrap; text-decoration: none !important; transition: background .25s; }
.admin-tabs a:hover { background: rgba(255, 255, 255, .08); }
.admin-tabs a.active { background: var(--grad); box-shadow: 0 8px 20px -10px var(--c1); }
.admin-tabs .push-right { margin-left: auto; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.admin-body h1 { margin: 0 0 1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; perspective: 900px; }
.stat { padding: 1.3rem; border-radius: var(--radius); display: flex; flex-direction: column; gap: .2rem; animation: cardIn .7s var(--ease) both; animation-delay: var(--d); }
.stat i { font-size: 1.4rem; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); margin-bottom: .5rem; }
.stat strong { font-size: 2rem; }
.stat span { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.two-col.wide-left { grid-template-columns: 1.6fr 1fr; }
.panel { padding: 1.3rem; border-radius: var(--radius); margin-bottom: 1.5rem; }
.panel h3 { margin-top: 0; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.form.narrow { max-width: 480px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; padding: .6rem; border-bottom: 1px solid var(--border); }
.table td { padding: .7rem .6rem; border-bottom: 1px solid rgba(255, 255, 255, .06); vertical-align: middle; }
.table tr { transition: background .2s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .04); }
.actions { white-space: nowrap; text-align: right; }
.actions form { margin-left: .3rem; }
.thumb-sm { position: relative; width: 120px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #000; }
.thumb-sm img, .thumb-sm video { width: 100%; height: 100%; object-fit: cover; }
.kind { position: absolute; bottom: 4px; left: 4px; font-size: .62rem; padding: .1rem .35rem; border-radius: 5px; background: rgba(0, 0, 0, .7); text-transform: uppercase; }
.switch { width: 46px; height: 26px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255, 255, 255, .1); position: relative; cursor: pointer; transition: background .3s; padding: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); }
.switch.on { background: var(--grad); }
.switch.on span { transform: translateX(20px); }
.rank { list-style: none; padding: 0; margin: 0; }
.rank li { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.rank li span:nth-child(2) { flex: 1; }
.rank-n { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--grad-2); font-weight: 800; font-size: .85rem; }
.filters { display: flex; gap: .6rem; padding: .8rem; border-radius: 14px; margin-bottom: 1rem; flex-wrap: wrap; }
.filters select { width: auto; min-width: 180px; }
.filters input { flex: 1; min-width: 160px; }
.icon-input { display: flex; align-items: center; gap: .6rem; }
.icon-input i { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--grad); flex-shrink: 0; }
.icon-picks { display: flex; flex-wrap: wrap; gap: .4rem; }
.admin-preview { border-radius: 14px; overflow: hidden; background: rgba(0, 0, 0, .4); min-height: 120px; display: grid; place-items: center; }
.admin-preview img, .admin-preview video, .admin-preview iframe { width: 100%; aspect-ratio: 16/9; border: 0; object-fit: contain; }
.help ul { padding-left: 1.1rem; line-height: 1.7; font-size: .88rem; }
code { background: rgba(255, 255, 255, .08); padding: .1rem .35rem; border-radius: 5px; font-size: .85em; }

/* ---------- Responsive ---------- */
.only-mobile { display: none; }
.backdrop { display: none; }

@media (max-width: 1100px) {
    .layout { grid-template-columns: 240px 1fr; }
    .two-col, .two-col.wide-left { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    :root { --topbar: 62px; }
    .only-mobile { display: inline-grid; }
    .layout { grid-template-columns: 1fr; padding: 1rem; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 80; width: min(300px, 84vw); max-height: none;
        border-radius: 0 22px 22px 0; transform: translateX(-105%) rotateY(25deg); transform-origin: left center;
        transition: transform .5s var(--ease); background: rgba(18, 12, 51, .96);
    }
    body.sidebar-open .sidebar { transform: none; }
    .backdrop { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .35s; }
    body.sidebar-open .backdrop { opacity: 1; pointer-events: auto; }
    .topbar { flex-wrap: wrap; height: auto; min-height: var(--topbar); padding: .55rem .9rem; row-gap: .5rem; }
    .search { order: 3; flex-basis: 100%; max-width: none; }
    .flash { top: 120px; }
    .expand { opacity: 1; transform: none; }
}
@media (max-width: 600px) {
    .hide-sm { display: none; }
    .topbar-left, .topbar-right { gap: .4rem; }
    .user-chip { padding: .2rem; }
    .brand { gap: .55rem; }
    .brand-name { font-size: 1.2rem; }
    .gallery { grid-template-columns: 1fr; gap: 1.1rem; }
    .gallery.image-mode { columns: 2 140px; column-gap: .8rem; }
    .gallery.image-mode .card { margin-bottom: .8rem; }
    .image-mode .card-body { padding: .7rem; }
    .image-mode .card-foot { flex-direction: column; align-items: stretch; }
    .content-head { flex-direction: column; align-items: flex-start; }
    .admin-wrap { padding: 1rem; }
    .admin-tabs span { display: none; }
    .modal { padding: 0; }
    .modal-box { border-radius: 0; max-height: 100vh; height: 100%; justify-content: center; }
    .modal-box.small { height: auto; border-radius: 22px; margin: 1rem; }
}
@media (max-width: 420px) {
    .user-chip { display: none; }
    .brand-name { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
