/* AudioNovel Admin Dashboard CSS */
:root {
  color-scheme: dark;
  --bg-main: #0c0d0e;
  --bg-sidebar: #141517;
  --bg-card: #1a1b1e;
  --bg-card-hover: #222429;
  --bg-input: #121315;
  --border-color: #2c2e33;
  --text-main: #f8f9fa;
  --text-muted: #909296;
  --accent-red: #ff334b;
  --accent-blue: #339af0;
  --accent-gold: #fcc419;
  --accent-green: #51cf66;
  --font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

select {
  color-scheme: dark;
}

select option {
  background-color: #1a1b1e !important;
  color: #ffffff !important;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ================= AUTH GUARD SCREEN ================= */
.auth-guard-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.guard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.guard-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 0.8s linear infinite;
}

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

.guard-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.guard-card p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

.btn-guard-back {
  display: inline-block;
  background: var(--accent-blue);
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-guard-back:hover {
  background: #228be6;
}

/* ================= ADMIN LAYOUT ================= */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.brand-fish-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.45));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.brand-link:hover .brand-fish-img {
  transform: scale(1.15) rotate(-6deg);
  filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.7));
}

.brand-title {
  font-size: 17px;
  font-weight: 600;
}

.brand-title strong {
  color: var(--accent-red);
}

.brand-badge {
  display: inline-block;
  background: rgba(252, 196, 25, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(252, 196, 25, 0.3);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-left: 6px;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 0 10px 6px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--bg-card);
  color: var(--accent-gold);
  font-weight: 600;
  border-left: 3px solid var(--accent-gold);
}

.nav-icon {
  font-size: 18px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.admin-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.admin-email {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration: none;
  font-size: 12.5px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sidebar-link:hover {
  background: var(--bg-card-hover);
}

.btn-sidebar-logout {
  color: #ff6b6b;
}

.btn-sidebar-logout:hover {
  background: rgba(255, 107, 107, 0.15);
  border-color: rgba(255, 107, 107, 0.3);
}

/* Main Content */
.admin-main {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left h1 {
  font-size: 20px;
  font-weight: 600;
}

.page-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #238636;
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary-action:hover {
  background: #2ea043;
}

.btn-secondary-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 9px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.btn-secondary-action:hover {
  background: var(--bg-card-hover);
}

.admin-content-body {
  padding: 32px;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

/* ================= SECTION 1: OVERVIEW ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #3f4248;
}

.stat-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.icon-novels { background: rgba(51, 154, 240, 0.15); }
.icon-episodes { background: rgba(255, 51, 75, 0.15); }
.icon-users { background: rgba(252, 196, 25, 0.15); }
.icon-views { background: rgba(81, 207, 102, 0.15); }

.stat-title {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin: 2px 0;
}

.stat-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.overview-panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

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

.panel-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.panel-link-btn {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.panel-body {
  padding: 12px 16px;
}

.quick-novels-list, .quick-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.15s;
}

.quick-item:hover {
  background: var(--bg-card-hover);
}

.quick-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-thumb {
  width: 44px;
  height: 30px;
  border-radius: 4px;
  object-fit: cover;
}

.quick-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.quick-title {
  font-size: 13.5px;
  font-weight: 600;
}

.quick-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ================= SECTION 2 & 3: TABLES ================= */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
}

.search-filter-box {
  flex: 1;
  max-width: 400px;
}

.search-filter-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}

.search-filter-box input:focus {
  border-color: var(--accent-blue);
}

.count-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
}

.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.data-table th {
  background: #151619;
  color: var(--text-muted);
  font-weight: 600;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.table-cover {
  width: 56px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}

.table-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
}

.badge-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
}

.badge-cat {
  background: rgba(51, 154, 240, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(51, 154, 240, 0.25);
}

.badge-ep {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-role-admin {
  background: rgba(252, 196, 25, 0.18);
  color: var(--accent-gold);
  border: 1px solid rgba(252, 196, 25, 0.35);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11.5px;
}

.badge-role-user {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11.5px;
}

.action-btns-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.btn-tbl-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-tbl-action:hover {
  background: var(--bg-card-hover);
}

.btn-tbl-ep {
  color: var(--accent-blue);
  border-color: rgba(51, 154, 240, 0.3);
}

.btn-tbl-del {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.3);
}

.btn-tbl-del:hover {
  background: rgba(255, 51, 75, 0.2);
}

.btn-tbl-promote {
  background: #238636;
  color: #fff;
  border: none;
}

.btn-tbl-demote {
  background: rgba(255, 107, 107, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ================= MODALS ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-box-large {
  max-width: 1160px;
  width: 95vw;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.modal-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flex-1 { flex: 1; }

.form-group label {
  font-size: 12.5px;
  font-weight: 500;
  color: #cfd0d2;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent-blue);
}

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

.ep-meta-row {
  display: grid;
  grid-template-columns: 80px 1fr 90px;
  gap: 12px;
  width: 100%;
}

.ep-meta-row .form-group {
  min-width: 0;
}

.ep-meta-row .form-group input {
  width: 100%;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.btn-cancel {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
}

.btn-cancel:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.btn-save {
  background: #238636;
  border: none;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
}

.btn-save:hover {
  background: #2ea043;
}

/* Episodes Split Layout */
.modal-body-split {
  display: grid;
  grid-template-columns: 460px 1fr;
  min-height: 520px;
}

.split-col {
  padding: 24px;
}

.form-col {
  border-right: 1px solid var(--border-color);
  background: #16171a;
}

.form-col .modal-form {
  padding: 16px 0 0 0;
}

.form-col h4, .list-col h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.audio-test-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 8px;
  margin-top: 6px;
}

.audio-test-box label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.episodes-scroll-list {
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.ep-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13.5px;
  gap: 16px;
}

.ep-row-item:hover {
  background: var(--bg-card-hover);
}

.ep-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.ep-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ep-num-pill {
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.ep-row-title {
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-row-dur {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.ep-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #25272c;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlide 0.25s ease-out;
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.toast-success { border-left: 4px solid var(--accent-green); }
.toast.toast-error { border-left: 4px solid var(--accent-red); }
.toast.toast-info { border-left: 4px solid var(--accent-blue); }

/* Responsive */
@media (max-width: 900px) {
  .admin-sidebar {
    width: 70px;
  }
  .brand-text, .nav-text, .admin-profile-info, .sidebar-actions span:last-child {
    display: none;
  }
  .admin-main {
    margin-left: 70px;
  }
  .overview-panels-grid {
    grid-template-columns: 1fr;
  }
  .modal-body-split {
    grid-template-columns: 1fr;
  }
  .form-col {
    border-right: none;
  }
}

/* Upload Fields */
.upload-field-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.upload-field-row input[type="url"],
.upload-field-row input[type="text"] {
  flex: 1;
  min-width: 220px;
}

.btn-file-upload {
  background: rgba(51, 154, 240, 0.15);
  color: var(--accent-blue);
  border: 1px dashed rgba(51, 154, 240, 0.4);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s;
}

.btn-file-upload:hover {
  background: rgba(51, 154, 240, 0.25);
  border-color: var(--accent-blue);
}

.hidden-file-input {
  display: none;
}

.upload-status-text {
  font-size: 12.5px;
  color: var(--accent-gold);
  margin-top: 6px;
  padding: 6px 12px;
  background: rgba(229, 169, 59, 0.1);
  border: 1px solid rgba(229, 169, 59, 0.3);
  border-radius: 6px;
  display: inline-block;
}

.upload-status-text.success {
  color: var(--accent-green);
  background: rgba(46, 213, 115, 0.1);
  border-color: rgba(46, 213, 115, 0.3);
}

.upload-status-text.error {
  color: var(--accent-red);
  background: rgba(255, 71, 87, 0.1);
  border-color: rgba(255, 71, 87, 0.3);
}

/* ========================================================
   Vibrant Upload Progress Card & Spinner Loading
   ======================================================== */
.upload-progress-card {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(30, 27, 75, 0.55) 100%);
  border: 2px solid #38bdf8;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35), inset 0 0 15px rgba(56, 189, 248, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: uploadCardPulse 2s infinite alternate ease-in-out;
}

@keyframes uploadCardPulse {
  0% {
    border-color: #38bdf8;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.35), inset 0 0 10px rgba(56, 189, 248, 0.05);
  }
  100% {
    border-color: #818cf8;
    box-shadow: 0 0 26px rgba(129, 140, 248, 0.6), inset 0 0 16px rgba(129, 140, 248, 0.15);
  }
}

.upload-progress-card.success {
  animation: none;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(6, 78, 59, 0.5) 100%);
  border-color: #10b981;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.5), inset 0 0 12px rgba(16, 185, 129, 0.15);
}

.upload-progress-card.error {
  animation: none;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, rgba(69, 10, 10, 0.5) 100%);
  border-color: #ef4444;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.5), inset 0 0 12px rgba(239, 68, 68, 0.15);
}

.up-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.up-card-spinner {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.spin-ring {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-right-color: #818cf8;
  animation: spinRing 0.8s linear infinite;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

@keyframes spinRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.up-card-details {
  flex: 1;
  min-width: 0;
}

.up-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.up-card-sub {
  font-size: 12px;
  color: #7dd3fc;
  margin-top: 3px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-progress-card.success .up-card-sub {
  color: #6ee7b7;
}

.upload-progress-card.error .up-card-sub {
  color: #fca5a5;
}

.up-card-pct-badge {
  background: linear-gradient(135deg, #0284c7 0%, #6366f1 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.45);
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.upload-progress-card.success .up-card-pct-badge {
  background: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.upload-progress-card.error .up-card-pct-badge {
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.up-card-bar-track {
  margin-top: 10px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.up-card-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
  background-size: 200% 100%;
  border-radius: 8px;
  transition: width 0.12s ease-out;
  animation: barShimmer 2s infinite linear;
  box-shadow: 0 0 8px #38bdf8;
}

.upload-progress-card.success .up-card-bar-fill {
  background: #10b981;
  animation: none;
  box-shadow: 0 0 10px #10b981;
}

@keyframes barShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.cover-preview-wrap img {
  border: 1px solid var(--border-color);
}

/* File Browser Button */
.btn-file-browser {
  background: rgba(229, 169, 59, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(229, 169, 59, 0.4);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-file-browser:hover {
  background: rgba(229, 169, 59, 0.25);
  border-color: var(--accent-gold);
}

/* Storage Filters */
.storage-filter-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-storage-filter, .r2-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-storage-filter:hover, .r2-tab-btn:hover {
  color: var(--text-main);
  border-color: #555;
}

.btn-storage-filter.active, .r2-tab-btn.active {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
  font-weight: 600;
}

/* R2 Picker Modal */
.r2-picker-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.r2-picker-toolbar input {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.r2-filter-tabs {
  display: flex;
  gap: 6px;
}

.r2-picker-scroll-list {
  max-height: 480px;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.r2-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  gap: 14px;
  transition: border-color 0.2s;
}

.r2-item-card:hover {
  border-color: var(--accent-gold);
}

.r2-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.r2-type-icon {
  font-size: 24px;
}

.r2-file-info {
  min-width: 0;
  flex: 1;
}

.r2-file-name {
  font-weight: 600;
  font-size: 13.5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.r2-file-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.badge-unused {
  background: rgba(229, 169, 59, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(229, 169, 59, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
}

.badge-used {
  background: rgba(81, 207, 102, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(81, 207, 102, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
}

.btn-select-r2 {
  background: var(--accent-green);
  color: #000;
  font-weight: 600;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  transition: all 0.2s;
}

.btn-select-r2:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ================= TAGS SYSTEM STYLES ================= */
.icon-tags {
  background: rgba(255, 107, 107, 0.15);
  color: #ff6b6b;
}

.tag-picker-group {
  margin-top: 4px;
}

.tag-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tag-count-indicator {
  font-size: 11.5px;
  color: var(--accent-blue);
  font-weight: 500;
}

.selected-tags-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(51, 154, 240, 0.2);
  border: 1px solid rgba(51, 154, 240, 0.4);
  color: #74c0fc;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  animation: fadeInTag 0.2s ease-in-out;
}

@keyframes fadeInTag {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.selected-tag-remove {
  background: none;
  border: none;
  color: #ff8787;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  border-radius: 3px;
  transition: all 0.15s;
}

.selected-tag-remove:hover {
  background: rgba(255, 107, 107, 0.25);
  color: #ff4949;
}

.no-tags-hint {
  font-size: 12.5px;
  color: var(--text-muted);
}

.create-tag-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.create-tag-bar input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.2s;
}

.create-tag-bar input:focus {
  border-color: var(--accent-gold);
}

.btn-create-tag {
  background: rgba(252, 196, 25, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(252, 196, 25, 0.4);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-create-tag:hover {
  background: var(--accent-gold);
  color: #000;
}

.available-tags-section {
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
}

.available-tags-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.available-tags-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.tag-quick-search {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--text-main);
  font-size: 11.5px;
  width: 140px;
  outline: none;
}

.tag-quick-search:focus {
  border-color: var(--accent-blue);
}

.available-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 4px;
}

.available-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: #ced4da;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.available-tag-pill:hover {
  border-color: #4dabf7;
  color: #fff;
  background: #1c2736;
}

.available-tag-pill.selected {
  background: rgba(81, 207, 102, 0.18);
  border-color: var(--accent-green);
  color: #a9e34b;
  font-weight: 500;
}

.available-tag-pill.selected::before {
  content: '✓';
  font-weight: bold;
  font-size: 11px;
}

.tag-pill-count {
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 10px;
  color: #adb5bd;
}

.available-tag-pill.selected .tag-pill-count {
  background: rgba(81, 207, 102, 0.3);
  color: #fff;
}

.badge-tag-count {
  background: rgba(51, 154, 240, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(51, 154, 240, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
}



/* =========================================================
   Payments & Subscription Admin Styling
   ========================================================= */

.nav-badge {
  background: #e03131;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: auto;
  box-shadow: 0 2px 6px rgba(224, 49, 49, 0.4);
}

.btn-payment-filter {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-payment-filter:hover {
  border-color: #ffd43b;
  color: #fff;
}

.btn-payment-filter.active {
  background: rgba(250, 176, 5, 0.15);
  border-color: #ffd43b;
  color: #ffd43b;
  font-weight: 600;
}

/* =========================================================
   Security & Anti-Scraping Admin Styling
   ========================================================= */

.badge-status-active {
  background: rgba(81, 207, 102, 0.15);
  color: #51cf66;
  border: 1px solid rgba(81, 207, 102, 0.4);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-status-suspended {
  background: rgba(255, 0, 51, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 0, 51, 0.45);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-severity-critical {
  background: rgba(255, 0, 51, 0.2);
  color: #ff4d6d;
  border: 1px solid rgba(255, 0, 51, 0.5);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
}

.badge-severity-warning {
  background: rgba(255, 146, 43, 0.2);
  color: #ffa94d;
  border: 1px solid rgba(255, 146, 43, 0.5);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
}

.badge-severity-info {
  background: rgba(51, 154, 240, 0.2);
  color: #74c0fc;
  border: 1px solid rgba(51, 154, 240, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.btn-action-suspend {
  background: rgba(255, 0, 51, 0.15);
  border: 1px solid rgba(255, 0, 51, 0.4);
  color: #ff6b6b;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-action-suspend:hover {
  background: rgba(255, 0, 51, 0.35);
  color: #fff;
}

.btn-action-unsuspend {
  background: rgba(81, 207, 102, 0.15);
  border: 1px solid rgba(81, 207, 102, 0.4);
  color: #51cf66;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-action-unsuspend:hover {
  background: rgba(81, 207, 102, 0.35);
  color: #fff;
}
