/* ===================================================
   AFRIYOUTHHUB – Admin Panel CSS
   =================================================== */

:root {
  --green: #1B7A3E;
  --green-light: #27ae60;
  --green-dark: #145e30;
  --green-bg: #e8f5ed;
  --red: #C0392B;
  --red-light: #e74c3c;
  --red-bg: #fdecea;
  --white: #FFFFFF;
  --gray-50: #f8f9fa;
  --gray-100: #f2f4f7;
  --gray-200: #e9ecef;
  --gray-400: #adb5bd;
  --gray-600: #6c757d;
  --gray-800: #343a40;
  --dark: #1a1a2e;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
  --radius: 12px;
  --transition: all 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--gray-100);
  color: #2d3436;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
input, button, textarea, select { font-family: inherit; }

/* ==================== LOGIN ==================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 50%, #1a9c50 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.login-box {
  background: white;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
}
.login-logo h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
}
.login-logo p {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}

.form-group {
  margin-bottom: 1.1rem;
}
.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--gray-800);
}
.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.93rem;
  outline: none;
  transition: var(--transition);
}
.form-group input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27,122,62,0.12);
}

.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 3rem; }
.pass-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-600);
  font-size: 0.9rem;
}

.login-error {
  color: var(--red);
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
  min-height: 1.1rem;
}

.btn-login {
  width: 100%;
  padding: 0.85rem;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}
.btn-login:hover { background: var(--green-dark); transform: translateY(-2px); }

.login-hint {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 500;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  padding: 3px;
  flex-shrink: 0;
}
.sidebar-logo span {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
}
.sidebar-logo span small { font-size: 0.72rem; opacity: 0.6; font-weight: 400; }

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}
.sidebar-link i { width: 18px; text-align: center; }
.sidebar-link:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-link.active { background: var(--green); color: white; }

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: rgba(192,57,43,0.2);
  color: #ff9393;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}
.btn-logout:hover { background: var(--red); color: white; }

.sidebar-site-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
  border-radius: var(--radius);
  font-size: 0.82rem;
  transition: var(--transition);
}
.sidebar-site-link:hover { background: rgba(255,255,255,0.12); color: white; }

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

/* TOPBAR */
.topbar {
  height: var(--topbar-h);
  background: white;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 400;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--gray-800);
  padding: 0.3rem;
}

.topbar-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
  color: var(--dark);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  background: var(--gray-100);
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
}
.topbar-user i { color: var(--green); }

/* CONTENT AREA */
.content-area { padding: 1.75rem; }

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

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.page-header h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.page-header h1 i { color: var(--green); }
.page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* SEARCH */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 50px;
  padding: 0.45rem 1rem;
}
.search-box i { color: var(--gray-400); font-size: 0.85rem; }
.search-box input {
  border: none;
  outline: none;
  font-size: 0.875rem;
  width: 180px;
  background: transparent;
}

/* FILTER BUTTONS */
.filter-buttons { display: flex; gap: 0.4rem; }
.filter-btn {
  padding: 0.4rem 0.9rem;
  border: 1.5px solid var(--gray-200);
  background: white;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray-600);
}
.filter-btn:hover, .filter-btn.active { background: var(--green); color: white; border-color: var(--green); }

/* EXPORT BUTTON */
.btn-export {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--dark);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-export:hover { background: var(--green-dark); }

/* QUICK STATS */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.qstat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--gray-200);
}
.qstat-card i { font-size: 1.75rem; flex-shrink: 0; }
.qstat-card span { font-family: 'Poppins', sans-serif; font-size: 1.6rem; font-weight: 800; color: var(--dark); display: block; line-height: 1; }
.qstat-card p { font-size: 0.78rem; color: var(--gray-600); margin-top: 0.2rem; }

/* TABLE */
.table-wrapper {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1.5px solid var(--gray-200);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead tr {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}
.data-table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  white-space: nowrap;
}
.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  max-width: 200px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }

.loading-cell {
  text-align: center;
  color: var(--gray-400);
  padding: 3rem !important;
  font-size: 0.93rem;
}
.spinner-table {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--gray-400);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; }

/* BADGES / STATUS */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-warning { background: #fff3cd; color: #856404; }
.badge-success { background: var(--green-bg); color: var(--green-dark); }
.badge-danger  { background: var(--red-bg); color: var(--red); }
.badge-info    { background: #d1ecf1; color: #0c5460; }

/* ACTION BUTTONS */
.action-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: var(--transition);
}
.btn-accept  { background: var(--green-bg); color: var(--green); }
.btn-accept:hover  { background: var(--green); color: white; }
.btn-reject  { background: var(--red-bg); color: var(--red); }
.btn-reject:hover  { background: var(--red); color: white; }
.btn-view    { background: #d1ecf1; color: #0c5460; }
.btn-view:hover    { background: #0c5460; color: white; }
.btn-confirm { background: var(--green-bg); color: var(--green); }
.btn-confirm:hover { background: var(--green); color: white; }
.btn-delete  { background: #f8f9fa; color: var(--gray-600); }
.btn-delete:hover  { background: var(--red); color: white; }

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 1rem;
  flex-wrap: wrap;
}
.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-btn:hover, .page-btn.active { background: var(--green); color: white; border-color: var(--green); }

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat-big-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  border-top: 4px solid;
}
.stat-big-card.green { border-color: var(--green); }
.stat-big-card.red { border-color: var(--red); }
.stat-big-card.blue { border-color: #3498db; }
.stat-big-card.orange { border-color: #f39c12; }
.stat-big-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.green .stat-big-icon { background: var(--green-bg); color: var(--green); }
.red .stat-big-icon { background: var(--red-bg); color: var(--red); }
.blue .stat-big-icon { background: #d1ecf1; color: #0c5460; }
.orange .stat-big-icon { background: #fff3cd; color: #856404; }
.stat-big-card h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dark);
}
.stat-big-card p { font-size: 0.85rem; color: var(--gray-600); margin-top: 0.2rem; }

.stats-recent {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.stats-recent h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dark);
}
.stats-recent h3 i { color: var(--green); }
.stats-recent ul li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
  gap: 1rem;
}
.stats-recent ul li:last-child { border-bottom: none; }
.stats-recent ul li span { color: var(--gray-600); font-size: 0.78rem; }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-large {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s;
}
.modal-overlay.active .modal-large { transform: scale(1); }
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--gray-100);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}
.modal-close:hover { background: var(--red); color: white; }
.modal-large h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--dark);
  padding-right: 2rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.detail-item label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  display: block;
  margin-bottom: 0.2rem;
}
.detail-item p {
  font-size: 0.93rem;
  color: var(--dark);
  font-weight: 500;
  word-break: break-word;
}
.detail-item.full { grid-column: 1 / -1; }
.motivation-text {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 0.85rem;
  font-size: 0.9rem;
  color: var(--gray-800);
  line-height: 1.6;
  border: 1px solid var(--gray-200);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
}
.modal-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.875rem;
  transition: var(--transition);
}
.modal-btn-accept { background: var(--green); color: white; }
.modal-btn-accept:hover { background: var(--green-dark); }
.modal-btn-reject { background: var(--red); color: white; }
.modal-btn-reject:hover { background: #a93226; }
.modal-btn-neutral { background: var(--gray-100); color: var(--gray-600); }
.modal-btn-neutral:hover { background: var(--gray-200); }

/* TOAST */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  background: white;
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 360px;
  z-index: 5000;
  border-left: 4px solid var(--green);
  transform: translateX(-200%);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
}
.toast.show { transform: translateX(0); }
.toast.error { border-left-color: var(--red); }
.toast.error .toast-icon i { color: var(--red); }
.toast-icon i { font-size: 1.3rem; color: var(--green); }
.toast-content strong { display: block; font-size: 0.875rem; color: var(--dark); }
.toast-content p { font-size: 0.8rem; color: var(--gray-600); margin-top: 0.15rem; }
.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  margin-left: auto;
  font-size: 0.8rem;
}

/* TEXT TRUNCATE */
.truncate { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }

/* PAYMENT MODE BADGE */
.pay-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  background: var(--gray-100);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .quick-stats { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .quick-stats { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; }
  .page-actions { width: 100%; }
  .filter-buttons { flex-wrap: wrap; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .content-area { padding: 1rem; }
  .quick-stats { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}
