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

:root {
  --bg-primary: #07071a;
  --bg-secondary: #0d0d2b;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(99, 102, 241, 0.08);
  --border: rgba(99, 102, 241, 0.2);
  --border-hover: rgba(99, 102, 241, 0.5);
  --indigo: #6366f1;
  --indigo-light: #818cf8;
  --purple: #a855f7;
  --purple-light: #c084fc;
  --gradient: linear-gradient(135deg, #6366f1, #a855f7);
  --gradient-glow: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(168,85,247,0.3));
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(99,102,241,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(168,85,247,0.06) 0%, transparent 50%);
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--indigo); border-radius: 3px; }

/* ─── NAVBAR ─── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 7, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.4rem; font-weight: 800;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-decoration: none;
}
.navbar-brand .logo-icon { font-size: 1.6rem; -webkit-text-fill-color: initial; }
.navbar-right { display: flex; align-items: center; gap: 1rem; }
.nav-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; color: var(--text-muted);
}
.nav-user .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: white;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.2s ease; text-decoration: none;
}
.btn-primary {
  background: var(--gradient); color: white;
  box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(99,102,241,0.5); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--indigo); color: var(--indigo); background: rgba(99,102,241,0.05); }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; }

/* ─── GLASS CARD ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-glow); }

/* ─── FORMS ─── */
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.95rem; font-family: 'Inter', sans-serif;
  transition: all 0.2s ease; outline: none;
}
.form-control:focus { border-color: var(--indigo); background: rgba(99,102,241,0.05); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control option { background: #1a1a3e; }

/* ─── BADGES ─── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
}
.badge-pending { background: rgba(245,158,11,0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.badge-available { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.badge-rejected { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.badge-movie { background: rgba(99,102,241,0.15); color: var(--indigo-light); border: 1px solid rgba(99,102,241,0.3); }
.badge-tv { background: rgba(168,85,247,0.15); color: var(--purple-light); border: 1px solid rgba(168,85,247,0.3); }
.badge-on-jellyfin { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }

/* ─── LOGIN PAGE ─── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 30% 40%, rgba(99,102,241,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(168,85,247,0.1) 0%, transparent 60%);
}
.login-box {
  width: 100%; max-width: 420px;
  background: rgba(13,13,43,0.8);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  backdrop-filter: blur(30px);
  box-shadow: var(--shadow), var(--shadow-glow);
}
.login-logo {
  text-align: center; margin-bottom: 2rem;
}
.login-logo h1 {
  font-size: 2rem; font-weight: 800;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-logo p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }
.login-box .btn-primary { width: 100%; padding: 13px; font-size: 1rem; margin-top: 0.5rem; }
.login-error {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger); border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.875rem; margin-top: 1rem; display: none;
}
.login-error.show { display: block; }

/* ─── MAIN LAYOUT ─── */
.page-container { max-width: 1400px; margin: 0 auto; padding: 2rem; }

/* ─── HERO SEARCH ─── */
.hero-search {
  text-align: center;
  padding: 3rem 2rem 2rem;
  margin-bottom: 2rem;
}
.hero-search h1 {
  font-size: 2.2rem; font-weight: 800; margin-bottom: 0.5rem;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-search p { color: var(--text-muted); margin-bottom: 2rem; font-size: 1rem; }
.search-container { position: relative; max-width: 600px; margin: 0 auto; }
.search-input-wrap { position: relative; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; color: var(--text-dim); pointer-events: none; }
.search-input {
  width: 100%; padding: 16px 16px 16px 48px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 50px; color: var(--text);
  font-size: 1rem; font-family: 'Inter', sans-serif;
  outline: none; transition: all 0.3s ease;
}
.search-input:focus { border-color: var(--indigo); background: rgba(99,102,241,0.06); box-shadow: 0 0 0 4px rgba(99,102,241,0.1), var(--shadow-glow); }
.search-input::placeholder { color: var(--text-dim); }
.search-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: rgba(13,13,43,0.97); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(20px);
  box-shadow: var(--shadow); z-index: 50; display: none; overflow: hidden;
}
.search-dropdown.show { display: block; }
.search-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer; transition: background 0.15s ease;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: rgba(99,102,241,0.1); }
.search-item img { width: 40px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--bg-secondary); }
.search-item .no-poster { width: 40px; height: 56px; border-radius: 6px; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.search-item-info { flex: 1; min-width: 0; }
.search-item-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.search-loading { padding: 16px; text-align: center; color: var(--text-dim); font-size: 0.9rem; }

/* ─── SELECTED MOVIE PREVIEW ─── */
.selected-preview {
  max-width: 700px; margin: 1.5rem auto;
  display: none;
}
.selected-preview.show { display: block; }
.preview-card {
  background: rgba(13,13,43,0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; backdrop-filter: blur(20px);
}
.preview-backdrop {
  height: 120px; object-fit: cover; width: 100%;
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(168,85,247,0.2));
}
.preview-body { padding: 1.5rem; display: flex; gap: 1.2rem; }
.preview-poster { width: 80px; height: 120px; object-fit: cover; border-radius: 10px; flex-shrink: 0; background: var(--bg-secondary); }
.preview-info { flex: 1; }
.preview-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.preview-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.preview-overview { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.preview-actions { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ─── JELLYFIN CHECK ─── */
.jellyfin-notice {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 20px;
  font-size: 0.875rem; font-weight: 600;
}
.jellyfin-notice.found { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.jellyfin-notice.not-found { background: rgba(99,102,241,0.1); color: var(--indigo-light); border: 1px solid var(--border); }
.jellyfin-notice.checking { color: var(--text-dim); }

/* ─── SUGGESTIONS GRID ─── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-title { font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-title .count {
  background: var(--gradient); color: white;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
}

.filter-tabs { display: flex; gap: 6px; }
.filter-tab {
  padding: 6px 16px; border-radius: 20px;
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  transition: all 0.2s ease;
}
.filter-tab.active { background: var(--gradient); color: white; border-color: transparent; }
.filter-tab:hover:not(.active) { border-color: var(--indigo); color: var(--indigo); }

.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}

.suggestion-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: default;
}
.suggestion-card:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: var(--shadow-glow), var(--shadow); }

.suggestion-poster-wrap { position: relative; aspect-ratio: 2/3; background: var(--bg-secondary); overflow: hidden; }
.suggestion-poster { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.suggestion-card:hover .suggestion-poster { transform: scale(1.05); }
.poster-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.poster-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(7,7,26,0.95) 0%, rgba(7,7,26,0.3) 50%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 12px;
}
.card-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 4px; }

.suggestion-body { padding: 14px; }
.suggestion-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.suggestion-meta .dot { opacity: 0.4; }
.suggestion-by { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }
.suggestion-by .mini-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gradient); display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: white; flex-shrink: 0;
}

.vote-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.vote-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  transition: all 0.2s ease;
}
.vote-btn:hover, .vote-btn.active-up { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.4); color: var(--success); }
.vote-btn.active-down { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.4); color: var(--danger); }
.vote-btn.active-down:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.4); color: var(--danger); }

.delete-btn {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--text-dim); padding: 4px; border-radius: 6px; transition: all 0.2s;
  font-size: 0.9rem;
}
.delete-btn:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

/* ─── EMPTY STATE ─── */
.empty-state {
  grid-column: 1/-1; text-align: center; padding: 4rem 2rem;
}
.empty-state .icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-muted); }
.empty-state p { color: var(--text-dim); font-size: 0.9rem; }

/* ─── TOAST ─── */
#toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500;
  backdrop-filter: blur(20px); box-shadow: var(--shadow);
  animation: slideIn 0.3s ease; min-width: 280px;
  border: 1px solid;
}
.toast-success { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3); color: var(--success); }
.toast-error { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); color: var(--danger); }
.toast-info { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3); color: var(--indigo-light); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(20px); } }

/* ─── ADMIN PAGE ─── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }
.admin-sidebar {
  background: rgba(13,13,43,0.5); border-right: 1px solid var(--border);
  padding: 1.5rem 0;
}
.sidebar-section { padding: 0 1rem; margin-bottom: 0.5rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 1.5rem; cursor: pointer;
  color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
  transition: all 0.2s ease; text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar-item:hover { color: var(--text); background: rgba(99,102,241,0.05); }
.sidebar-item.active { color: var(--indigo-light); background: rgba(99,102,241,0.08); border-left-color: var(--indigo); }
.admin-content { padding: 2rem; overflow-y: auto; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 14px; text-align: left; font-size: 0.78rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 14px; font-size: 0.88rem; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.data-table tr:hover td { background: rgba(99,102,241,0.04); }

.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; display: none;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #0d0d2b; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 440px;
  box-shadow: var(--shadow);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; padding: 4px; border-radius: 6px; }
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }

/* ─── LOADER ─── */
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--indigo); border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── ADMIN NOTE ─── */
.admin-note {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--warning);
  margin-bottom: 8px;
  line-height: 1.4;
}

/* ─── SORT SELECT ─── */
.sort-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}
.sort-select:focus { border-color: var(--indigo); }
.sort-select option { background: #1a1a3e; }

/* ─── COMMENTS ─── */
.comment-btn { color: var(--indigo-light); border-color: rgba(99,102,241,0.3); }
.comment-btn:hover { background: rgba(99,102,241,0.1); border-color: var(--indigo); color: var(--indigo); }

.comment-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.comment-item:last-child { border-bottom: none; }
.comment-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.comment-header strong { font-size: 0.85rem; color: var(--text); }
.comment-date { font-size: 0.75rem; color: var(--text-dim); margin-left: 2px; }
.comment-content {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding-left: 30px;
}

/* ─── ADMIN NOTE EDIT (admin page) ─── */
.admin-note-input {
  width: 100%; padding: 6px 10px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}
.admin-note-input:focus { border-color: var(--warning); }

/* ─── RESPONSIVE ─── */

/* Tablet */
@media (max-width: 900px) {
  .suggestions-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* Mobile */
@media (max-width: 640px) {

  /* ── Navbar ── */
  .navbar {
    padding: 0 0.75rem;
    height: 56px;
    gap: 0.5rem;
  }
  .navbar-brand {
    font-size: 1.1rem;
    gap: 6px;
    flex-shrink: 0;
  }
  .navbar-brand img { height: 26px !important; }
  .navbar-right { gap: 0.4rem; }
  /* Hide username text, keep avatar */
  #nav-username { display: none; }
  .nav-user { gap: 0; }
  .nav-user .avatar { width: 30px; height: 30px; font-size: 0.75rem; }
  /* Shrink buttons */
  .navbar-right .btn { padding: 6px 10px; font-size: 0.75rem; }
  /* Hide "Admin" label, keep icon */
  #admin-link { padding: 6px 8px; }

  /* ── Page padding ── */
  .page-container { padding: 0.75rem; }

  /* ── Hero search ── */
  .hero-search { padding: 1.5rem 0.75rem 1rem; margin-bottom: 1rem; }
  .hero-search h1 { font-size: 1.35rem; margin-bottom: 0.4rem; }
  .hero-search p { font-size: 0.85rem; margin-bottom: 1.2rem; }
  .search-input { padding: 13px 13px 13px 42px; font-size: 0.9rem; }

  /* ── Preview card ── */
  .preview-body { flex-direction: column; gap: 0.8rem; padding: 1rem; }
  .preview-poster { width: 60px; height: 90px; }
  .preview-title { font-size: 1rem; }
  .preview-actions { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 8px; }

  /* ── Section header: stack on mobile ── */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .section-title { font-size: 1.1rem; }

  /* ── Filter tabs: horizontal scroll ── */
  .filter-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    width: 100%;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab {
    flex-shrink: 0;
    padding: 5px 14px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* ── Suggestions grid: 2 columns on phone ── */
  .suggestions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .suggestion-body { padding: 10px; }
  .suggestion-title { font-size: 0.85rem; }
  .suggestion-meta { font-size: 0.72rem; }
  .suggestion-by { font-size: 0.72rem; }
  .vote-btn { padding: 5px 8px; font-size: 0.72rem; }

  /* ── Toast ── */
  #toast-container { bottom: 1rem; right: 0.75rem; left: 0.75rem; }
  .toast { min-width: unset; width: 100%; font-size: 0.85rem; }

  /* ── Login ── */
  .login-box { padding: 1.75rem 1.25rem; border-radius: 18px; }
  .login-logo h1 { font-size: 1.6rem; }

  /* ── Admin sidebar → tab bar ── */
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    display: flex;
    overflow-x: auto;
    padding: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    background: rgba(7,7,26,0.95);
    scrollbar-width: none;
  }
  .admin-sidebar::-webkit-scrollbar { display: none; }
  .sidebar-section { display: none; }
  .sidebar-item {
    flex-direction: column;
    gap: 3px;
    padding: 10px 16px;
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    font-size: 0.75rem;
    flex-shrink: 0;
  }
  .sidebar-item.active { border-left: none; border-bottom-color: var(--indigo); background: rgba(99,102,241,0.06); }

  /* ── Admin content ── */
  .admin-content { padding: 1rem; }
  .admin-title { font-size: 1.2rem; margin-bottom: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
  .stat-value { font-size: 1.6rem; }

  /* ── Data table: scrollable ── */
  .card { overflow-x: auto; }

  /* ── Modal ── */
  .modal-overlay { padding: 1rem; align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; max-height: 90vh; overflow-y: auto; }
}

/* Very small phones */
@media (max-width: 380px) {
  .suggestions-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .navbar-brand { font-size: 1rem; }
}
