/* Admin Panel CSS - DevForest Studio */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Space+Mono&display=swap');

:root {
  --sidebar-w: 260px;
  --forest-deep: #0a1f0e;
  --forest-dark: #122819;
  --forest-mid: #1a3d24;
  --forest-green: #2d6a4f;
  --forest-bright: #40916c;
  --forest-light: #52b788;
  --forest-mint: #74c69d;
  --forest-mist: #d8f3dc;
  --white: #fff;
  --bg: #f4faf5;
  --card: #fff;
  --border: #e2f0e5;
  --text: #0a1f0e;
  --muted: #6b8f74;
  --gold: #d4a843;
  --red: #e63946;
  --shadow: 0 2px 12px rgba(10,31,14,0.08);
  --shadow-lg: 0 8px 32px rgba(10,31,14,0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  --font: 'DM Sans', sans-serif;
  --mono: 'Space Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100%; display: flex; }

a { color: var(--forest-green); text-decoration: none; }
img { max-width: 100%; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--forest-deep);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: var(--transition);
}
.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo .logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
}
.sidebar-logo .logo-text span { color: var(--forest-mint); }
.sidebar-logo .logo-sub {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
  font-family: var(--mono);
}

.sidebar-nav { flex: 1; padding: 16px 0; }
.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 16px 20px 8px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
  border-radius: 0;
  border-left: 3px solid transparent;
}
.sidebar-link i { width: 18px; text-align: center; font-size: 0.9rem; }
.sidebar-link:hover {
  color: white;
  background: rgba(255,255,255,0.05);
}
.sidebar-link.active {
  color: var(--forest-mint);
  background: rgba(82,183,136,0.1);
  border-left-color: var(--forest-mint);
}
.sidebar-link .badge {
  margin-left: auto;
  background: var(--forest-green);
  color: white;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 100px;
}
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--forest-green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
}
.sidebar-user-info .name { color: white; font-size: 0.85rem; font-weight: 600; }
.sidebar-user-info .role { color: rgba(255,255,255,0.4); font-size: 0.72rem; }
.logout-link { margin-left: auto; color: rgba(255,255,255,0.4); transition: var(--transition); font-size: 1rem; }
.logout-link:hover { color: var(--red); }

/* ── MAIN CONTENT ── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 99;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.page-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.breadcrumb { font-size: 0.78rem; color: var(--muted); }
.breadcrumb a { color: var(--forest-green); }

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

/* ── CONTENT AREA ── */
.content { padding: 32px; flex: 1; }

/* ── CARDS ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title i { color: var(--forest-green); }
.card-body { padding: 24px; }

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.green { background: rgba(45,106,79,0.1); color: var(--forest-green); }
.stat-icon.gold { background: rgba(212,168,67,0.1); color: var(--gold); }
.stat-icon.blue { background: rgba(33,150,243,0.1); color: #2196f3; }
.stat-icon.red { background: rgba(230,57,70,0.1); color: var(--red); }
.stat-info .number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-info .label { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.stat-info .change {
  font-size: 0.75rem;
  margin-top: 4px;
  color: var(--forest-green);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: #f8faf9;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text);
  vertical-align: middle;
}
tr:hover td { background: #f8faf9; }
tr:last-child td { border-bottom: none; }

.thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--forest-mist);
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-green { background: rgba(45,106,79,0.1); color: var(--forest-green); }
.badge-gold { background: rgba(212,168,67,0.12); color: #b8881c; }
.badge-red { background: rgba(230,57,70,0.1); color: var(--red); }
.badge-blue { background: rgba(33,150,243,0.1); color: #1565c0; }
.badge-gray { background: #f0f0f0; color: #666; }

/* ── FORMS ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { margin-bottom: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.form-label .req { color: var(--red); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
  background: white;
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--forest-green); box-shadow: 0 0 0 3px rgba(45,106,79,0.1); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.75rem; color: var(--muted); margin-top: 5px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--forest-green); color: white; }
.btn-primary:hover { background: var(--forest-bright); color: white; transform: translateY(-1px); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--forest-green); color: var(--forest-green); }
.btn-danger { background: rgba(230,57,70,0.1); color: var(--red); }
.btn-danger:hover { background: var(--red); color: white; }
.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-lg { padding: 12px 28px; font-size: 0.95rem; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: var(--radius-sm); }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: rgba(82,183,136,0.12); border: 1px solid rgba(82,183,136,0.4); color: var(--forest-green); }
.alert-error { background: rgba(230,57,70,0.08); border: 1px solid rgba(230,57,70,0.3); color: var(--red); }
.alert-info { background: rgba(33,150,243,0.08); border: 1px solid rgba(33,150,243,0.3); color: #1565c0; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; padding-top: 20px; }
.page-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--forest-green); border-color: var(--forest-green); color: white; }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ── IMAGE PREVIEW ── */
.img-preview {
  width: 120px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--forest-mist);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  margin-top: 8px;
  overflow: hidden;
  cursor: pointer;
  color: var(--muted);
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-preview.large { width: 100%; height: 160px; }

/* File upload */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: #fafcfa;
}
.file-upload-area:hover, .file-upload-area.drag { border-color: var(--forest-green); background: rgba(45,106,79,0.03); }
.file-upload-area i { font-size: 2rem; color: var(--forest-mist); margin-bottom: 12px; display: block; }
.file-upload-area p { font-size: 0.875rem; color: var(--muted); }
.file-upload-area strong { color: var(--forest-green); }

/* ── TOGGLE ── */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ddd;
  border-radius: 100px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
input:checked + .toggle-slider { background: var(--forest-green); }
input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .content { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 14px 16px; }
}

/* ── MISC ── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 20px; }
.mb-4 { margin-bottom: 20px; }
.text-muted { color: var(--muted); font-size: 0.82rem; }
.text-sm { font-size: 0.82rem; }
.font-mono { font-family: var(--mono); }
.hidden { display: none !important; }
