/* ============================================================
   Dashboard CSS — Admin, Student, Super Admin
   Fixed: text visibility, table contrast, nav overflow
   ============================================================ */

/* ── Reset for dashboard ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.dashboard-body {
  font-family: -apple-system, 'Segoe UI', sans-serif;
  background: #F1F3F8;
  color: #1A1A2E;
  min-height: 100vh;
  line-height: 1.5;
}

.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ════════════════════════════
   SIDEBAR
════════════════════════════ */
.dash-sidebar {
  width: 240px;
  min-width: 240px;
  background: #12151F;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.dash-brand {
  padding: 20px 22px;
  font-size: 1.35rem;
  font-weight: 900;
  font-family: 'Playfair Display', Georgia, serif;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  letter-spacing: -0.5px;
}
.dash-brand .brand-fame { color: #C8102E; }
.dash-brand .brand-asco { color: #fff; }

.dash-user {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  gap: 12px;
  align-items: center;
}
.dash-avatar {
  width: 44px; height: 44px;
  background: rgba(200,16,46,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #C8102E; flex-shrink: 0;
}
.dash-avatar-super { background: rgba(232,184,75,0.2); color: #E8B84B; }
.dash-user strong  { font-size: 0.88rem; color: #fff; display: block; }

.role-badge {
  display: inline-block; font-size: 0.62rem;
  padding: 2px 8px; border-radius: 20px;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; margin-top: 3px;
}
.role-student    { background: rgba(34,197,94,0.2);    color: #4ADE80; }
.role-admin      { background: rgba(59,130,246,0.2);   color: #60A5FA; }
.role-superadmin { background: rgba(232,184,75,0.2);   color: #E8B84B; }

/* Sidebar nav */
.dash-nav { padding: 12px 0; flex: 1; }

.dash-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 22px;
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem; font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.dash-link i { width: 18px; text-align: center; font-size: 0.9rem; }
.dash-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.dash-link.active { color: #fff; background: rgba(200,16,46,0.15); border-left-color: #C8102E; }
.dash-link .badge {
  margin-left: auto; background: #C8102E; color: #fff;
  border-radius: 20px; padding: 1px 8px; font-size: 0.68rem;
}
.dash-logout { color: #F87171 !important; }
.dash-logout:hover { background: rgba(239,68,68,0.1) !important; }

/* ════════════════════════════
   MAIN CONTENT AREA
════════════════════════════ */
.dash-main {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  min-width: 0; /* prevent overflow */
}

.dash-topbar {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-topbar h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1A1A2E;
  display: flex; align-items: center; gap: 10px;
}
.dash-topbar h1 i { color: #C8102E; }

/* ════════════════════════════
   STAT CARDS
════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  border-left: 4px solid #e5e7eb;
}
.stat-card span {
  display: block;
  font-size: 2rem; font-weight: 700;
  color: #1A1A2E;           /* ← always dark */
  line-height: 1; margin-bottom: 6px;
}
.stat-card label {
  font-size: 0.75rem; color: #6B7280;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.stat-warning { border-left-color: #F59E0B; }
.stat-info    { border-left-color: #3B82F6; }
.stat-success { border-left-color: #10B981; }
.stat-danger  { border-left-color: #EF4444; }
.stat-primary { border-left-color: #C8102E; }

/* ════════════════════════════
   DASHBOARD CARDS
════════════════════════════ */
.dash-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  margin-bottom: 24px;
  overflow: hidden;
}
.dash-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid #F3F4F6;
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 12px;
  background: #fff;
}
.dash-card-header h2 {
  font-size: 1.02rem; font-weight: 700;
  color: #1A1A2E;       /* ← dark text */
  display: flex; align-items: center; gap: 8px;
}
.dash-card-header h2 i { color: #C8102E; }

/* ════════════════════════════
   TABLES — visible text fix
════════════════════════════ */
.articles-table-wrap { overflow-x: auto; }

.articles-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.855rem;
}
.articles-table th {
  background: #F8F9FA;
  padding: 11px 16px;
  text-align: left;
  font-weight: 700;
  color: #374151;       /* ← visible dark header */
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid #E5E7EB;
  white-space: nowrap;
}
.articles-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: middle;
  color: #1A1A2E;       /* ← always dark text */
}
.articles-table tbody tr:hover { background: #FAFAFA; }
.empty-row { text-align: center; color: #9CA3AF; padding: 32px !important; }

/* ════════════════════════════
   FILTER & FORM ELEMENTS
════════════════════════════ */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
  padding: 6px 14px; border-radius: 20px;
  font-size: 0.76rem; background: #F3F4F6;
  color: #374151;           /* dark label */
  border: 1px solid #E5E7EB;
  transition: all 0.2s; cursor: pointer; text-decoration: none;
}
.filter-btn.active, .filter-btn:hover { background: #C8102E; color: #fff; border-color: #C8102E; }

.filter-form select {
  padding: 8px 12px; border: 1px solid #E5E7EB;
  border-radius: 6px; font-size: 0.85rem;
  background: #fff; cursor: pointer; color: #1A1A2E;
}

/* ════════════════════════════
   ARTICLE FORM
════════════════════════════ */
.article-form { padding: 24px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-group { margin-bottom: 18px; flex: 1; min-width: 200px; }
.flex-2 { flex: 2; }
.form-group label {
  display: block; font-size: 0.82rem; font-weight: 600;
  margin-bottom: 6px; color: #374151;   /* visible label */
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid #E5E7EB; border-radius: 6px;
  font-size: 0.9rem; font-family: inherit;
  transition: border-color 0.2s;
  background: #fff; color: #1A1A2E;     /* dark input text */
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: #C8102E;
  box-shadow: 0 0 0 3px rgba(200,16,46,0.08);
}
.form-group textarea { resize: vertical; font-family: inherit; line-height: 1.6; }
.form-actions { display: flex; gap: 12px; padding-top: 8px; flex-wrap: wrap; }

/* ════════════════════════════
   FILE UPLOAD / DROP ZONE
════════════════════════════ */
.file-upload-area {
  border: 2px dashed #E5E7EB; border-radius: 8px;
  padding: 32px; text-align: center; cursor: pointer;
  transition: border-color 0.2s; position: relative;
}
.file-upload-area:hover { border-color: #C8102E; }
.file-upload-area i   { font-size: 2.2rem; color: #9CA3AF; margin-bottom: 10px; }
.file-upload-area p   { color: #374151; margin-bottom: 4px; }
.file-upload-area small { color: #9CA3AF; font-size: 0.78rem; }
.file-upload-area input[type="file"] {
  position: absolute; inset: 0; opacity: 0;
  cursor: pointer; width: 100%; height: 100%;
}

/* ════════════════════════════
   TAB CONTENT
════════════════════════════ */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ════════════════════════════
   ARTICLE REVIEW CARDS
════════════════════════════ */
.article-review-card {
  padding: 20px 24px;
  border-bottom: 1px solid #F3F4F6;
}
.article-review-card:last-child { border-bottom: none; }
.arc-header { display: flex; gap: 14px; margin-bottom: 10px; }
.arc-thumb {
  width: 96px; height: 68px;
  object-fit: cover; border-radius: 5px; flex-shrink: 0;
}
.arc-thumb-placeholder {
  width: 96px; height: 68px;
  background: #F3F4F6; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: #D1D5DB; font-size: 1.5rem; flex-shrink: 0;
}
.arc-info { flex: 1; }
.arc-info h3 {
  font-size: 0.98rem; color: #1A1A2E;   /* visible title */
  margin: 6px 0 8px; line-height: 1.4;
}
.arc-meta {
  display: flex; gap: 12px; font-size: 0.76rem;
  color: #6B7280; flex-wrap: wrap; align-items: center;
}
.arc-excerpt {
  font-size: 0.86rem; color: #4B5563;   /* visible excerpt */
  line-height: 1.6; margin-bottom: 14px;
}
.arc-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reject-form { margin-top: 12px; padding: 14px; background: #FEF2F2; border-radius: 8px; }
.reject-form textarea {
  width: 100%; padding: 10px; border: 1px solid #FECACA;
  border-radius: 6px; font-size: 0.85rem; margin-bottom: 10px;
  resize: vertical; color: #1A1A2E;
}
.rejection-note { font-size: 0.75rem; color: #9CA3AF; cursor: help; }

/* ════════════════════════════
   QUICK ACTIONS
════════════════════════════ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px; padding: 24px;
}
.qa-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 20px; background: #F8F9FA;
  border-radius: 10px; border: 1px solid #E5E7EB;
  font-weight: 600; color: #1A1A2E;     /* visible text */
  font-size: 0.88rem; transition: all 0.2s;
  cursor: pointer; text-decoration: none;
}
.qa-btn i { font-size: 1.2rem; color: #C8102E; }
.qa-btn:hover { background: #1A1A2E; color: #fff; border-color: #1A1A2E; }
.qa-btn:hover i { color: #E8B84B; }
.qa-urgent { background: #FEF3C7; border-color: #FCD34D; }
.qa-urgent .badge {
  background: #C8102E; color: #fff;
  padding: 2px 8px; border-radius: 20px;
  font-size: 0.7rem; margin-left: auto;
}

/* ════════════════════════════
   INLINE FORM (categories)
════════════════════════════ */
.inline-form { padding: 20px 24px; border-bottom: 1px solid #F3F4F6; }
.inline-form .form-row { display: flex; gap: 12px; align-items: flex-end; }
.inline-form input {
  padding: 10px 14px; border: 1.5px solid #E5E7EB;
  border-radius: 6px; font-size: 0.9rem;
  min-width: 260px; color: #1A1A2E;
  background: #fff;
}
.inline-form input:focus { outline: none; border-color: #C8102E; }

/* ════════════════════════════
   SMALL ACTION BUTTONS
════════════════════════════ */
.btn-xs {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; border-radius: 4px;
  font-size: 0.74rem; font-weight: 600;
  cursor: pointer; border: none;
  text-decoration: none; transition: all 0.2s; white-space: nowrap;
}
.btn-view    { background: #EFF6FF; color: #1D4ED8; }
.btn-edit    { background: #FFFBEB; color: #92400E; }
.btn-approve { background: #ECFDF5; color: #065F46; }
.btn-reject  { background: #FEF2F2; color: #991B1B; }
.btn-publish { background: #1A1A2E; color: #fff; }
.btn-feature { background: #FFFBEB; color: #92400E; }
.btn-warning { background: #FEF3C7; color: #92400E; }
.btn-danger  { background: #EF4444; color: #fff; }
.btn-sm { padding: 7px 16px; font-size: 0.82rem; }

/* ════════════════════════════
   ALERTS
════════════════════════════ */
.alert {
  padding: 12px 16px; border-radius: 6px;
  margin-bottom: 16px; font-size: 0.88rem;
  display: flex; align-items: center; gap: 10px;
}
.alert i { flex-shrink: 0; }
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* ════════════════════════════
   STATUS BADGES
════════════════════════════ */
.status-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 0.68rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
}
.status-draft     { background: #F3F4F6; color: #374151; }
.status-pending   { background: #FEF3C7; color: #92400E; }
.status-approved  { background: #DBEAFE; color: #1E40AF; }
.status-published { background: #D1FAE5; color: #065F46; }
.status-rejected  { background: #FEE2E2; color: #991B1B; }

/* ════════════════════════════
   BUTTONS (shared)
════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border: none; border-radius: 6px;
  font-size: 0.88rem; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: all 0.2s; text-decoration: none;
}
.btn-primary   { background: #C8102E; color: #fff; }
.btn-primary:hover  { background: #9B0B22; transform: translateY(-1px); }
.btn-secondary { background: #374151; color: #fff; }
.btn-secondary:hover { background: #1F2937; }
.btn-block     { width: 100%; justify-content: center; }

/* ════════════════════════════
   RESPONSIVE — mobile sidebar
════════════════════════════ */
@media (max-width: 768px) {
  .dashboard-wrapper { flex-direction: column; }
  .dash-sidebar {
    width: 100%; height: auto;
    position: relative; flex-direction: row;
    flex-wrap: wrap; padding: 0;
  }
  .dash-brand { padding: 14px 16px; font-size: 1.1rem; }
  .dash-user  { display: none; }
  .dash-nav   { display: flex; flex-wrap: wrap; padding: 4px 0; flex: 1; }
  .dash-link  { padding: 10px 14px; font-size: 0.78rem; border-left: none; border-bottom: 2px solid transparent; }
  .dash-link.active { border-left: none; border-bottom-color: #C8102E; }
  .dash-main  { padding: 16px; }
  .stats-row  { grid-template-columns: repeat(2, 1fr); }
  .form-row   { flex-direction: column; }
  .articles-table { font-size: 0.78rem; }
  .articles-table th,
  .articles-table td { padding: 9px 10px; }
}
