:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --accent: #2563eb;
    --accent-soft: #dbeafe;
    --shadow: 0 18px 45px rgba(15, 23, 42, .09);
}
body.dark {
    --bg: #0f172a;
    --card: #162033;
    --text: #f8fafc;
    --muted: #a7b0c0;
    --border: #26344f;
    --accent: #60a5fa;
    --accent-soft: #1d365c;
    --shadow: 0 18px 45px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Segoe UI, Arial, sans-serif; background: radial-gradient(circle at top left, var(--accent-soft), transparent 32%), var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1320px; margin: 0 auto; padding: 28px; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.eyebrow { display:inline-flex; color: var(--accent); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; margin-bottom: 8px; }
.hero h1 { margin: 0; font-size: 38px; letter-spacing: -0.05em; }
.hero p { margin: 8px 0 0; color: var(--muted); }
.actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.btn, button { border: 0; background: var(--accent); color: white; padding: 11px 16px; border-radius: 14px; cursor: pointer; font-weight: 800; box-shadow: 0 10px 22px rgba(37,99,235,.22); }
.btn.secondary, button.secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.stats { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap:14px; margin-bottom: 18px; }
.stats div { background: rgba(255,255,255,.62); border: 1px solid var(--border); border-radius: 20px; padding: 16px; backdrop-filter: blur(12px); }
body.dark .stats div { background: rgba(22,32,51,.65); }
.stats b { display:block; font-size: 24px; letter-spacing: -.03em; }
.stats span { color: var(--muted); font-size: 13px; }
.toolbar { background: rgba(255,255,255,.55); border:1px solid var(--border); padding: 14px; border-radius: 22px; display:flex; justify-content:space-between; gap:12px; margin-bottom:22px; backdrop-filter: blur(12px); }
body.dark .toolbar { background: rgba(22,32,51,.65); }
.filter-row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
input, select { background: var(--card); color: var(--text); border: 1px solid var(--border); padding: 11px 13px; border-radius: 13px; }
.download-line { margin-bottom:18px; }
.grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card { background: var(--card); border:1px solid var(--border); border-radius: 24px; overflow:hidden; box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.media-card.hidden { display: none; }
.preview { height: 178px; background: #111827; display:flex; align-items:center; justify-content:center; position:relative; cursor: zoom-in; }
.preview img, .preview video { width:100%; height:100%; object-fit:cover; display:block; }
.badge { position:absolute; top:12px; left:12px; background:rgba(0,0,0,.62); color:#fff; padding:5px 9px; border-radius:999px; font-size:12px; font-weight: 800; }
.video-badge { left:auto; right:48px; }
.check { position:absolute; top:12px; right:12px; transform:scale(1.35); z-index:2; }
.card-body { padding: 15px; }
.filename { font-weight: 900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-bottom: 10px; }
.category-pill { display:inline-flex; max-width:100%; margin:0 0 10px; padding:5px 9px; border-radius:999px; background:var(--accent-soft); color:var(--accent); font-size:12px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.meta { color: var(--muted); font-size: 13px; line-height:1.65; }
.card-footer { padding: 0 15px 15px; display:flex; gap:8px; flex-wrap: wrap; }
.empty { background:var(--card); border:1px dashed var(--border); padding:34px; border-radius:22px; color:var(--muted); }
.admin-table { width:100%; border-collapse:separate; border-spacing:0 10px; }
.admin-table td, .admin-table th { padding:12px; background:var(--card); border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.admin-table th { color:var(--muted); text-align:left; }
.admin-table td:first-child, .admin-table th:first-child { border-left:1px solid var(--border); border-radius:14px 0 0 14px; }
.admin-table td:last-child, .admin-table th:last-child { border-right:1px solid var(--border); border-radius:0 14px 14px 0; }
.notice { padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); margin-bottom: 18px; }
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.78); display:none; align-items:center; justify-content:center; padding: 24px; z-index: 50; }
.viewer.show { display:flex; }
.viewer-inner { width:min(1100px, 96vw); max-height: 92vh; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 24px; padding: 16px; box-shadow: 0 30px 90px rgba(0,0,0,.45); position:relative; }
.viewer-inner h3 { margin: 0 46px 12px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-inner img, .viewer-inner video { width:100%; max-height: 76vh; object-fit: contain; border-radius: 16px; background:#000; }
.viewer-close { position:absolute; top:12px; right:12px; width:38px; height:38px; border-radius:999px; padding:0; font-size:24px; line-height:1; }
@media (max-width: 720px) { .header, .toolbar { flex-direction:column; align-items:stretch; } .stats { grid-template-columns: 1fr; } .filter-row { align-items: stretch; } input, select, .filter-row button { width:100%; } }

.btn.danger, button.danger { background:#dc2626; color:#fff; box-shadow:0 10px 22px rgba(220,38,38,.22); }
.btn.danger:hover, button.danger:hover { filter:brightness(.96); }
.status-pill { display:inline-flex; padding:6px 10px; border-radius:999px; font-size:12px; font-weight:900; }
.status-pill.visible { background:#dcfce7; color:#166534; }
.status-pill.hidden-state { background:#fee2e2; color:#991b1b; }
body.dark .status-pill.visible { background:#12351f; color:#86efac; }
body.dark .status-pill.hidden-state { background:#451a1a; color:#fecaca; }
.muted-row { opacity:.62; }
.muted-row:hover { opacity:1; }
.page-info { margin: -8px 0 12px; color: var(--muted); font-size: 14px; font-weight: 700; }
.pagination { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin: 0 0 18px; }
.pagination.bottom { justify-content:center; margin: 24px 0 4px; }
.page-link, .page-current, .page-dots { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:8px 13px; border-radius:13px; border:1px solid var(--border); background:var(--card); color:var(--text); font-weight:900; }
.page-link.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.page-link.disabled { opacity:.45; pointer-events:none; }
.page-dots { color:var(--muted); background:transparent; border-color:transparent; padding:8px 4px; }
@media (max-width: 720px) { .pagination { justify-content:center; } .page-link, .page-current { flex:1 1 auto; } }
