/* ====================================================
   GDFC Admin Dashboard — Light & Dark Theme
   ==================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --primary:        #00A651;
  --primary-dark:   #007a3d;
  --primary-light:  #00d668;
  --gold:           #FFD700;
  --gold-dark:      #cc9900;
  --accent:         #ff4444;
  --font-body:      'Nunito', sans-serif;
  --font-heading:   'Rajdhani', sans-serif;
  --font-display:   'Bebas Neue', sans-serif;
  --sidebar-w:      260px;
  --topbar-h:       62px;
  --radius:         12px;
  --radius-sm:      8px;
  --transition:     0.25s ease;
}

/* ---- DARK THEME (default) ---- */
[data-theme="dark"], :root {
  --bg:             #0d1117;
  --bg-secondary:   #161b22;
  --bg-card:        #1c2128;
  --bg-hover:       #21262d;
  --border:         rgba(255,255,255,0.08);
  --border-strong:  rgba(0,166,81,0.25);
  --text-primary:   #e6edf3;
  --text-secondary: #8b949e;
  --text-muted:     #6e7681;
  --sidebar-bg:     #161b22;
  --sidebar-border: rgba(255,255,255,0.06);
  --topbar-bg:      rgba(22,27,34,0.95);
  --input-bg:       rgba(255,255,255,0.05);
  --input-border:   rgba(0,166,81,0.3);
  --shadow:         0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
  --stat-glow-primary: rgba(0,166,81,0.15);
  --stat-glow-gold:    rgba(255,215,0,0.12);
  --stat-glow-red:     rgba(255,68,68,0.12);
  --stat-glow-blue:    rgba(58,130,246,0.12);
}

/* ---- LIGHT THEME ---- */
[data-theme="light"] {
  --bg:             #f0f4f8;
  --bg-secondary:   #e8edf2;
  --bg-card:        #ffffff;
  --bg-hover:       #f5f8fb;
  --border:         rgba(0,0,0,0.08);
  --border-strong:  rgba(0,166,81,0.3);
  --text-primary:   #1a2332;
  --text-secondary: #4a5568;
  --text-muted:     #718096;
  --sidebar-bg:     #1a2332;
  --sidebar-border: rgba(255,255,255,0.07);
  --topbar-bg:      rgba(255,255,255,0.95);
  --input-bg:       #f8fafb;
  --input-border:   rgba(0,166,81,0.35);
  --shadow:         0 4px 24px rgba(0,0,0,0.1);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.07);
  --stat-glow-primary: rgba(0,166,81,0.08);
  --stat-glow-gold:    rgba(255,215,0,0.08);
  --stat-glow-red:     rgba(255,68,68,0.08);
  --stat-glow-blue:    rgba(58,130,246,0.08);
}

/* ---------- Base Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.admin-body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  margin: 0;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.admin-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  transform: translateX(0);
  transition: transform 0.3s ease, background var(--transition);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,166,81,0.3) transparent;
  /* Ensure sidebar is above everything on mobile */
  will-change: transform;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(0,166,81,0.3); border-radius: 4px; }

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
}
.sb-logo-circle {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,166,81,0.4);
}
.sb-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  line-height: 1.2;
}
.sb-sub {
  font-size: 0.65rem;
  color: var(--primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Sidebar User */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  margin: 8px 12px;
  background: rgba(0,166,81,0.08);
  border: 1px solid rgba(0,166,81,0.15);
  border-radius: var(--radius-sm);
}
.su-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.su-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  line-height: 1.2;
}
.su-role {
  font-size: 0.68rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
}
.nav-section-label {
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.25);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 12px 8px 4px;
  margin-top: 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
  position: relative;
  margin-bottom: 2px;
}
.sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.sidebar-link:hover {
  background: rgba(0,166,81,0.12);
  color: #fff;
}
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(0,166,81,0.2), rgba(0,166,81,0.05));
  color: var(--primary-light);
  border-left: 3px solid var(--primary);
  padding-left: 9px;
}
.sidebar-link-danger { color: rgba(255,100,100,0.7) !important; }
.sidebar-link-danger:hover { background: rgba(255,68,68,0.12) !important; color: #ff6b6b !important; }

.sidebar-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
}

/* ============================================================
   TOPBAR
   ============================================================ */
.admin-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  z-index: 900;
  transition: left var(--transition), background var(--transition);
}
.topbar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: none;
}
.topbar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.topbar-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  flex: 1;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle */
.theme-toggle-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9rem;
}
.theme-toggle-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(0,166,81,0.4);
}

/* Notification bell */
.topbar-notif {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.topbar-notif:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--topbar-bg);
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 6px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.topbar-user i { color: var(--primary); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.admin-main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  transition: margin-left var(--transition);
}
.admin-content {
  padding: 24px;
}

/* Page Header */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.admin-page-header h4, .admin-page-header h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  margin: 0;
}
.admin-breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-breadcrumb a { color: var(--primary); text-decoration: none; }

/* ============================================================
   CARDS
   ============================================================ */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,166,81,0.04);
}
.admin-card-header h6 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.admin-card-link {
  font-size: 0.8rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.admin-card-link:hover { color: var(--primary-light); }
.admin-card-body { padding: 20px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.admin-stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: var(--radius);
}
.admin-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.admin-stat-card:hover::before { opacity: 1; }

.admin-stat-card.primary { border-left: 4px solid var(--primary); }
.admin-stat-card.primary::before { background: var(--stat-glow-primary); }
.admin-stat-card.gold    { border-left: 4px solid var(--gold); }
.admin-stat-card.gold::before { background: var(--stat-glow-gold); }
.admin-stat-card.red     { border-left: 4px solid var(--accent); }
.admin-stat-card.red::before { background: var(--stat-glow-red); }
.admin-stat-card.blue    { border-left: 4px solid #3a82f6; }
.admin-stat-card.blue::before { background: var(--stat-glow-blue); }

.asc-icon {
  font-size: 2rem;
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.admin-stat-card.primary .asc-icon { color: var(--primary); background: var(--stat-glow-primary); }
.admin-stat-card.gold    .asc-icon { color: var(--gold); background: var(--stat-glow-gold); }
.admin-stat-card.red     .asc-icon { color: var(--accent); background: var(--stat-glow-red); }
.admin-stat-card.blue    .asc-icon { color: #3a82f6; background: var(--stat-glow-blue); }

.asc-num {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--text-primary);
}
.asc-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}
.asc-sub {
  font-size: 0.75rem;
  margin-top: 4px;
  color: var(--text-muted);
}

/* ============================================================
   TABLES
   ============================================================ */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  background: rgba(0,166,81,0.08);
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 14px;
  border: none;
  white-space: nowrap;
}
.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.875rem;
  vertical-align: middle;
}
.admin-table tbody tr:hover td { background: var(--bg-hover); }
.admin-table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   FORMS
   ============================================================ */
.form-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control.gdfc-input,
.form-select.gdfc-input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 0.875rem;
  transition: all var(--transition);
}
.form-control.gdfc-input:focus,
.form-select.gdfc-input:focus {
  background: var(--input-bg);
  border-color: var(--primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(0,166,81,0.18);
  outline: none;
}
.form-control.gdfc-input::placeholder { color: var(--text-muted); }
.form-select.gdfc-input option { background: var(--bg-card); color: var(--text-primary); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary-dark);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all var(--transition);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(0,166,81,0.4);
  transform: translateY(-1px);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-color: var(--gold-dark);
  color: #1a1a1a;
  font-family: var(--font-heading);
  font-weight: 700;
}
.btn-gold:hover {
  background: linear-gradient(135deg, #ffe44d, var(--gold));
  box-shadow: 0 4px 14px rgba(255,215,0,0.35);
  transform: translateY(-1px);
  color: #111;
}

/* Status Badges */
.status-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-active   { background: rgba(0,166,81,0.15);  color: var(--primary-light); }
.status-inactive { background: rgba(255,255,255,0.07); color: var(--text-muted); }
.status-pending  { background: rgba(255,215,0,0.15);  color: var(--gold); }
.status-injured  { background: rgba(255,68,68,0.15);  color: #ff7070; }

/* Filter pills */
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-heading);
  transition: all var(--transition);
  cursor: pointer;
}
.filter-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,166,81,0.35);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { margin-bottom: 16px; display: block; }
.empty-state h5 { font-family: var(--font-heading); margin: 0; }

/* Result rows */
.result-admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.result-admin-row:last-child { border-bottom: none; }
.result-admin-row:hover { background: var(--bg-hover); }

/* Message rows */
.message-admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--transition);
}
.message-admin-row:last-child { border-bottom: none; }
.message-admin-row.unread { background: rgba(0,166,81,0.04); }
.message-admin-row:hover { background: var(--bg-hover); }

/* ============================================================
   GALLERY — ADMIN GRID
   ============================================================ */
.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.admin-gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-secondary);
  border: 2px solid transparent;
  transition: all var(--transition);
}
.admin-gallery-item:hover { border-color: var(--primary); }
.admin-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.admin-gallery-item:hover img { transform: scale(1.06); }
.agp-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
}
.admin-gallery-item:hover .agp-overlay { opacity: 1; }
.agp-caption {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
}
.agp-cat {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-light);
  margin-bottom: 8px;
}
.agp-actions { display: flex; gap: 5px; flex-wrap: wrap; }

.admin-gallery-item.inactive-photo { opacity: 0.5; }
.inactive-badge {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(0,0,0,0.7);
  color: #ffcc00;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============================================================
   GALLERY — FRONTEND LIGHTBOX
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--bg-secondary);
}
.gallery-img-wrap { position: relative; padding-bottom: 75%; overflow: hidden; }
.gallery-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover .gallery-img-wrap img { transform: scale(1.08); }
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 60%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.3s;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay-content { margin-left: auto; }
.gallery-zoom-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,166,81,0.85);
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}
.gallery-zoom-btn:hover { background: var(--primary); transform: scale(1.1); }
.gallery-caption {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  margin-top: auto;
  line-height: 1.3;
}

/* ============================================================
   BEAUTIFUL LIGHTBOX
   ============================================================ */
.gdfc-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.96);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.gdfc-lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}
.gdfc-lightbox-inner {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gdfc-lightbox-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
#gdfc-lb-img {
  max-width: 88vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
  transition: opacity 0.25s;
}
.gdfc-lb-caption {
  margin-top: 14px;
  text-align: center;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 600px;
}
.gdfc-lb-cat {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 5px;
}
.gdfc-lb-counter {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin-top: 4px;
}
.gdfc-lb-close {
  position: fixed;
  top: 20px; right: 24px;
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.gdfc-lb-close:hover { background: var(--accent); border-color: var(--accent); }

.gdfc-lb-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  z-index: 10000;
}
.gdfc-lb-btn:hover { background: var(--primary); border-color: var(--primary); }
.gdfc-lb-prev { left: 16px; }
.gdfc-lb-next { right: 16px; }

/* Thumbnails strip */
.gdfc-lb-thumbs {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  max-width: 90vw;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,166,81,0.4) transparent;
}
.gdfc-lb-thumb {
  width: 54px; height: 42px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  opacity: 0.55;
}
.gdfc-lb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gdfc-lb-thumb:hover { opacity: 0.8; }
.gdfc-lb-thumb.active { border-color: var(--primary); opacity: 1; }

/* ============================================================
   USERS MANAGEMENT
   ============================================================ */
.user-avatar-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.role-badge {
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.role-superadmin { background: rgba(255,215,0,0.15); color: var(--gold); }
.role-admin      { background: rgba(0,166,81,0.15);  color: var(--primary-light); }
.role-editor     { background: rgba(58,130,246,0.15); color: #7db5ff; }

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.admin-quick-actions {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.qa-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-heading);
  transition: all var(--transition);
  text-align: center;
}
.qa-btn i { font-size: 1.2rem; }
.qa-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0,166,81,0.06);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.admin-login-body {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  position: relative;
  overflow: hidden;
}
.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.login-bg-orb-1 {
  width: 400px; height: 400px;
  background: rgba(0,166,81,0.12);
  top: -100px; left: -100px;
}
.login-bg-orb-2 {
  width: 300px; height: 300px;
  background: rgba(255,215,0,0.08);
  bottom: -80px; right: -80px;
}
.login-wrap {
  width: 100%;
  max-width: 440px;
  padding: 20px;
  position: relative;
  z-index: 1;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(0,166,81,0.05);
}
.login-theme-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: #fff;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(0,166,81,0.4);
}
.login-logo h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-primary);
  margin: 0 0 4px;
}
.login-logo p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1049; /* just below sidebar (1050) */
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: pointer;
}
.sidebar-overlay.active {
  display: block;
  animation: overlayFadeIn 0.25s ease;
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   ALERTS / FLASH
   ============================================================ */
.alert {
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
}
.alert-success { background: rgba(0,166,81,0.12); color: var(--primary-light); border-left: 3px solid var(--primary); }
.alert-danger  { background: rgba(255,68,68,0.12); color: #ff7070; border-left: 3px solid var(--accent); }
.alert-warning { background: rgba(255,215,0,0.12); color: var(--gold); border-left: 3px solid var(--gold); }
.alert-info    { background: rgba(58,130,246,0.12); color: #7db5ff; border-left: 3px solid #3a82f6; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
  .admin-sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    z-index: 1050;
  }
  .admin-sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 6px 0 32px rgba(0,0,0,0.55);
    z-index: 1050;
  }
  .admin-main { margin-left: 0; }
  .admin-topbar { left: 0; }
  .topbar-toggle { display: flex !important; }
  .admin-content { padding: 16px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* Prevent body scroll when sidebar is open on mobile */
body.sidebar-open { overflow: hidden; }

@media (max-width: 575px) {
  .login-card { padding: 28px 20px; }
  .admin-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .gdfc-lb-btn { width: 38px; height: 38px; font-size: 1rem; }
}

/* ============================================================
   BOOTSTRAP OVERRIDES
   ============================================================ */
.form-control, .form-select {
  background: var(--input-bg);
  border-color: var(--input-border);
  color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
  background: var(--input-bg);
  border-color: var(--primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(0,166,81,0.18);
}
.form-control::placeholder { color: var(--text-muted); }
.input-group-text {
  background: var(--bg-hover);
  border-color: var(--input-border);
  color: var(--text-secondary);
}
.modal-content {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}
.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); }
.dropdown-menu {
  background: var(--bg-card);
  border-color: var(--border);
}
.dropdown-item { color: var(--text-primary); }
.dropdown-item:hover { background: var(--bg-hover); color: var(--primary); }
.pagination .page-link {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}
.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}
.pagination .page-link:hover { background: var(--bg-hover); color: var(--primary); }
.btn-outline-secondary {
  border-color: var(--input-border);
  color: var(--text-secondary);
}
.btn-outline-secondary:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.text-muted { color: var(--text-muted) !important; }

/* Collapse / accordion */
.collapse.show .admin-card { border-color: var(--border-strong); }

/* Scrollbar global */
* { scrollbar-width: thin; scrollbar-color: rgba(0,166,81,0.25) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,166,81,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,166,81,0.45); }

/* ============================================================
   THEME TOGGLE BUTTONS
   ============================================================ */

/* ---- Topbar pill toggle ---- */
.topbar-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-hover);
  border: 1.5px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.topbar-theme-toggle .theme-icon {
  font-size: 0.9rem;
  color: var(--gold);
  transition: transform 0.4s ease;
}
.topbar-theme-toggle:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 12px rgba(0,166,81,0.35);
}
.topbar-theme-toggle:hover .theme-icon { color: #fff; transform: rotate(20deg); }

/* ---- Sidebar pill toggle (iOS-style switch) ---- */
.sidebar-theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0,166,81,0.08);
  border: 1.5px solid rgba(0,166,81,0.25);
  color: rgba(255,255,255,0.8);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 6px;
  text-align: left;
}
.sidebar-theme-toggle:hover {
  background: rgba(0,166,81,0.18);
  border-color: var(--primary);
  color: #fff;
}
/* The track (the pill slot) */
.stt-track {
  width: 42px;
  height: 22px;
  border-radius: 11px;
  background: var(--primary);
  border: 1.5px solid rgba(255,255,255,0.15);
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition);
}
[data-theme="light"] .stt-track { background: #c8e6c9; }
/* The sliding thumb */
.stt-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), background var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
/* icon inside thumb */
.stt-thumb .theme-icon {
  font-size: 0.6rem;
  color: var(--primary);
  transition: color var(--transition);
}
[data-theme="light"] .stt-thumb .theme-icon { color: #cc9900; }
/* thumb slides right in light mode (handled by JS) */

.stt-label { line-height: 1; }

/* ---- Light theme overrides for sidebar toggle ---- */
[data-theme="light"] .sidebar-theme-toggle {
  background: rgba(0,166,81,0.07);
  border-color: rgba(0,166,81,0.3);
  color: #1a2332;
}
[data-theme="light"] .sidebar-theme-toggle:hover {
  background: rgba(0,166,81,0.15);
  color: #0d1117;
}
[data-theme="light"] .topbar-theme-toggle {
  color: var(--text-primary);
}
