/* ============================================================
   admin.css  —  AcademiaHub Admin Panel
   ============================================================ */

:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-soft:  #eff6ff;
  --secondary:     #7c3aed;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #0ea5e9;
  --dark:          #0f172a;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --bg:            #f1f5f9;
  --white:         #ffffff;
  --sidebar-w:     260px;
  --header-h:      64px;
  --radius:        12px;
  --shadow:        0 4px 20px rgba(15,23,42,.07);
  --font:          'DM Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body.admin-body { font-family: var(--font); background: var(--bg); color: var(--text); }
a { text-decoration: none; }

/* ── Layout ────────────────────────────────────────────────── */
.admin-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 1000;
  transition: transform .25s;
}
.admin-sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px; color: var(--white);
}
.logo-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px;
}
.logo-text { font-size: 15px; font-weight: 700; letter-spacing: -.3px; }

.sidebar-nav { flex: 1; padding: 12px 12px; }

.nav-section { margin-bottom: 20px; }
.nav-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.35); font-weight: 700;
  padding: 0 10px 6px; display: block;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  color: rgba(255,255,255,.65); font-size: 13.5px; font-weight: 500;
  transition: all .18s; cursor: pointer; margin-bottom: 2px;
  position: relative;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-item span { flex: 1; }
.nav-item:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item.active {
  background: var(--primary); color: var(--white);
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
}
.nav-badge {
  background: var(--danger); color: var(--white);
  font-size: 10px; font-weight: 700; min-width: 20px;
  height: 20px; border-radius: 50px; text-align: center;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}

.sidebar-footer {
  padding: 16px; border-top: 1px solid rgba(255,255,255,.08);
}
.admin-user-info { display: flex; align-items: center; gap: 10px; }
.admin-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.admin-name { font-size: 13px; font-weight: 600; color: var(--white); }
.admin-role { font-size: 11px; color: rgba(255,255,255,.45); }

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

/* ── Header ────────────────────────────────────────────────── */
.admin-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px; position: sticky; top: 0; z-index: 900;
  box-shadow: var(--shadow);
}
.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; padding: 4px;
  transition: color .2s;
}
.sidebar-toggle:hover { color: var(--primary); }
.admin-page-title { font-size: 17px; font-weight: 700; }
.admin-notif-bell {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer; position: relative;
  font-size: 15px;
}
.notif-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; background: var(--danger);
  border-radius: 50%; border: 2px solid var(--white);
}

/* ── Content ───────────────────────────────────────────────── */
.admin-content { padding: 28px; flex: 1; }

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-card {
  background: var(--white); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  border: 1px solid var(--border); position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.stat-card.blue::before  { background: var(--primary); }
.stat-card.yellow::before { background: var(--warning); }
.stat-card.green::before  { background: var(--success); }
.stat-card.purple::before { background: var(--secondary); }

.stat-card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.stat-card.blue   .stat-card-icon { background: #eff6ff; color: var(--primary); }
.stat-card.yellow .stat-card-icon { background: #fffbeb; color: var(--warning); }
.stat-card.green  .stat-card-icon { background: #f0fdf4; color: var(--success); }
.stat-card.purple .stat-card-icon { background: #f5f3ff; color: var(--secondary); }

.stat-card-value { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--dark); }
.stat-card-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.stat-card-trend { font-size: 12px; font-weight: 600; }
.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--danger); }

/* Mini Stat Cards */
.mini-stat-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border-radius: var(--radius);
  color: var(--white); font-size: 14px; font-weight: 600;
  transition: all .2s;
}
.mini-stat-card:hover { filter: brightness(1.08); transform: translateY(-1px); }
.mini-stat-card.orange { background: linear-gradient(135deg, #ea580c, #f97316); }
.mini-stat-card.red    { background: linear-gradient(135deg, #dc2626, #ef4444); }
.mini-stat-card.blue   { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.mini-stat-card i { font-size: 1.2rem; flex-shrink: 0; }

/* ── Admin Cards ───────────────────────────────────────────── */
.admin-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
}
.admin-card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.admin-card-title { font-size: 15px; font-weight: 700; margin: 0; display: flex; align-items: center; }
.admin-card-body { padding: 20px; }

/* ── Quick Actions ─────────────────────────────────────────── */
.quick-action-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 600; transition: all .18s;
  color: var(--white);
}
.quick-action-btn i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.quick-action-btn:hover { transform: translateX(4px); color: var(--white); }
.quick-action-btn.primary { background: linear-gradient(135deg,#2563eb,#3b82f6); }
.quick-action-btn.warning { background: linear-gradient(135deg,#d97706,#f59e0b); }
.quick-action-btn.orange  { background: linear-gradient(135deg,#ea580c,#f97316); }
.quick-action-btn.green   { background: linear-gradient(135deg,#059669,#10b981); }
.quick-action-btn.purple  { background: linear-gradient(135deg,#6d28d9,#7c3aed); }
.quick-action-btn.blue    { background: linear-gradient(135deg,#0369a1,#0ea5e9); }

/* ── Table ─────────────────────────────────────────────────── */
.admin-table { margin: 0; }
.admin-table thead th {
  background: var(--bg); font-size: 11px; text-transform: uppercase;
  letter-spacing: .07em; font-weight: 700; color: var(--text-muted);
  padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.admin-table tbody td { padding: 12px 16px; vertical-align: middle; font-size: 14px; border-bottom: 1px solid var(--border); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg); }

.rank-num {
  width: 26px; height: 26px; background: var(--bg);
  border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.rating-pill { background: #fffbeb; color: #92400e; padding: 2px 8px; border-radius: 50px; font-size: 12px; font-weight: 700; }

/* ── Activity Feed ─────────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.bg-warning-soft { background: #fffbeb; }
.bg-info-soft    { background: #f0f9ff; }
.bg-primary-soft { background: #eff6ff; }
.bg-success-soft { background: #f0fdf4; }
.text-warning { color: #d97706 !important; }
.text-info    { color: #0ea5e9 !important; }
.text-primary { color: #2563eb !important; }
.text-success { color: #10b981 !important; }
.activity-desc { font-size: 13px; font-weight: 500; margin: 0; line-height: 1.4; }
.activity-time { font-size: 11px; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-section {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  margin-bottom: 24px; overflow: hidden;
}
.form-section-title {
  padding: 16px 24px; font-size: 14px; font-weight: 700;
  border-bottom: 1px solid var(--border); background: var(--bg);
  display: flex; align-items: center; gap: 8px;
}
.form-section-body { padding: 24px; }

.admin-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.admin-input, .admin-select, .admin-textarea {
  font-family: var(--font); font-size: 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 10px 14px; width: 100%; transition: all .2s;
}
.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-track {
  width: 44px; height: 24px; background: var(--border);
  border-radius: 50px; transition: background .2s; position: relative;
}
.toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; background: var(--white);
  border-radius: 50%; transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-track { background: var(--success); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(20px); }
.toggle-label { font-size: 13px; font-weight: 600; }

/* Image Upload Area */
.upload-area {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 32px; text-align: center; cursor: pointer;
  transition: all .2s;
}
.upload-area:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-icon { font-size: 2rem; color: var(--text-muted); margin-bottom: 8px; }
.upload-text { font-size: 14px; color: var(--text-muted); }
.upload-preview { max-width: 100%; border-radius: 8px; margin-top: 12px; max-height: 180px; object-fit: cover; }

/* Rich Text Hint */
.editor-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Badges ────────────────────────────────────────────────── */
.badge-status-new      { background: #dbeafe; color: #1e40af; }
.badge-status-contacted { background: #d1fae5; color: #065f46; }
.badge-status-converted { background: #ede9fe; color: #5b21b6; }
.badge-status-closed   { background: #f1f5f9; color: #475569; }
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-approved  { background: #d1fae5; color: #065f46; }
.badge-rejected  { background: #fee2e2; color: #991b1b; }

/* ── Filters Row ───────────────────────────────────────────── */
.admin-filter-bar {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-bottom: 20px;
}
.admin-filter-bar .form-control,
.admin-filter-bar .form-select {
  font-size: 13px; border-radius: 8px; max-width: 200px;
}

/* ── Pagination ────────────────────────────────────────────── */
.admin-pagination {
  display: flex; justify-content: between; align-items: center;
  padding: 16px 20px; border-top: 1px solid var(--border);
  background: var(--bg); gap: 8px;
}

/* ── Login Page ────────────────────────────────────────────── */
.admin-login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--dark) 0%, #1e3a8a 100%);
}
.login-card {
  background: var(--white); border-radius: 24px;
  padding: 48px; width: 100%; max-width: 440px;
  box-shadow: 0 32px 80px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon { width: 60px; height: 60px; font-size: 22px; margin: 0 auto 12px; }
.login-title { font-size: 1.6rem; font-weight: 800; text-align: center; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 991px) {
  .admin-sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}
