[data-theme="dark"] .admin-sidebar { background: #0f172a; }
[data-theme="dark"] .admin-main    { background: #111827; }
[data-theme="dark"] .admin-table-wrapper,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .recent-card,
[data-theme="dark"] .settings-card { background: #1f2937; border-color: #374151; }
[data-theme="dark"] th             { background: #1a2433; color: #9ca3af; }
[data-theme="dark"] td             { color: #d1d5db; border-bottom-color: #374151; }
[data-theme="dark"] tr:hover td    { background: #1a2433; }
[data-theme="dark"] .admin-table-header { background: #1a2433; border-color: #374151; }
[data-theme="dark"] .admin-page-title   { color: #f9fafb; }
[data-theme="dark"] .admin-page-sub     { color: #9ca3af; }
[data-theme="dark"] .admin-search input { background: #111827; border-color: #374151; color: #f9fafb; }
[data-theme="dark"] .recent-card-title  { background: #1a2433; border-color: #374151; color: #f9fafb; }
[data-theme="dark"] .recent-item        { border-bottom-color: #374151; }
[data-theme="dark"] .recent-item-name   { color: #f9fafb; }
[data-theme="dark"] .recent-item-sub    { color: #9ca3af; }
[data-theme="dark"] .stat-card-value    { color: #f9fafb; }
[data-theme="dark"] .action-btn         { background: #1f2937; border-color: #374151; color: #d1d5db; }
[data-theme="dark"] .action-btn:hover   { background: #374151; }
[data-theme="dark"] .settings-card-body { background: #1f2937; }
[data-theme="dark"] .form-input         { background: #111827; border-color: #374151; color: #f9fafb; }
[data-theme="dark"] .toggle-info h4     { color: #f9fafb; }
[data-theme="dark"] .toggle-info p      { color: #9ca3af; }
[data-theme="dark"] .settings-card-title { background: #1a2433; color: #f9fafb; border-color: #374151; }

/* =========================================
   MyGifMaker Admin Panel Stylesheet
   ========================================= */

*, *::before, *::after { box-sizing: border-box; }

@font-face {
  font-family: "RussoOne";
  src: url("/fonts/RussoOne-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body {
  margin: 0;
  background: #f3f4f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Layout ── */
.admin-layout {
  display: block;
  min-height: 100vh;
}

/* ── Sidebar ── */
.admin-sidebar {
  background: #111827;
  color: #ffffff;
  padding: 1.5rem 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 240px;
  overflow-y: auto;
  z-index: 40;
}

.admin-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: "RussoOne", sans-serif;
}

.admin-sidebar-logo-icon {
  width: 30px;
  height: 30px;
  background: #0d9488;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.admin-sidebar-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 1.5rem;
  margin: 1rem 0 0.5rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  color: #9ca3af;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: color 0.15s, background 0.15s;
  border-radius: 0;
  text-decoration: none;
}

.admin-nav-link:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.05);
}

.admin-nav-link.active {
  color: #ffffff;
  background: rgba(13,148,136,0.2);
  border-right: 3px solid #0d9488;
}

.admin-nav-link i { font-size: 1rem; width: 18px; }

/* ── Main content ── */
.admin-main {
  margin-left: 240px;
  padding: 2rem;
  min-height: 100vh;
  box-sizing: border-box;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.admin-page-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.admin-page-sub {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* ── Panels ── */
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* ── Stat cards ── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.stat-card-label {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card-label i { color: #0d9488; }

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
}

/* ── Tables ── */
.admin-table-wrapper {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.admin-table-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: #f9fafb;
}

.admin-table-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
}

.admin-search {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.admin-search input {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  outline: none;
  width: 220px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.admin-search input:focus { border-color: #0d9488; }

.admin-search button {
  background: #0d9488;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

.admin-search button:hover { background: #0f766e; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  text-align: left;
  padding: 0.75rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #f3f4f6;
  background: #f9fafb;
}

td {
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid #f9fafb;
  color: #374151;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-admin { background: #f0fdf9; color: #0f766e; }
.badge-banned { background: #fef2f2; color: #dc2626; }
.badge-featured { background: #fef9c3; color: #854d0e; }
.badge-user { background: #f3f4f6; color: #6b7280; }

/* ── Action buttons ── */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  transition: all 0.15s;
  margin-right: 4px;
  margin-bottom: 4px;
  text-decoration: none;
}

.action-btn:hover { background: #f3f4f6; color: #374151; }
.action-btn.danger { color: #dc2626; border-color: #fecaca; }
.action-btn.danger:hover { background: #fef2f2; }
.action-btn.success { color: #0d9488; border-color: #99f6e4; }
.action-btn.success:hover { background: #f0fdf9; }
.action-btn.warning { color: #d97706; border-color: #fde68a; }
.action-btn.warning:hover { background: #fffbeb; }

/* ── GIF thumbnail ── */
.gif-thumb {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 1rem;
  border-top: 1px solid #f3f4f6;
}

.page-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: white;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: #374151;
}

.page-btn:hover { background: #f3f4f6; }
.page-btn.active { background: #0d9488; color: white; border-color: #0d9488; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Settings panel ── */
.settings-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.settings-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f3f4f6;
  background: #f9fafb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-card-title i { color: #0d9488; }
.settings-card-body { padding: 1.5rem; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  border-bottom: 1px solid #f9fafb;
}

.toggle-row:last-child { border-bottom: none; }

.toggle-info h4 {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #111827;
  margin-bottom: 0.125rem;
}

.toggle-info p {
  font-size: 0.8125rem;
  color: #9ca3af;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  transition: 0.2s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle input:checked + .toggle-slider { background: #0d9488; }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Recent items ── */
.recent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.recent-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.recent-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  background: #f9fafb;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f9fafb;
  font-size: 0.875rem;
}

.recent-item:last-child { border-bottom: none; }
.recent-item-main { flex: 1; min-width: 0; }
.recent-item-name {
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-item-sub {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Toast ── */
.admin-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #111827;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  max-width: 340px;
}

.admin-toast.show { display: flex; }
.admin-toast.success { background: #0d9488; }
.admin-toast.error { background: #dc2626; }

/* ── Access denied ── */
.access-denied {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.access-denied i { font-size: 3rem; color: #dc2626; margin-bottom: 1rem; display: block; }
.access-denied h1 { font-size: 1.5rem; font-weight: 600; color: #111827; margin-bottom: 0.5rem; }
.access-denied p { font-size: 0.9375rem; color: #6b7280; }

/* ── Shared styles ── */
.btn-primary {
  display: inline-block;
  background: #0d9488;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}

.btn-primary:hover { background: #0f766e; color: #ffffff; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  color: #1f2937;
  background: #f9fafb;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.form-input:focus { border-color: #0d9488; }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; padding: 1rem; }
  .recent-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .admin-search input { width: 160px; }
}

.report-filter-btn {
  padding: 0.375rem 1rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #6b7280;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
}
.report-filter-btn.active {
  background: #0d9488;
  color: white;
  border-color: #0d9488;
}
.report-filter-btn:hover:not(.active) { background: #f3f4f6; }

[data-theme="dark"] .report-filter-btn {
  background: #1f2937;
  color: #9ca3af;
  border-color: #374151;
}
[data-theme="dark"] .report-filter-btn.active {
  background: #0d9488;
  color: white;
  border-color: #0d9488;
}
[data-theme="dark"] .report-filter-btn:hover:not(.active) { background: #374151; }