:root {
  --green: #1a5c2e;
  --green-mid: #2e7d32;
  --green-light: #4caf50;
  --gold: #f0c040;
  --blue: #0d2b6b;
  --white: #ffffff;
  --bg: #f4f6f8;
  --sidebar-bg: #0f1e0f;
  --sidebar-w: 240px;
  --text: #1a2332;
  --text-mid: #4a5568;
  --text-light: #718096;
  --border: #e2e8f0;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --transition: 0.25s ease;
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Outfit',sans-serif; background:var(--bg); color:var(--text); }

/* ===== LOGIN ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a1628 0%, #1a5c2e 100%);
  padding: 20px;
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  text-align: center;
}
.login-logo { margin-bottom: 20px; }
.login-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--green);
  margin-bottom: 4px;
}
.login-sub { color: var(--text-light); font-size: 0.85rem; margin-bottom: 32px; }
.login-card .form-group { text-align: left; margin-bottom: 18px; }
.login-card label { font-size: 0.82rem; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; display: block; }
.login-card input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.login-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,92,46,0.1); }
.btn-login {
  width: 100%;
  background: var(--green);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}
.btn-login:hover { background: var(--green-mid); }
.btn-login:disabled { background: #aaa; cursor: not-allowed; }
.login-error { color: #e53935; font-size: 0.82rem; margin-top: 12px; min-height: 20px; }
.back-link { display: block; margin-top: 20px; color: var(--text-light); text-decoration: none; font-size: 0.82rem; }
.back-link:hover { color: var(--green); }

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

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sb-logo {
  width: 42px; height: 42px;
  background: var(--green);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.sb-title { color: white; font-size: 0.88rem; font-weight: 600; }
.sb-sub { color: rgba(255,255,255,0.45); font-size: 0.72rem; }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.88rem;
  transition: var(--transition);
  cursor: pointer;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.1);
  color: white;
}
.nav-item.active { background: var(--green); color: white; }
.nav-icon { font-size: 1rem; }
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item.logout:hover { background: rgba(229,57,53,0.2); color: #ef9a9a; }

/* ===== MAIN ===== */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  background: white;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; }
.page-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--text); flex: 1; }
.admin-user { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-mid); }
.user-dot { width: 8px; height: 8px; border-radius: 50%; background: #4caf50; }

/* ===== TAB CONTENT ===== */
.tab-content { padding: 28px; }
.tab-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.tab-header h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--text); }
.tab-header p { color: var(--text-light); font-size: 0.84rem; margin-top: 2px; }
.btn-add {
  background: var(--green);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-add:hover { background: var(--green-mid); transform: translateY(-1px); }

/* ===== DATA TABLE ===== */
.data-table-wrap { overflow-x: auto; background: white; border-radius: var(--radius); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--green); }
.data-table th {
  padding: 14px 18px;
  text-align: left;
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.data-table td {
  padding: 14px 18px;
  font-size: 0.875rem;
  color: var(--text-mid);
  border-bottom: 1px solid #f0f4f0;
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #f7fdf7; }
.data-table tbody tr:last-child td { border-bottom: none; }
.loading-row { text-align: center; color: var(--text-light); padding: 40px !important; }
.action-btns { display: flex; gap: 8px; }
.btn-edit {
  background: #e3f2fd;
  color: #1565c0;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-edit:hover { background: #bbdefb; }
.btn-del {
  background: #ffebee;
  color: #c62828;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-del:hover { background: #ffcdd2; }
.badge {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-general { background: #e8f5e9; color: #2e7d32; }
.badge-urgent { background: #ffebee; color: #c62828; }
.badge-exam { background: #fff8e1; color: #f57f17; }

/* ===== GALLERY ADMIN ===== */
.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.gallery-admin-item {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}
.gallery-admin-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.gallery-admin-info {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gallery-admin-info span { font-size: 0.78rem; color: var(--text-mid); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}
.modal-sm { max-width: 380px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.modal-header h3 { font-family: 'Playfair Display', serif; font-size: 1.25rem; }
.modal-header button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-light);
  width: 32px; height: 32px;
  border-radius: 50%;
  transition: var(--transition);
}
.modal-header button:hover { background: #f0f0f0; color: var(--text); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  background: white;
  outline: none;
  transition: var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,92,46,0.1);
}
.form-group textarea { resize: vertical; }
.form-group input[type="file"] { padding: 8px 12px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.btn-cancel {
  background: var(--bg);
  color: var(--text-mid);
  border: 1.5px solid var(--border);
  padding: 10px 22px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-cancel:hover { background: #e2e8f0; }
.btn-save {
  background: var(--green);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-save:hover { background: var(--green-mid); }
.btn-save:disabled { background: #aaa; cursor: not-allowed; }
.btn-delete-confirm {
  background: #e53935;
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-delete-confirm:hover { background: #c62828; }
.modal-msg { margin-top: 12px; font-size: 0.82rem; min-height: 18px; }
.modal-msg.success { color: var(--green); }
.modal-msg.error { color: #e53935; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .mobile-menu-btn { display: block; }
  .tab-content { padding: 20px 16px; }
}

/* ===== SETTINGS ===== */
.settings-card {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  max-width: 620px;
}
.settings-section {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-of-type { border-bottom: none; margin-bottom: 16px; }
.settings-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 18px;
}

/* ===== LEADERSHIP ===== */
.leader-cards { display: flex; flex-direction: column; gap: 20px; }
.leader-preview-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 20px;
  border-left: 4px solid var(--green);
}
.leader-preview-card:nth-child(2) { border-left-color: var(--blue); }
.lp-photo {
  width: 80px; height: 80px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--green);
  display: flex; align-items: center; justify-content: center;
  background: #f0f7ee;
}
.lp-photo img { width: 100%; height: 100%; object-fit: cover; }
.lp-info { flex: 1; }
.lp-role {
  display: inline-block;
  background: #e8f5e9;
  color: var(--green);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.lp-info h3 { font-size: 1rem; color: var(--text); margin-bottom: 4px; }
.lp-msg {
  color: var(--text-light);
  font-size: 0.82rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== ADMIN USERS ===== */
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}
.admin-user-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 4px solid var(--green);
}
.admin-user-card.current-user { border-left-color: var(--gold); background: #fffdf0; }
.au-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #0d4a1f);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem; font-weight: 700;
  flex-shrink: 0;
}
.au-info { flex: 1; }
.au-name { font-weight: 600; font-size: 0.95rem; color: var(--text); margin-bottom: 2px; }
.au-email { font-size: 0.82rem; color: var(--text-light); }
.au-role {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
  background: #e8f5e9;
  color: var(--green);
}
.au-role.co-admin { background: #e3f2fd; color: var(--blue-mid); }
.au-role.editor { background: #fff8e1; color: #f57f17; }
.au-actions { display: flex; gap: 8px; flex-shrink: 0; }
.au-you-badge {
  font-size: 0.72rem;
  color: #f57f17;
  font-weight: 600;
  background: #fff8e1;
  padding: 3px 10px;
  border-radius: 10px;
  border: 1px solid #ffe082;
}
.admin-users-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #f0f7ff;
  border: 1px solid #bbdefb;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 8px;
}
.admin-users-note span { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.admin-users-note p { font-size: 0.84rem; color: #1565c0; line-height: 1.6; }
.max-reached {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.85rem;
  color: #f57f17;
  margin-bottom: 16px;
  display: none;
}
