/* Admin Panel Styles - extends style.css */

/* ===== ADMIN LAYOUT ===== */
.admin-body {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 0;
}

/* Sidebar */
.admin-sidebar {
  width: 256px;
  background: #0f172a;
  color: white;
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 60;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

@media (max-width: 1023px) {
  .admin-sidebar { transform: translateX(100%); }
  .admin-sidebar.open { transform: translateX(0); box-shadow: -4px 0 20px rgba(0,0,0,0.3); }
}

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-logo-text { font-size: 1.1rem; font-weight: 900; color: white; }
.sidebar-logo-sub { font-size: 0.65rem; color: rgba(255,255,255,0.45); display: block; margin-top: 1px; }
.sidebar-logo-icon { width: 38px; height: 38px; background: var(--primary); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }

.sidebar-nav { flex: 1; padding: 0.75rem 0; }
.sidebar-section { padding: 0.75rem 1rem 0.3rem; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; color: rgba(255,255,255,0.35); letter-spacing: 0.8px; }
.sidebar-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 1rem;
  color: rgba(255,255,255,0.65); font-size: 0.875rem; font-weight: 600;
  transition: var(--transition); cursor: pointer; border-right: 3px solid transparent;
  text-decoration: none;
}
.sidebar-item:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-item.active { background: rgba(26,86,219,0.2); color: white; border-right-color: var(--primary); }
.sidebar-item .s-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.sidebar-badge { margin-right: auto; background: var(--danger); color: white; font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 10px; font-weight: 800; min-width: 18px; text-align: center; }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user { display: flex; align-items: center; gap: 0.75rem; }
.sidebar-user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; font-weight: 800; color: white; flex-shrink: 0; }
.sidebar-user-name { font-size: 0.82rem; font-weight: 700; color: white; }
.sidebar-user-role { font-size: 0.68rem; color: rgba(255,255,255,0.45); }

/* Overlay (mobile) */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 59; display: none; }
.sidebar-overlay.show { display: block; }

/* Main area */
.admin-main {
  flex: 1;
  margin-right: 256px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
@media (max-width: 1023px) { .admin-main { margin-right: 0; } }

/* Topbar */
.admin-topbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 40;
  box-shadow: var(--shadow);
}
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.menu-toggle {
  display: none; width: 36px; height: 36px; background: var(--bg-3);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; align-items: center; justify-content: center; color: var(--text-2);
}
@media (max-width: 1023px) { .menu-toggle { display: flex; } }
.page-title { font-size: 1rem; font-weight: 800; color: var(--text); }
.topbar-home { font-size: 0.82rem; color: var(--primary); font-weight: 600; }

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

/* ===== STATS GRID ===== */
.stats-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; margin-bottom: 1.75rem; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4,1fr); } }
.stat-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.75rem; }
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.stat-icon.blue   { background: var(--primary-light); }
.stat-icon.green  { background: var(--accent-light); }
.stat-icon.purple { background: #f5f3ff; }
.stat-icon.orange { background: #fff7ed; }
.stat-value { font-size: 1.85rem; font-weight: 900; color: var(--text); line-height: 1; margin-bottom: 0.3rem; }
.stat-label { font-size: 0.78rem; color: var(--text-3); font-weight: 600; }
.stat-sub { font-size: 0.72rem; color: var(--text-3); margin-top: 0.35rem; }

/* ===== ADMIN TABLE ===== */
.admin-table-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.admin-table-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.admin-table-title { font-size: 0.95rem; font-weight: 800; }
.table-filters { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.filter-select, .search-box {
  padding: 0.4rem 0.75rem; border: 1.5px solid var(--border-2); border-radius: var(--radius);
  font-family: 'Vazirmatn',sans-serif; font-size: 0.8rem; background: var(--bg-2); color: var(--text);
  cursor: pointer; transition: var(--transition);
}
.filter-select:focus, .search-box:focus { outline: none; border-color: var(--primary); }
.search-box { min-width: 180px; }

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
.status-badge::before { content: '●'; font-size: 0.55rem; }
.status-pending  { background: var(--warning-light); color: var(--warning); }
.status-approved { background: var(--accent-light); color: var(--accent); }
.status-rejected { background: var(--danger-light); color: var(--danger); }
.status-published { background: var(--accent-light); color: var(--accent); }
.status-draft     { background: var(--bg-3); color: var(--text-3); border: 1px solid var(--border); }
.status-reviewing { background: var(--primary-light); color: var(--primary); }
.status-accepted  { background: var(--accent-light); color: var(--accent); }
.status-completed { background: #f5f3ff; color: var(--secondary); }
.status-active    { background: var(--accent-light); color: var(--accent); }
.status-inactive  { background: var(--bg-3); color: var(--text-3); border: 1px solid var(--border); }

/* ===== ACTION BTNS ===== */
.action-btn {
  width: 30px; height: 30px; border-radius: var(--radius); border: none;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem; transition: var(--transition);
}
.action-btn.approve { background: var(--accent-light); color: var(--accent); }
.action-btn.approve:hover { background: var(--accent); color: white; }
.action-btn.reject  { background: var(--danger-light); color: var(--danger); }
.action-btn.reject:hover  { background: var(--danger); color: white; }
.action-btn.edit    { background: var(--primary-light); color: var(--primary); }
.action-btn.edit:hover    { background: var(--primary); color: white; }
.action-btn.delete  { background: var(--danger-light); color: var(--danger); }
.action-btn.delete:hover  { background: var(--danger); color: white; }
.action-btn.view    { background: var(--bg-3); color: var(--text-2); }
.action-btn.view:hover    { background: var(--border); }
.action-btn.star    { background: #fef9c3; color: #d97706; }
.action-btn.star:hover    { background: #f59e0b; color: white; }

/* ===== DETAIL PANEL ===== */
.detail-panel { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.detail-panel-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.detail-panel-body { padding: 1.25rem; }
.detail-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: 0.78rem; font-weight: 700; color: var(--text-3); min-width: 110px; }
.detail-val { font-size: 0.85rem; color: var(--text); word-break: break-all; }

/* ===== BANNERS & ADS MANAGER ===== */
.banner-preview { border-radius: var(--radius-lg); overflow: hidden; border: 2px dashed var(--border); padding: 1rem; text-align: center; background: var(--bg-3); color: var(--text-3); font-size: 0.85rem; cursor: pointer; transition: var(--transition); }
.banner-preview:hover { border-color: var(--primary); color: var(--primary); }
.banner-preview img { max-height: 120px; object-fit: contain; margin: 0 auto; }

/* ===== CHART PLACEHOLDER ===== */
.chart-box { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.chart-box .chart-area { height: 200px; background: var(--bg-3); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 0.85rem; margin-top: 0.75rem; }

/* ===== ADMIN FORM ===== */
.admin-form-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.admin-form-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.admin-form-body { padding: 1.25rem; }
.admin-form-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); background: var(--bg-3); display: flex; gap: 0.75rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .admin-content { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-topbar { padding: 0 1rem; }
  .stat-value { font-size: 1.5rem; }
}
