/* Admin Panel Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --sidebar-w: 260px;
  --brown: #4E342E;
  --tan: #B08968;
  --gold: #D4AF37;
  --cream: #F8F5F2;
  --white: #FFFFFF;
  --charcoal: #333333;
  --border: #E5E7EB;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: #F3F4F6; color: var(--charcoal); }

/* Sidebar */
.admin-sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--brown) 0%, #3D2820 100%);
  padding: 0; overflow-y: auto; z-index: 100;
  display: flex; flex-direction: column;
}
.sidebar-brand {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(212,175,55,0.2);
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; color: var(--white);
  letter-spacing: 0.5px;
}
.sidebar-brand span { color: var(--gold); }
.sidebar-user {
  padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.5rem;
}
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--brown); font-size: 0.9rem;
  flex-shrink: 0;
}
.sidebar-username { font-size: 0.85rem; color: var(--white); font-weight: 500; }
.sidebar-role { font-size: 0.7rem; color: rgba(255,255,255,0.5); }

.sidebar-nav { padding: 0.5rem 0; flex: 1; }
.sidebar-section {
  font-size: 0.65rem; letter-spacing: 3px;
  text-transform: uppercase; color: rgba(255,255,255,0.35);
  padding: 1rem 1.5rem 0.4rem; font-weight: 600;
}
.sidebar-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none; font-size: 0.875rem;
  font-weight: 500; transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(212,175,55,0.1);
  color: var(--gold);
  border-left-color: var(--gold);
}
.sidebar-link i { width: 18px; text-align: center; font-size: 0.9rem; }
.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: white; font-size: 0.7rem; font-weight: 600;
  padding: 0.1rem 0.5rem; border-radius: 10px;
}

/* Main content */
.admin-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 2rem;
  display: flex; align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 1.1rem; font-weight: 600; color: var(--charcoal); }
.topbar-actions { display: flex; align-items: center; gap: 1rem; }
.topbar-btn {
  background: var(--gold); color: var(--brown);
  border: none; padding: 0.5rem 1.2rem;
  border-radius: 20px; font-size: 0.825rem;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem;
}
.topbar-btn:hover { background: var(--brown); color: var(--white); }
.topbar-btn-outline {
  background: none; border: 1px solid var(--border);
  color: var(--charcoal); padding: 0.5rem 1rem;
  border-radius: 20px; font-size: 0.825rem;
  cursor: pointer; transition: all 0.2s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem;
}
.topbar-btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.admin-content { padding: 2rem; flex: 1; }

/* Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--white);
  border-radius: 12px; padding: 1.5rem;
  border-left: 4px solid var(--gold);
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.stat-card.brown { border-color: var(--brown); }
.stat-card.tan { border-color: var(--tan); }
.stat-card.success { border-color: var(--success); }
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: #9CA3AF; font-weight: 600; margin-bottom: 0.4rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--charcoal); }
.stat-sub { font-size: 0.8rem; color: #9CA3AF; margin-top: 0.2rem; }
.stat-icon { font-size: 2rem; float: right; opacity: 0.2; }

.admin-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  overflow: hidden;
}
.admin-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
}
.admin-card-title { font-size: 1rem; font-weight: 600; }
.admin-card-body { padding: 1.5rem; }

/* Tables */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th {
  background: #F9FAFB; padding: 0.85rem 1rem;
  text-align: left; font-weight: 600; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: #6B7280; border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 1rem; border-bottom: 1px solid #F3F4F6;
  color: var(--charcoal); vertical-align: middle;
}
.admin-table tr:hover td { background: #FAFAFA; }
.admin-table img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; }

/* Badges */
.badge-active { background: #D1FAE5; color: #065F46; font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 10px; font-weight: 600; }
.badge-inactive { background: #FEE2E2; color: #991B1B; font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 10px; font-weight: 600; }
.badge-draft { background: #FEF3C7; color: #92400E; font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 10px; font-weight: 600; }
.badge-published { background: #D1FAE5; color: #065F46; font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 10px; font-weight: 600; }
.badge-unread { background: #EDE9FE; color: #5B21B6; font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 10px; font-weight: 600; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label { font-size: 0.825rem; font-weight: 600; color: var(--charcoal); margin-bottom: 0.4rem; display: block; }
.form-control {
  width: 100%; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 0.7rem 0.9rem;
  font-size: 0.875rem; font-family: 'Inter', sans-serif;
  color: var(--charcoal); background: var(--white);
  outline: none; transition: all 0.2s;
}
.form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.12); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { cursor: pointer; }

.btn-admin {
  background: var(--gold); color: var(--brown);
  border: none; padding: 0.7rem 1.5rem;
  border-radius: 8px; font-size: 0.875rem;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-admin:hover { background: var(--brown); color: var(--white); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-secondary { background: #F3F4F6; color: var(--charcoal); }
.btn-secondary:hover { background: var(--border); }

.action-btns { display: flex; gap: 0.4rem; }
.btn-icon {
  width: 30px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; border: none; cursor: pointer;
  transition: all 0.2s; text-decoration: none;
}
.btn-edit { background: #EFF6FF; color: #3B82F6; }
.btn-edit:hover { background: #3B82F6; color: white; }
.btn-delete { background: #FEF2F2; color: var(--danger); }
.btn-delete:hover { background: var(--danger); color: white; }
.btn-view { background: #F0FDF4; color: var(--success); }
.btn-view:hover { background: var(--success); color: white; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px; padding: 2rem;
  text-align: center; cursor: pointer;
  transition: all 0.2s; background: #FAFAFA;
}
.upload-zone:hover { border-color: var(--gold); background: #FFFBEB; }
.upload-zone.dragover { border-color: var(--gold); background: #FFFBEB; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.upload-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }

/* Alert */
.admin-alert {
  padding: 0.85rem 1.2rem; border-radius: 8px;
  font-size: 0.875rem; margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.7rem;
}
.admin-alert-success { background: #D1FAE5; color: #065F46; border-left: 4px solid var(--success); }
.admin-alert-error { background: #FEE2E2; color: #991B1B; border-left: 4px solid var(--danger); }
.admin-alert-info { background: #EFF6FF; color: #1E40AF; border-left: 4px solid #3B82F6; }

/* Pagination */
.admin-pagination { display: flex; gap: 0.4rem; align-items: center; }
.page-btn {
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--white);
  font-size: 0.825rem; cursor: pointer; transition: all 0.2s;
  text-decoration: none; color: var(--charcoal);
}
.page-btn:hover, .page-btn.active { background: var(--gold); border-color: var(--gold); color: var(--brown); font-weight: 700; }

@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}
