:root {
  --bg: #0f1117;
  --bg2: #1a1d2e;
  --bg3: #242840;
  --surface: #1e2235;
  --border: #2e3250;
  --text: #e8eaf6;
  --text2: #9195b0;
  --accent: #6c72ff;
  --accent2: #9d68ff;
  --green: #4caf7d;
  --yellow: #f5c842;
  --red: #ff6b6b;
  --orange: #ff9f43;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* Navbar */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-link { color: var(--text2); text-decoration: none; font-size: 0.9rem; transition: color 0.15s; }
.nav-link:hover { color: var(--text); }
.nav-user { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.nav-logout { color: var(--red) !important; }

.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.stat-pill {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text2);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.stat-pill:hover, .stat-pill.active {
  border-color: var(--accent);
  color: var(--text);
}
.stat-pill .count { font-weight: 700; color: var(--text); margin-left: 4px; }

/* ── Filter panel ── */
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.filter-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}
.filter-search {
  flex: 1;
  min-width: 180px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.filter-search:focus { border-color: var(--accent); }

/* Type chips row */
.filter-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.type-filter-chip {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.type-filter-chip:hover { border-color: var(--accent); color: var(--text); }
.type-filter-chip.active {
  border-color: var(--accent);
  background: rgba(108,114,255,0.15);
  color: var(--accent);
}

/* Genre + year row */
.filter-row-extra { flex-wrap: wrap; }
.filter-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0 2rem 0 0.75rem;
  height: 38px;
  line-height: 38px;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
  min-width: 160px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
}
.filter-select:focus { border-color: var(--accent); }
.filter-year-range {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.filter-year {
  width: 120px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0;
  height: 38px;
  line-height: 38px;
  text-indent: 0.75rem;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}
.filter-year:focus { border-color: var(--accent); }
.filter-year::-webkit-outer-spin-button,
.filter-year::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.year-sep { color: var(--text2); font-size: 0.85rem; }

/* Media grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.2rem;
}
.media-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.media-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.media-card .poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text2);
}
.media-card .poster img { width: 100%; height: 100%; object-fit: cover; }
.media-card .card-body { padding: 0.75rem; flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.media-card .card-title { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.media-card .card-spacer { flex: 1; }
.media-card .card-meta { font-size: 0.78rem; color: var(--text2); }

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-planned   { background: rgba(108,114,255,0.15); color: var(--accent); }
.badge-watching  { background: rgba(245,200,66,0.15);  color: var(--yellow); }
.badge-completed { background: rgba(76,175,125,0.15);  color: var(--green); }
.badge-dropped   { background: rgba(255,107,107,0.15); color: var(--red); }

/* Rating stars display */
.rating { color: var(--yellow); font-size: 0.85rem; }

/* Detail page */
.detail-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: start;
}
.detail-poster {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 2/3;
  object-fit: cover;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: var(--text2);
  overflow: hidden;
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.25rem; }
.detail-original { color: var(--text2); font-size: 0.95rem; margin-bottom: 0.75rem; }
.detail-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.overview { color: var(--text2); line-height: 1.7; margin: 1rem 0; font-size: 0.95rem; }
.genres { font-size: 0.85rem; color: var(--text2); }

/* Links list */
.links-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin: 0.75rem 0; }
.links-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}
.links-list a { color: var(--accent); text-decoration: none; flex: 1; }
.links-list a:hover { text-decoration: underline; }

/* Episode grid */
.episode-grid-section { margin-top: 2rem; }
.season-block { margin-bottom: 1.5rem; }
.season-block { margin-bottom: 1.5rem; }
.ep-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.ep-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}
.ep-btn.watched {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.ep-btn:hover { border-color: var(--accent); }

/* Not-yet-aired episodes */
.ep-btn.not-aired {
  opacity: 0.4;
  cursor: not-allowed;
  border-style: dashed;
  border-color: var(--text2);
  background: repeating-linear-gradient(
    45deg,
    var(--bg2),
    var(--bg2) 4px,
    var(--bg3) 4px,
    var(--bg3) 8px
  );
  color: var(--text2);
  font-size: 0.6rem;
}
.ep-btn.not-aired:hover {
  opacity: 0.4;
  background: repeating-linear-gradient(
    45deg,
    var(--bg2),
    var(--bg2) 4px,
    var(--bg3) 4px,
    var(--bg3) 8px
  );
  color: var(--text2);
}

/* New episodes badge on poster */
.new-eps-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #9d68ff, #7a4fd6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.5rem;
  text-align: center;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.4);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* New episodes badge on collection card */
.card-new-eps {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #9d68ff, #7a4fd6);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.3rem;
  text-align: center;
  letter-spacing: 0.02em;
  border-radius: 0 0 6px 6px;
}

/* Forms */
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: 0.85rem; color: var(--text2); margin-bottom: 0.4rem; font-weight: 500; }
.form-control {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.form-control:focus { border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-danger  { background: var(--red);    color: #fff; }
.btn-ghost   { background: transparent; border: 1px solid var(--border); color: var(--text); }

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-title { font-size: 1rem; font-weight: 700; }

/* TMDB search */
.tmdb-search-box { position: relative; }
.tmdb-results {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.tmdb-result-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.tmdb-result-card:hover { border-color: var(--accent); }
.tmdb-result-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--bg3); }
.tmdb-result-body { padding: 0.5rem 0.6rem; }
.tmdb-result-body .t { font-size: 0.8rem; font-weight: 600; margin-bottom: 2px; }
.tmdb-result-body .m { font-size: 0.72rem; color: var(--text2); }

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-box {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
}
.login-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.3rem; }
.login-sub { color: var(--text2); font-size: 0.85rem; margin-bottom: 1.75rem; }
.error-msg { background: rgba(255,107,107,0.12); border: 1px solid rgba(255,107,107,0.3); color: var(--red); border-radius: 8px; padding: 0.6rem 0.9rem; font-size: 0.85rem; margin-bottom: 1rem; }

/* Admin table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 0.6rem 1rem; font-size: 0.8rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.table td { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(46,50,80,0.5); font-size: 0.9rem; }
.table tr:last-child td { border-bottom: none; }

/* Misc */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text2); }
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.page-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.5rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

@media (max-width: 640px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-poster { max-width: 200px; }
  .form-row { grid-template-columns: 1fr; }
  .navbar { padding: 0 1rem; }
  .container { padding: 1rem; }
}

/* Quick status switcher */
.status-switcher {
  position: relative;
  display: inline-block;
}
.status-switcher .badge {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s, transform 0.1s;
}
.status-switcher .badge:hover {
  opacity: 0.8;
  transform: scale(1.05);
}
.status-switcher .badge::after {
  content: ' ▾';
  font-size: 0.65em;
  opacity: 0.7;
}
.status-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem;
  min-width: 160px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  flex-direction: column;
  gap: 0.25rem;
}
.status-dropdown.open { display: flex; }
.status-dropdown button {
  background: none;
  border: none;
  color: var(--text);
  padding: 0.45rem 0.75rem;
  border-radius: 7px;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.1s;
  font-family: inherit;
}
.status-dropdown button:hover { background: var(--bg2); }
.status-dropdown button.current { background: var(--bg2); font-weight: 600; }
.status-dropdown .dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.dot-planned   { background: var(--accent); }
.dot-watching  { background: var(--yellow); }
.dot-completed { background: var(--green); }
.dot-dropped   { background: var(--red); }

/* ── Card wrap + footer ── */
.media-card-wrap {
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.media-card-wrap:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
/* Remove individual card border/shadow since wrap handles it */
.media-card-wrap .media-card {
  flex: 1;
  border: none;
  border-radius: 0;
  background: transparent;
  transition: none;
}
.media-card-wrap .media-card:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}
.card-footer {
  padding: 0.4rem 0.5rem;
  background: var(--bg3);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-divider {
  height: 1px;
  background: var(--border);
  margin: 0 -0.5rem;
}
.status-select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239195b0'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.5rem;
}
.status-select:focus { border-color: var(--accent); }
.status-select.status-planned   { border-color: rgba(108,114,255,0.4); color: var(--accent); }
.status-select.status-watching  { border-color: rgba(245,200,66,0.4);  color: var(--yellow); }
.status-select.status-completed { border-color: rgba(76,175,125,0.4);  color: var(--green); }
.status-select.status-dropped   { border-color: rgba(255,107,107,0.4); color: var(--red); }

/* ── Status pill buttons on detail page ── */
.detail-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.status-pill-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.status-pill-btn:hover { border-color: var(--accent); color: var(--text); }
.status-pill-btn.active-planned   { background: rgba(108,114,255,0.15); border-color: var(--accent);  color: var(--accent); }
.status-pill-btn.active-watching  { background: rgba(245,200,66,0.15);  border-color: var(--yellow);  color: var(--yellow); }
.status-pill-btn.active-completed { background: rgba(76,175,125,0.15);  border-color: var(--green);   color: var(--green); }
.status-pill-btn.active-dropped   { background: rgba(255,107,107,0.15); border-color: var(--red);     color: var(--red); }

/* ── Star rating widget ── */
.star-form { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }

.stars {
  display: flex;
  gap: 1px;
  cursor: pointer;
  user-select: none;
}
.star {
  font-size: 1rem;
  color: var(--border);
  transition: color 0.1s, transform 0.1s;
  line-height: 1;
}
.star.lit        { color: var(--yellow); }
.star.hovered    { color: var(--yellow); transform: scale(1.2); }
.star:hover      { transform: scale(1.2); }

/* larger variant for detail page */
.stars-lg .star  { font-size: 1.35rem; }

.rating-label {
  font-size: 0.75rem;
  color: var(--text2);
  white-space: nowrap;
}

/* Stars inside card footer */
.card-footer .star-form { flex-direction: row; align-items: center; gap: 0.4rem; justify-content: center; }
.card-footer .stars { gap: 0; }
.card-footer .star  { font-size: 0.88rem; }

/* ── Type chip on cards ── */
.type-chip {
  font-size: 0.72rem;
  color: var(--text2);
}

/* ── Season structure editor ── */
.season-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ── Season title row with progress and bulk button ── */
.season-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.season-title { font-size: 0.95rem; font-weight: 600; color: var(--text2); }
.season-progress { font-size: 0.78rem; color: var(--text2); background: var(--bg3); border-radius: 10px; padding: 0.1rem 0.5rem; }

/* ── Bulk mark panel ── */
.bulk-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.6rem;
}

/* ── Episode progress bar on cards ── */
.card-progress {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 0.4rem;
  overflow: hidden;
}
.card-progress-bar {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.3s;
}
.card-progress-label {
  font-size: 0.72rem;
  color: var(--text2);
  margin-top: 0.2rem;
}

/* ── Add-entry card in grid ── */
.media-card-add {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 34, 53, 0.5);
  border: 1.5px dashed rgba(46, 50, 80, 0.7);
  border-radius: var(--radius);
  text-decoration: none;
  color: rgba(145, 149, 176, 0.5);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  min-height: 280px;     /* approximate height of a card with footer */
}
.media-card-add:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(108, 114, 255, 0.05);
}
.add-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.add-card-icon {
  font-size: 2rem;
  line-height: 1;
  font-weight: 300;
}
.add-card-label {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── Reset progress — danger button ── */
.btn-reset-progress {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.08);
  color: var(--red);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn-reset-progress:hover {
  background: rgba(255, 107, 107, 0.18);
  border-color: var(--red);
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.3);
}
.btn-reset-progress:active {
  background: rgba(255, 107, 107, 0.3);
}

/* ── Login logo ── */
.login-title {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.login-title svg {
  width: 120px;
  height: 120px;
}

/* ── Navbar logo ── */
.nav-logo-img {
  width: 32px;
  height: 32px;
  display: block;
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 0.5rem;
  filter: drop-shadow(0 0 6px rgba(157, 104, 255, 0.5));
}

/* ── Related entries on detail page ── */
.related-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.related-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.related-item:hover { border-color: var(--accent); }
.related-poster {
  width: 36px;
  height: 52px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.related-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  font-size: 1.2rem;
}
.related-info { display: flex; flex-direction: column; gap: 0.15rem; }
.related-title { font-size: 0.9rem; font-weight: 600; }
.related-meta  { font-size: 0.78rem; color: var(--text2); }

/* ── Link search dropdown in edit form ── */
.link-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 50;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.link-search-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 0.1s;
}
.link-search-item:hover { background: var(--bg3); }
.lsi-title { flex: 1; }
.lsi-meta  { font-size: 0.78rem; color: var(--text2); white-space: nowrap; }



/* ── Login error variants ── */
.error-msg-locked {
  background: rgba(255, 159, 67, 0.12);
  border-color: rgba(255, 159, 67, 0.4);
  color: var(--orange);
}
.error-msg-inactive {
  background: rgba(108, 114, 255, 0.1);
  border-color: rgba(108, 114, 255, 0.35);
  color: var(--accent);
}

/* ── Admin users page ── */
.admin-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-header .page-title { text-align: center; }

.admin-create-card { animation: slideDown 0.15s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.admin-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
  align-items: start;
}

.admin-user-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color 0.15s;
}
.admin-user-card:hover { border-color: rgba(108,114,255,0.3); }
.admin-user-card--dim { opacity: 0.7; }

.admin-user-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.admin-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-weight: 700; font-size: 0.95rem; }
.admin-user-meta { font-size: 0.78rem; color: var(--text2); margin-top: 1px; }
.admin-user-badges { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

.admin-status { font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.admin-status--active  { color: var(--green); }
.admin-status--locked  { color: var(--orange); }
.admin-status--inactive { color: var(--red); }

/* Attempts dots */
.admin-attempts-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,107,107,0.06);
  border: 1px solid rgba(255,107,107,0.15);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
}
.attempts-dots { display: flex; gap: 4px; }
.attempt-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
}
.attempt-dot--filled { background: var(--red); }

/* Action buttons */
.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}
.admin-action-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.admin-action-btn:hover { border-color: var(--accent); color: var(--text); }
.admin-action-btn--ok   { color: var(--green); border-color: rgba(76,175,125,0.4); }
.admin-action-btn--ok:hover { background: rgba(76,175,125,0.1); border-color: var(--green); }
.admin-action-btn--warn { color: var(--orange); border-color: rgba(255,159,67,0.4); }
.admin-action-btn--warn:hover { background: rgba(255,159,67,0.1); border-color: var(--orange); }
.admin-action-btn--danger { color: var(--red); border-color: rgba(255,107,107,0.4); }
.admin-action-btn--danger:hover { background: rgba(255,107,107,0.1); border-color: var(--red); }

.admin-reset-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  width: 100%;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border);
  margin-top: 0.1rem;
  animation: slideDown 0.1s ease;
}

/* Checkbox style */
.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
  color: var(--text);
}
.admin-checkbox input[type=checkbox] { display: none; }
.admin-checkbox-box {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.admin-checkbox input:checked + .admin-checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}
.admin-checkbox input:checked + .admin-checkbox-box::after {
  content: '';
  width: 4px; height: 7px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
  display: block;
}

/* ── Admin dropdown in navbar ── */
.nav-admin-wrap {
  position: relative;
}
.nav-admin-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;        /* match .nav-link */
  color: var(--text2);
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s;
  line-height: 1;
}
.nav-admin-btn:hover { color: var(--text); }
.nav-admin-arrow {
  font-size: 0.6rem;
  transition: transform 0.2s;
  display: inline-block;
  opacity: 0.6;
}
.nav-admin-wrap:has(.nav-admin-menu.open) .nav-admin-arrow { transform: rotate(180deg); }

.nav-admin-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  min-width: 180px;
  overflow: hidden;
  display: none;
  z-index: 200;
}
.nav-admin-menu.open { display: block; animation: fadeInDown 0.12s ease; }

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-admin-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.9rem;
  color: var(--text2);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.1s, color 0.1s;
}
.nav-admin-item:hover { background: var(--bg3); color: var(--text); }
.nav-admin-icon { font-size: 0.9rem; width: 1.1rem; text-align: center; opacity: 0.8; }

/* ── Admin sections grid (index page) ── */
.admin-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}
.admin-section-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.admin-section-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.admin-section-icon { font-size: 2rem; flex-shrink: 0; }
.admin-section-body { flex: 1; }
.admin-section-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.2rem; }
.admin-section-desc  { font-size: 0.82rem; color: var(--text2); line-height: 1.4; }
.admin-section-arrow { font-size: 1.2rem; color: var(--text2); transition: transform 0.15s; }
.admin-section-card:hover .admin-section-arrow { transform: translateX(4px); color: var(--accent); }

/* ── Lockout info block ── */
.admin-lock-info {
  background: rgba(255,159,67,0.07);
  border: 1px solid rgba(255,159,67,0.2);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.admin-lock-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  align-items: baseline;
}
.admin-lock-label { color: var(--text2); white-space: nowrap; }
.admin-lock-value { color: var(--text); }

/* Remove old dropdown CSS leftovers */
.nav-admin-wrap, .nav-admin-btn, .nav-admin-arrow,
.nav-admin-menu, .nav-admin-item, .nav-admin-icon { all: unset; }

/* ── Season rating stars ── */
.season-stars {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-left: auto;
}
.season-star {
  font-size: 1rem;
  color: var(--border);
  cursor: pointer;
  transition: color 0.1s, transform 0.1s;
  line-height: 1;
}
.season-star:hover,
.season-stars:hover .season-star {
  color: var(--yellow);
  transform: scale(1.15);
}
.season-stars:hover .season-star:hover ~ .season-star {
  color: var(--border);
  transform: none;
}
.season-star.active { color: var(--yellow); }
.season-rating-val {
  font-size: 0.78rem;
  color: var(--text2);
  margin-left: 0.35rem;
  white-space: nowrap;
  min-width: 2.5rem;
}

/* ── Search library badge ── */
.lib-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.3rem;
}
.result-in-library {
  border: 1px solid rgba(108,114,255,0.4);
  background: rgba(108,114,255,0.06);
}
