/* =========================================
   ADMIN DASHBOARD - PURPLE GOLD THEME
   ========================================= */
:root {
  --purple:       #7C3AED;
  --purple-light: #EDE9FE;
  --purple-dark:  #5B21B6;
  --gold:         #F59E0B;
  --gold-light:   #FEF3C7;
  --gold-dark:    #D97706;
  --red:          #EF4444;
  --red-light:    #FEE2E2;
  --green:        #10B981;
  --green-light:  #D1FAE5;
  --blue:         #3B82F6;
  --blue-light:   #DBEAFE;
  --pink:         #EC4899;
  --pink-light:   #FCE7F3;
  --white:        #FFFFFF;
  --bg:           #F1F5F9;
  --sidebar-bg:   #0F172A;
  --sidebar-text: #CBD5E1;
  --text:         #1E293B;
  --text-muted:   #64748B;
  --border:       #E2E8F0;
  --shadow:       0 2px 15px rgba(0,0,0,0.08);
  --shadow-lg:    0 10px 40px rgba(0,0,0,0.12);
  --radius:       14px;
  --radius-sm:    8px;
}

*  { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a  { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ====== SIDEBAR ====== */
.sidebar {
  width: 260px; min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed; top: 0; left: 0; z-index: 200;
  display: flex; flex-direction: column;
  transition: all 0.3s; overflow-y: auto;
}
.sidebar-logo {
  padding: 22px 20px;
  background: linear-gradient(135deg, var(--purple), #4F46E5);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo .logo-icon { font-size: 32px; }
.sidebar-logo-text h2 { color: #fff; font-size: 16px; font-weight: 800; }
.sidebar-logo-text p  { color: rgba(255,255,255,0.6); font-size: 11px; margin-top:2px; }

.sidebar-menu { flex: 1; padding: 12px 0; }
.menu-section { color: #475569; font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; padding: 14px 20px 5px; font-weight: 700; }

.sidebar-menu a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 20px; color: var(--sidebar-text);
  transition: all 0.2s; font-size: 13.5px; position: relative; margin: 1px 8px; border-radius: 8px;
}
.sidebar-menu a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar-menu a.active { background: linear-gradient(135deg, var(--purple), #4F46E5); color: #fff; }
.sidebar-menu a .icon { font-size: 17px; width: 22px; text-align: center; }
.sidebar-menu a .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 20px; font-weight: 700; }
.sidebar-menu a .badge-gold { background: var(--gold); color: #000; }

.sidebar-bottom { padding: 15px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-bottom a { display: flex; align-items: center; gap: 10px; color: #94A3B8; padding: 9px 12px; font-size: 13px; transition: color 0.2s; border-radius: 8px; }
.sidebar-bottom a:hover { color: var(--red); background: rgba(239,68,68,0.1); }

/* ====== MAIN LAYOUT ====== */
.main-wrapper { margin-left: 260px; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  background: var(--white); padding: 0 28px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 99;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-left h4 { font-size: 16px; font-weight: 700; color: var(--text); }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-search { position: relative; }
.topbar-search input { padding: 8px 15px 8px 38px; border: 1px solid var(--border); border-radius: 25px; font-size: 13px; background: var(--bg); width: 220px; outline: none; color: var(--text); }
.topbar-search input:focus { border-color: var(--purple); background: #fff; width: 260px; transition: width 0.3s; }
.topbar-search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }

.icon-btn { width: 40px; height: 40px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; color: var(--text-muted); transition: all 0.2s; position: relative; }
.icon-btn:hover { background: var(--purple-light); color: var(--purple); border-color: var(--purple); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 2px solid #fff; }

.admin-user { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); transition: all 0.2s; }
.admin-user:hover { border-color: var(--purple); background: var(--purple-light); }
.admin-avatar { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--purple), #4F46E5); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 13px; }
.admin-user .info .name { font-size: 13px; font-weight: 700; color: var(--text); }
.admin-user .info .role { font-size: 10px; color: var(--text-muted); }

.page-content { flex: 1; padding: 24px 28px; }

/* ====== PAGE HEADER ====== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.page-header h2 { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.page-header p  { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
.page-header-actions { display: flex; gap: 10px; }

/* ====== STATS GRID ====== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; border-left: 4px solid transparent; transition: transform 0.2s, box-shadow 0.2s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card.purple { border-color: var(--purple); }
.stat-card.gold   { border-color: var(--gold); }
.stat-card.green  { border-color: var(--green); }
.stat-card.red    { border-color: var(--red); }
.stat-card.blue   { border-color: var(--blue); }
.stat-card.pink   { border-color: var(--pink); }

.stat-icon { width: 52px; height: 52px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.stat-card.purple .stat-icon { background: var(--purple-light); }
.stat-card.gold   .stat-icon { background: var(--gold-light); }
.stat-card.green  .stat-icon { background: var(--green-light); }
.stat-card.red    .stat-icon { background: var(--red-light); }
.stat-card.blue   .stat-icon { background: var(--blue-light); }
.stat-card.pink   .stat-icon { background: var(--pink-light); }

.stat-info h3 { font-size: 24px; font-weight: 800; }
.stat-info p  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-change { font-size: 11px; font-weight: 600; margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ====== CARDS ====== */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 22px; }

/* ====== TABLE ====== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 13px 16px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); background: var(--bg); border-bottom: 2px solid var(--border); white-space: nowrap; }
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FAFBFF; }

/* ====== BADGES ====== */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-success   { background: var(--green-light); color: #047857; }
.badge-danger    { background: var(--red-light); color: #B91C1C; }
.badge-warning   { background: var(--gold-light); color: #92400E; }
.badge-info      { background: var(--blue-light); color: #1D4ED8; }
.badge-secondary { background: #F1F5F9; color: #475569; }
.badge-primary   { background: var(--purple-light); color: var(--purple-dark); }
.badge-superadmin{ background: linear-gradient(135deg,var(--purple),#4F46E5); color:#fff; }
.badge-admin     { background: var(--blue-light); color: var(--blue); }
.badge-moderator { background: var(--green-light); color: var(--green); }

/* ====== BUTTONS ====== */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; white-space: nowrap; }
.btn-purple { background: linear-gradient(135deg, var(--purple), #4F46E5); color: #fff; }
.btn-purple:hover { background: linear-gradient(135deg, var(--purple-dark), #3730A3); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(124,58,237,0.4); }
.btn-gold   { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #fff; }
.btn-gold:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-green  { background: var(--green); color: #fff; }
.btn-green:hover { background: #059669; }
.btn-red    { background: var(--red); color: #fff; }
.btn-red:hover { background: #DC2626; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-light); }
.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }

/* ====== FORMS ====== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.form-control { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px; color: var(--text); background: #fff; outline: none; transition: border-color 0.2s; }
.form-control:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ====== ALERTS ====== */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; }
.alert-success { background: var(--green-light); color: #065F46; border-left: 4px solid var(--green); }
.alert-error   { background: var(--red-light); color: #991B1B; border-left: 4px solid var(--red); }
.alert-warning { background: var(--gold-light); color: #78350F; border-left: 4px solid var(--gold); }
.alert-info    { background: var(--blue-light); color: #1E40AF; border-left: 4px solid var(--blue); }

/* ====== CHART CONTAINER ====== */
.chart-container { padding: 16px 20px 20px; height: 280px; position: relative; }

/* ====== EMPTY STATE ====== */
.empty-state { text-align: center; padding: 50px 20px; }
.empty-state .empty-icon { font-size: 52px; margin-bottom: 14px; }
.empty-state h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); font-size: 13px; }

/* ====== PAGINATION ====== */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 7px 13px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1.5px solid var(--border); color: var(--text-muted); transition: all 0.2s; }
.pagination a:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-light); }
.pagination .active { background: var(--purple); color: #fff; border-color: var(--purple); }

/* ====== FILTER BAR ====== */
.filter-bar { background: var(--white); border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 18px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; box-shadow: var(--shadow); }
.filter-bar select, .filter-bar input { padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; outline: none; color: var(--text); background: var(--bg); }
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--purple); }

/* ====== INFO BOX ====== */
.info-box { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.info-row { display: flex; gap: 8px; font-size: 13px; }
.info-label { font-weight: 600; color: var(--text-muted); min-width: 140px; }
.info-value { color: var(--text); flex: 1; }

/* ====== AVATAR ====== */
.user-avatar-lg { width: 60px; height: 60px; border-radius: 14px; background: linear-gradient(135deg, var(--purple), #4F46E5); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: #fff; }
.user-avatar-sm { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, var(--gold), var(--gold-dark)); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; }

/* ====== MODAL ====== */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: var(--radius); width: 520px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { font-size: 20px; cursor: pointer; color: var(--text-muted); background: none; border: none; line-height: 1; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ====== PROGRESS ====== */
.progress { height: 8px; background: var(--border); border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 10px; background: linear-gradient(135deg, var(--purple), #4F46E5); transition: width 0.5s; }
.progress-bar.gold  { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); }
.progress-bar.green { background: var(--green); }
.progress-bar.red   { background: var(--red); }

/* ====== LOGIN PAGE ====== */
.login-page { min-height: 100vh; display: flex; background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 50%, #0F172A 100%); }
.login-left { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-right { width: 480px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 50px 45px; }
.login-brand .logo-wrap { font-size: 60px; margin-bottom: 20px; text-align: center; }
.login-brand h1 { font-size: 28px; font-weight: 900; color: #fff; margin-bottom: 10px; }
.login-brand h1 span { background: linear-gradient(135deg, var(--gold), #F97316); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-brand p { color: rgba(255,255,255,0.6); font-size: 14px; line-height: 1.7; }
.feature-list { margin-top: 30px; display: flex; flex-direction: column; gap: 14px; }
.feature-item { display: flex; gap: 12px; align-items: flex-start; }
.feature-icon { font-size: 20px; }
.feature-text h4 { color: #fff; font-size: 14px; font-weight: 600; }
.feature-text p  { color: rgba(255,255,255,0.5); font-size: 12px; margin-top: 2px; }

.login-form-wrap { width: 100%; }
.login-form-wrap h2 { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.login-form-wrap p  { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.login-logo .icon { font-size: 34px; }
.login-logo h3 { font-size: 16px; font-weight: 800; color: var(--purple); }

/* ====== DASHBOARD SPECIFIC ====== */
.activity-item { display: flex; gap: 13px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.activity-dot.purple { background: var(--purple); }
.activity-dot.gold   { background: var(--gold); }
.activity-dot.green  { background: var(--green); }
.activity-dot.red    { background: var(--red); }
.activity-text { flex: 1; }
.activity-text p { font-size: 13px; }
.activity-text span { font-size: 11px; color: var(--text-muted); }

/* ====== RESPONSIVE ====== */
@media (max-width: 1024px) {
  .sidebar { width: 70px; }
  .sidebar-logo-text, .sidebar-menu a span:not(.icon), .sidebar-menu a .badge, .menu-section, .sidebar-bottom a span { display: none; }
  .sidebar-menu a { justify-content: center; padding: 14px 10px; }
  .main-wrapper { margin-left: 70px; }
  .grid-2 { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { width: 100%; }
}
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar-search { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
