/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0f;
  --bg-1:      #111118;
  --bg-2:      #18181f;
  --bg-3:      #1e1e28;
  --border:    #2a2a38;
  --border-2:  #3a3a50;
  --text:      #e8e8f0;
  --text-2:    #9898b0;
  --text-3:    #5a5a78;
  --accent:    #6c63ff;
  --accent-2:  #8b85ff;
  --accent-dim:#6c63ff22;
  --green:     #22d3a0;
  --green-dim: #22d3a020;
  --red:       #ff5572;
  --red-dim:   #ff557220;
  --yellow:    #ffd166;
  --yellow-dim:#ffd16620;
  --blue:      #38bdf8;
  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 8px 32px rgba(0,0,0,0.5);
  --font:      'Inter', system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ─── Scrollbar ──────────────────────────────────────────────────────────────*/
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ─── Typography ─────────────────────────────────────────────────────────────*/
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1rem; font-weight: 600; }

/* ─── Layout ─────────────────────────────────────────────────────────────────*/
.page { display: none; }
.page.active { display: flex; flex-direction: column; min-height: 100vh; }

/* ─── Login Page ─────────────────────────────────────────────────────────────*/
#login-page {
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 360px;
  padding: 40px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.login-logo span {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.login-card h2 {
  margin-bottom: 6px;
  font-size: 1.3rem;
}

.login-card p {
  color: var(--text-2);
  margin-bottom: 28px;
  font-size: 0.875rem;
}

.login-error {
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.875rem;
  display: none;
}

.login-error.show { display: block; }

/* ─── Forms ──────────────────────────────────────────────────────────────────*/
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

input, textarea, select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: var(--bg-3);
}

input::placeholder, textarea::placeholder { color: var(--text-3); }

select option { background: var(--bg-2); }

textarea { resize: vertical; min-height: 80px; }

/* ─── Buttons ────────────────────────────────────────────────────────────────*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-2); background: var(--bg-2); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
  padding: 7px 12px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-2); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid transparent;
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-success {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid transparent;
}
.btn-success:hover { background: var(--green); color: #000; }

.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon { padding: 7px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ─── Navbar ─────────────────────────────────────────────────────────────────*/
.navbar {
  height: 56px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-right: 8px;
}

.navbar-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
}

.nav-link:hover { color: var(--text); background: var(--bg-2); }
.nav-link.active { color: var(--text); background: var(--bg-3); }

.navbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-2);
}

.user-avatar {
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.badge-admin {
  padding: 2px 7px;
  background: var(--accent-dim);
  color: var(--accent-2);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Main Content ───────────────────────────────────────────────────────────*/
.main { flex: 1; padding: 28px 32px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ─── Page Header ────────────────────────────────────────────────────────────*/
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header-left h1 { font-size: 1.4rem; }
.page-header-left p { color: var(--text-2); font-size: 0.875rem; margin-top: 2px; }

/* ─── Filter Bar ─────────────────────────────────────────────────────────────*/
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.search-wrap input {
  padding-left: 38px;
}

.filter-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-filter {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-2);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}

.tag-filter:hover { border-color: var(--border-2); color: var(--text); }
.tag-filter.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent-2); }

.filter-sort select {
  width: auto;
  padding: 7px 12px;
}

/* ─── Release Grid ───────────────────────────────────────────────────────────*/
.releases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.release-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.release-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s;
}

.release-card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.release-card:hover::before { opacity: 1; }

.release-card.draft { border-style: dashed; opacity: 0.7; }

.release-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.release-version {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--accent-2);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.release-date {
  font-size: 0.75rem;
  color: var(--text-3);
}

.release-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.release-desc {
  font-size: 0.85rem;
  color: var(--text-2);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.release-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tag-list {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tag-stable  { background: var(--green-dim); color: var(--green); }
.tag-beta    { background: var(--yellow-dim); color: var(--yellow); }
.tag-hotfix  { background: var(--red-dim); color: var(--red); }
.tag-feature { background: var(--accent-dim); color: var(--accent-2); }
.tag-security{ background: #ff9f4320; color: #ff9f43; }
.tag-default { background: var(--bg-3); color: var(--text-2); }

.release-files-count {
  font-size: 0.75rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-3);
}

.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 0.9rem; }

/* ─── Modal ──────────────────────────────────────────────────────────────────*/
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-header h2 { font-size: 1.1rem; }

.modal-body { padding: 20px 24px; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ─── Release Detail Modal ───────────────────────────────────────────────────*/
.release-detail-version {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--accent-2);
}

.release-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.release-detail-desc {
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 16px 0;
}

.files-section h3 {
  font-size: 0.85rem;
  color: var(--text-2);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

.file-tree { border-radius: var(--radius-sm); overflow: hidden; }

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.file-item:last-child { border-bottom: none; }
.file-item:hover { background: var(--bg-3); }

.file-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.file-icon { font-size: 16px; flex-shrink: 0; }

.file-name {
  font-size: 0.85rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

.file-path-hint {
  font-size: 0.72rem;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 0.75rem;
  color: var(--text-3);
  flex-shrink: 0;
  margin-left: 16px;
  font-family: monospace;
}

/* ─── Admin Page ─────────────────────────────────────────────────────────────*/
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 700px) { .admin-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 { font-size: 0.95rem; }
.card-body { padding: 20px; }

.release-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  transition: background 0.1s;
}

.release-list-item:last-child { border-bottom: none; }
.release-list-item:hover { background: var(--bg-2); }

.release-list-item-info { flex: 1; min-width: 0; }
.release-list-item-info .title {
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.release-list-item-info .meta { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }

.release-list-actions { display: flex; gap: 6px; flex-shrink: 0; }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.status-dot.published { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.draft { background: var(--text-3); }

/* ─── Tags Manager ───────────────────────────────────────────────────────────*/
.tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag-manage {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  font-size: 0.8rem;
  color: var(--text-2);
}

.tag-manage button {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--bg-3);
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  padding: 0;
  line-height: 1;
  transition: all 0.1s;
}

.tag-manage button:hover { background: var(--red); color: #fff; }

.add-tag-row {
  display: flex;
  gap: 8px;
}

.add-tag-row input { flex: 1; }

/* ─── Users Manager ──────────────────────────────────────────────────────────*/
.user-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.user-list-item:last-child { border-bottom: none; }
.user-list-item:hover { background: var(--bg-2); }

.user-list-item .user-avatar { flex-shrink: 0; }
.user-list-item-info { flex: 1; }
.user-list-item-info .name { font-size: 0.9rem; font-weight: 500; }
.user-list-item-info .role { font-size: 0.75rem; color: var(--text-3); }

/* ─── Upload Zone ────────────────────────────────────────────────────────────*/
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-3);
  font-size: 0.875rem;
}

.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); color: var(--text-2); background: var(--accent-dim); }
.upload-zone svg { margin-bottom: 8px; }

/* ─── Tag Multi-select ───────────────────────────────────────────────────────*/
.tag-select-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 42px;
  cursor: pointer;
}

.tag-select-wrap:focus-within { border-color: var(--accent); }

.tag-option {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all 0.1s;
  user-select: none;
}

.tag-option:hover { border-color: var(--border-2); color: var(--text); }
.tag-option.selected { background: var(--accent-dim); border-color: var(--accent); color: var(--accent-2); }

/* ─── Upload Progress ────────────────────────────────────────────────────────*/
.upload-file-list {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.upload-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  gap: 10px;
}

.upload-file-row:last-child { border-bottom: none; }
.upload-file-row .name { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; }
.upload-file-row .size { color: var(--text-3); flex-shrink: 0; }

.upload-progress-wrap {
  margin-top: 16px;
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.upload-progress-pct { font-weight: 600; color: var(--accent-2); }
.upload-progress-speed { color: var(--text-3); }

.upload-progress-bar {
  height: 5px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 3px;
  width: 0%;
  transition: width 0.15s ease;
}

.upload-progress-sub {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-3);
}

/* ─── Toggle ─────────────────────────────────────────────────────────────────*/
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.toggle-row label { font-size: 0.875rem; color: var(--text-2); cursor: pointer; }

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
  border-radius: 20px;
  transition: 0.2s;
  border: 1px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--text-3);
  border-radius: 50%;
  left: 2px;
  top: 2px;
  transition: 0.2s;
}

.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); background: #fff; }

/* ─── Divider ────────────────────────────────────────────────────────────────*/
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ─── Loader ─────────────────────────────────────────────────────────────────*/
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-3);
}

.spin {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ──────────────────────────────────────────────────────────────────*/
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast-success { background: var(--bg-3); border: 1px solid var(--green); color: var(--text); }
.toast-error   { background: var(--bg-3); border: 1px solid var(--red);   color: var(--text); }
.toast-info    { background: var(--bg-3); border: 1px solid var(--accent); color: var(--text); }

/* ─── Stats Bar ──────────────────────────────────────────────────────────────*/
.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 120px;
  padding: 16px 20px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-card .value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-card .label { font-size: 0.78rem; color: var(--text-3); margin-top: 4px; letter-spacing: 0.04em; text-transform: uppercase; }

/* ─── Notification Bell ──────────────────────────────────────────────────────*/
.notif-wrap {
  position: relative;
}

#notif-bell-btn {
  position: relative;
  padding: 7px;
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

.notif-badge.show { display: flex; }

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 300;
  overflow: hidden;
  display: none;
  animation: modalIn 0.15s ease;
}

.notif-panel.open { display: block; }

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  cursor: default;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-2); }
.notif-item.unread { background: var(--accent-dim); }
.notif-item.unread:hover { background: var(--bg-3); }

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.notif-dot.success { background: var(--green); }
.notif-dot.error   { background: var(--red); }
.notif-dot.info    { background: var(--accent); }

.notif-content { flex: 1; min-width: 0; }
.notif-content .title { font-size: 0.85rem; font-weight: 500; }
.notif-content .body  { font-size: 0.78rem; color: var(--text-2); margin-top: 2px; }
.notif-content .time  { font-size: 0.7rem; color: var(--text-3); margin-top: 4px; }

.notif-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-3);
}

/* ─── Download Widget ──────────────────────────────────────────────────── */
.download-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 300px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  z-index: 450;
  overflow: hidden;
  display: none;
  animation: modalIn 0.2s ease;
}
.download-widget.visible { display: block; }
.dw-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 10px 14px;
}
.dw-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, color .2s, border-color .2s;
}
.dw-icon.done  { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.dw-icon.error { background: var(--red-dim);   border-color: var(--red);   color: var(--red); }
.dw-info { flex: 1; min-width: 0; }
.dw-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.dw-sub  { font-size: .72rem; color: var(--text-3); margin-top: 1px; }
.dw-close-btn {
  width: 26px; height: 26px;
  border: none; background: transparent;
  color: var(--text-3); cursor: pointer;
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dw-close-btn:hover { background: var(--bg-3); color: var(--text); }
.dw-track {
  height: 3px;
  background: var(--bg-3);
  margin: 0 14px 12px;
  border-radius: 2px;
  overflow: hidden;
}
.dw-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .15s ease, background .2s;
}
.dw-fill.done  { background: var(--green); width: 100% !important; }
.dw-fill.error { background: var(--red); }

/* ─── Upload Widget ──────────────────────────────────────────────────────────*/
.upload-widget {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 300px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  z-index: 450;
  overflow: hidden;
  display: none;
  animation: modalIn 0.2s ease;
}

.upload-widget.visible { display: block; }

.uw-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 10px 14px;
  gap: 8px;
  cursor: default;
}

.uw-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.uw-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.uw-icon.done    { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.uw-icon.error   { background: var(--red-dim);   border-color: var(--red);   color: var(--red); }

.uw-title-wrap { min-width: 0; }
.uw-title { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uw-sub   { font-size: 0.72rem; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.uw-bar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.uw-pct {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-2);
  min-width: 32px;
  text-align: right;
}

.uw-pct.done  { color: var(--green); }
.uw-pct.error { color: var(--red); }

.uw-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  padding: 0;
}

.uw-btn:hover { background: var(--bg-3); color: var(--text); }

.uw-close-btn-hidden { display: none !important; }

.uw-progress-strip {
  height: 2px;
  background: var(--bg-3);
  overflow: hidden;
}

.uw-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0%;
  transition: width 0.2s ease;
}

.uw-progress-fill.done  { background: var(--green); }
.uw-progress-fill.error { background: var(--red); }

.uw-body {
  border-top: 1px solid var(--border);
  display: none;
}

.uw-body.open { display: block; }

.uw-file-list {
  max-height: 140px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

.uw-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.uw-file-row:last-child { border-bottom: none; }
.uw-file-row .name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; }
.uw-file-row .size { color: var(--text-3); flex-shrink: 0; }

.uw-body-footer {
  padding: 10px 16px 14px;
}

/* ─── Poster Cards ───────────────────────────────────────────────────────────*/
.poster-card { padding: 0; overflow: hidden; }

.poster-img-wrap {
  position: relative;
  aspect-ratio: 2/3;
  background: var(--bg-3);
  overflow: hidden;
}

.poster-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.release-card:hover .poster-img-wrap img { transform: scale(1.04); }

.poster-draft-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.75);
  color: var(--yellow);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.poster-body {
  padding: 14px 16px;
}

.poster-body .release-title { margin-bottom: 8px; }

/* Detail modal poster header */
.modal-wide { max-width: 700px; }

.detail-poster-header {
  position: relative;
  max-height: 320px;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
}

.detail-poster-header img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: top;
  display: block;
}

.detail-poster-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 40px 24px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
}

.detail-poster-overlay .release-detail-version { color: var(--accent-2); font-size: 0.85rem; }
.detail-poster-overlay h2 { color: #fff; font-size: 1.3rem; margin-top: 4px; }

.detail-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border-radius: 8px;
}

.detail-close-btn:hover { background: rgba(0,0,0,0.8); }

/* ─── Anime Grid (My List) ───────────────────────────────────────────────────*/
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.anime-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.15s;
}

.anime-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.4); border-color: var(--border-2); }
.anime-card.has-release { border-color: var(--accent); }
.anime-card.has-release::before { content:''; position:absolute; inset:0; pointer-events:none; }

.anime-poster {
  position: relative;
  aspect-ratio: 2/3;
  background: var(--bg-3);
  overflow: hidden;
}

.anime-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }

.anime-poster-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--text-3);
}

.anime-release-badge {
  position: absolute;
  bottom: 6px; right: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.anime-info { padding: 10px 10px 12px; }

.anime-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.anime-progress { margin-bottom: 4px; }

.anime-progress-bar-wrap {
  height: 3px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.anime-progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

.anime-progress span { font-size: 0.72rem; color: var(--text-3); }
.anime-score { font-size: 0.75rem; color: var(--yellow); margin-top: 2px; }

/* ─── MAL Search Dropdown ────────────────────────────────────────────────────*/
.mal-search-wrap { position: relative; }

.mal-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 250;
  max-height: 280px;
  overflow-y: auto;
}

.mal-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.mal-result-item:last-child { border-bottom: none; }
.mal-result-item:hover { background: var(--bg-2); }

.mal-result-item img, .mal-result-placeholder {
  width: 36px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg-3);
  flex-shrink: 0;
}

.mal-result-info { flex: 1; min-width: 0; }
.mal-result-title { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mal-result-meta  { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }

.mal-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.mal-preview img {
  width: 40px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.mal-preview-info { flex: 1; min-width: 0; }
.mal-preview-title { font-size: 0.875rem; font-weight: 600; }
.mal-preview-meta  { font-size: 0.75rem; color: var(--text-2); margin-top: 2px; }

/* ─── Image Upload in Form ───────────────────────────────────────────────────*/
.image-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.image-thumb-wrap {
  width: 48px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.image-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ─── Users Table ────────────────────────────────────────────────────────────*/
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.users-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.users-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.users-table tr:last-child td { border-bottom: none; }
.users-table tr:hover td { background: var(--bg-2); }

.role-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-badge.admin      { background: var(--accent-dim); color: var(--accent-2); }
.role-badge.viewer     { background: var(--bg-3); color: var(--text-3); }
.role-badge.superadmin { background: rgba(255,209,102,.15); color: var(--yellow); }

.mal-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-2);
  font-size: 0.85rem;
}

.mal-link:hover { color: var(--text); }

/* ─── Settings section ───────────────────────────────────────────────────────*/
.settings-section { margin-bottom: 20px; }
.settings-section:last-child { margin-bottom: 0; }

/* ─── Release list thumbnail ─────────────────────────────────────────────────*/
.release-list-thumb {
  width: 36px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.release-list-thumb-placeholder {
  width: 36px;
  height: 50px;
  border-radius: 4px;
  background: var(--bg-3);
  flex-shrink: 0;
}

/* ─── Browse Toggle ──────────────────────────────────────────────────────────*/
.view-toggle {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.toggle-btn {
  padding: 5px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
}

.toggle-btn:hover { color: var(--text); }
.toggle-btn.active { background: var(--bg-3); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }

/* ─── Series Detail Modal ────────────────────────────────────────────────────*/
.series-modal {
  max-width: 860px;
  position: relative;
  overflow: hidden;
}

.series-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  background: var(--bg-2);
}

.series-modal-layout {
  display: flex;
  min-height: 0;
}

.series-modal-poster {
  width: 220px;
  min-width: 220px;
  background: var(--bg-3);
  position: relative;
  display: flex;
  flex-direction: column;
}

.series-modal-poster img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}

.series-modal-poster-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-3);
}

.series-modal-mal-link {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.series-modal-mal-link a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-2);
}

.series-modal-mal-link a:hover { color: var(--accent-2); }

.series-modal-content {
  flex: 1;
  min-width: 0;
  padding: 24px;
  overflow-y: auto;
  max-height: 80vh;
}

.series-modal-header { margin-bottom: 10px; }
.series-modal-header h2 { font-size: 1.25rem; line-height: 1.3; }

.series-modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.series-status-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.series-status-badge.airing       { background: var(--green-dim); color: var(--green); }
.series-status-badge.finished     { background: var(--bg-3); color: var(--text-3); }
.series-status-badge.not_yet_aired { background: var(--yellow-dim); color: var(--yellow); }

.series-modal-synopsis {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.series-modal-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.series-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.series-stat .label { font-size: 0.7rem; color: var(--text-3); letter-spacing: 0.05em; text-transform: uppercase; }
.series-stat .value { font-size: 0.9rem; font-weight: 600; }

/* anime card file count badge */
.anime-card .file-count-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(108,99,255,0.9);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.anime-card-dimmed { opacity: 0.45; }
.anime-card-dimmed:hover { opacity: 1; }

/* ─── Admin Library Card Overlay ─────────────────────────────────────────────*/
.admin-lib-card .anime-poster { position: relative; overflow: hidden; }

.admin-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  opacity: 0;
  transition: opacity 0.18s;
}
.admin-lib-card:hover .admin-card-overlay { opacity: 1; }
.admin-card-overlay .btn { width: 100%; font-size: .75rem; }

/* ─── Notification dismiss button ────────────────────────────────────────────*/
.notif-item { position: relative; }
.notif-dismiss-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 2px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  line-height: 1;
}
.notif-item:hover .notif-dismiss-btn { opacity: 1; }
.notif-dismiss-btn:hover { color: var(--text); }

/* ─── View As picker ─────────────────────────────────────────────────────────*/
.view-as-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
}
.view-as-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.view-as-item:hover { background: var(--bg-3); }
.view-as-item.active { background: var(--accent-dim); }

/* ─── File references ────────────────────────────────────────────────────────*/
.file-ref-item { background: var(--bg-2); }
.file-ref-item .file-path-hint {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-refs-divider {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 0 4px;
}

/* ─── Folder browser ─────────────────────────────────────────────────────────*/
.fb-dir-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--text-1);
  font-size: .83rem;
  text-align: left;
  cursor: pointer;
}
.fb-dir-row:hover { background: var(--bg-2); }
.fb-dir-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Settings sections ───────────────────────────────────────────────────────*/
.settings-section { padding-bottom: 4px; }

/* ─── Audit Log ──────────────────────────────────────────────────────────────*/
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.audit-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.audit-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.audit-table tbody tr:last-child { border-bottom: none; }
.audit-table tbody tr:hover { background: var(--bg-3); }
.audit-table td { padding: 9px 14px; vertical-align: middle; }
.audit-time  { color: var(--text-3); font-size: .75rem; white-space: nowrap; }
.audit-ip    { font-family: monospace; font-size: .8rem; color: var(--text-2); }
.audit-user  { font-family: monospace; font-size: .8rem; }

.audit-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.audit-badge-fail  { background: var(--red-dim);    color: var(--red); }
.audit-badge-block { background: #ff8c0022;          color: #ff8c00; }
.audit-badge-rate  { background: var(--yellow-dim);  color: var(--yellow); }
.audit-badge-ok    { background: var(--green-dim);   color: var(--green); }
.audit-badge-admin    { background: var(--accent-dim);  color: var(--accent-2); }
.audit-badge-download { background: #0ea5e922;          color: #0ea5e9; }
.audit-badge-mut      { background: #f59e0b22;          color: #f59e0b; }

.audit-block-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.audit-block-row:last-child { border-bottom: none; }
.audit-block-ip { font-family: monospace; font-size: .85rem; }

/* ─── Responsive ─────────────────────────────────────────────────────────────*/
@media (max-width: 600px) {
  .main { padding: 20px 16px; }
  .releases-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-wrap { max-width: 100%; }
}

/* ─── Section Chips ──────────────────────────────────────────────────────────*/
.section-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  cursor: default;
  font-family: var(--font);
  white-space: nowrap;
}
.section-chip-anime     { background: var(--accent-dim); color: var(--accent-2); }
.section-chip-photobook { background: var(--green-dim);  color: var(--green); }
.section-chip-seiyuu    { background: var(--yellow-dim); color: var(--yellow); }

.section-chip-add {
  background: transparent;
  color: var(--text-3);
  border: 1px dashed var(--border-2);
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.12s, border-color 0.12s;
}
.section-chip-add:hover { color: var(--text); border-color: var(--text-3); }

button.section-chip-anime,
button.section-chip-photobook,
button.section-chip-seiyuu {
  cursor: pointer;
  transition: opacity 0.12s;
}
button.section-chip-anime:hover,
button.section-chip-photobook:hover,
button.section-chip-seiyuu:hover { opacity: 0.65; }

/* ─── People View ──────────────────────────────────────────────────────── */
.people-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.people-list-col {
  width: 300px;
  flex-shrink: 0;
}
.people-detail-col {
  flex: 1;
  min-width: 0;
}
.person-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color .15s, background .15s;
}
.person-card:hover   { background: var(--bg-2); border-color: var(--border-2); }
.person-card.active  { border-color: var(--accent); background: var(--bg-2); }
.person-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-2);
  flex-shrink: 0;
}
.person-card-info { min-width: 0; }
.person-card-name { font-weight: 500; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-card-sub  { font-size: .76rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 600;
  margin-right: 4px;
  background: var(--bg-3);
  color: var(--text-2);
}
.person-tag.seiyuu    { background: rgba(94,145,255,.15); color: #7ba8ff; }
.person-tag.photobook { background: rgba(255,145,180,.15); color: #ff8fb5; }
.person-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.person-detail-name { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.person-detail-romaji { font-size: .85rem; color: var(--text-3); margin-bottom: 8px; }
.person-detail-bio { font-size: .82rem; color: var(--text-2); margin-top: 8px; line-height: 1.5; }
@media (max-width: 700px) {
  .people-layout { flex-direction: column; }
  .people-list-col { width: 100%; }
}

/* ─── Photo Viewer ─────────────────────────────────────────────────────── */
.photo-viewer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.93);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.photo-viewer-overlay.open { display: flex; }
.pv-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 100px;
  width: 100%;
  min-height: 0;
}
.pv-content img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
}
.pv-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.pv-close:hover { background: rgba(255,255,255,.22); }
.pv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 14px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.pv-nav:hover { background: rgba(255,255,255,.2); }
.pv-nav[style*="hidden"] { pointer-events: none; }
.pv-prev { left: 14px; }
.pv-next { right: 14px; }
.pv-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
}
/* Photo viewer spinner */
.pv-spinner {
  display: none;
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: rgba(255,255,255,.8);
  border-radius: 50%;
  animation: pv-spin .65s linear infinite;
}
.pv-spinner.active { display: block; }
@keyframes pv-spin { to { transform: rotate(360deg); } }

/* Lazy-load placeholder for file list thumbnails */
.file-img-thumb.lazy {
  background: var(--bg-3);
  opacity: .4;
}

/* File item checkbox alignment */
.file-item { align-items: center; }
.file-select-cb { accent-color: var(--accent); width: auto; padding: 0; flex-shrink: 0; }

/* Image thumbnail in file list */
.file-img-thumb {
  width: 48px;
  height: 38px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
