/* ===================================================================
   YAYASAN DAR EL-IMAN PADANG - ADMIN DASHBOARD STYLESHEET
   Design: Modern Islamic Emerald & Gold Luxury Dashboard, Clean & Responsive
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #0b5034;
  --primary-dark: #073824;
  --primary-light: #127951;
  --primary-subtle: #eafaf1;
  
  --secondary: #d97706;
  --secondary-light: #f59e0b;
  --secondary-subtle: #fffbeb;

  --accent-emerald: #10b981;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;

  --bg-body: #f1f5f9;
  --bg-sidebar: #072e1f;
  --bg-card: #ffffff;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-white: #ffffff;

  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(11, 80, 52, 0.12);

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.25s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================
   SIDEBAR
   ========================================== */
.admin-sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: var(--transition);
  border-right: 1px solid rgba(245, 158, 11, 0.2);
}

.sidebar-brand {
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.15);
  min-height: 58px;
}

.admin-sidebar-logo {
  max-height: 34px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.25s ease;
}

.admin-sidebar-logo:hover {
  transform: scale(1.05);
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.menu-category-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.08em;
  padding: 0.75rem 0.75rem 0.35rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.sidebar-item i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  color: var(--secondary-light);
}

.sidebar-item:hover, .sidebar-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-item.active {
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  box-shadow: 0 4px 12px rgba(18, 121, 81, 0.3);
}

.sidebar-item .badge-count {
  margin-left: auto;
  font-size: 0.7rem;
  background: var(--secondary);
  color: #fff;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.sidebar-footer {
  padding: 1.25rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-footer .btn {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: var(--transition);
}

/* ==========================================
   MAIN CONTENT WRAPPER
   ========================================== */
.admin-main {
  margin-left: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* TOPBAR */
.admin-topbar {
  background: #fff;
  height: 70px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-visit-site {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  border: 1px solid var(--primary-light);
  transition: var(--transition);
}

.btn-visit-site:hover {
  background: var(--primary);
  color: #fff;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border-color);
}

.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.profile-info h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.profile-info p {
  font-size: 0.72rem;
  color: var(--secondary);
  font-weight: 600;
}

/* ==========================================
   VIEW CONTAINER & CARDS
   ========================================== */
.admin-content {
  padding: 2rem;
  flex: 1;
}

.admin-view-panel {
  display: none;
}

.admin-view-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.stat-text h3 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 0.2rem;
}

.stat-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-card.gold .stat-icon-wrap {
  background: var(--secondary-subtle);
  color: var(--secondary);
}

/* Admin Card Container */
.admin-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  overflow: hidden;
}

.admin-card-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
}

.admin-card-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-card-body {
  padding: 1.75rem;
}

/* Modern Tables */
.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th {
  background: var(--bg-body);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1.5px solid var(--border-color);
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-primary { background: var(--primary-subtle); color: var(--primary); }
.badge-info { background: #e0f2fe; color: #0369a1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-light);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover {
  background: var(--secondary-light);
}

.btn-danger {
  background: var(--accent-red);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 80, 52, 0.12);
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* Modals */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.admin-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.admin-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transform: translateY(15px);
  transition: var(--transition);
}

.admin-modal-overlay.active .admin-modal {
  transform: translateY(0);
}

.admin-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.admin-modal-body {
  padding: 1.5rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: #1e293b;
  color: #fff;
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  animation: slideToast 0.3s ease;
  border-left: 4px solid var(--accent-emerald);
}

.toast.error {
  border-left-color: var(--accent-red);
}

.toast.warning {
  border-left-color: #f59e0b;
}

.toast.info {
  border-left-color: #3b82f6;
}

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Logo Upload Styles */
.logo-upload-container {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  align-items: start;
  background: var(--bg-body);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border-color);
}

.logo-preview-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.logo-preview-box {
  width: 110px;
  height: 110px;
  background: linear-gradient(135deg, #072e1f 0%, #0f6848 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--secondary);
  overflow: hidden;
  position: relative;
}

.logo-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.logo-preview-box i {
  font-size: 3rem;
  color: #fbbf24;
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-file-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #fff;
  border: 1.5px solid var(--border-color);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.btn-file-upload:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-subtle);
}

/* Responsive */
@media (max-width: 900px) {
  .admin-sidebar {
    left: -280px;
  }
  .admin-sidebar.open {
    left: 0;
  }
  .admin-main {
    margin-left: 0;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.col-span-2 {
    grid-column: span 1;
  }
  .logo-upload-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* Alert Banner */
.cc-alert { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem; font-size: 0.88rem; }
.cc-alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.cc-alert-warning i { font-size: 1.3rem; color: #d97706; }
.cc-alert button { margin-left: auto; }


/* Password Field with Eye Toggle */
.admin-input-eye-group { position: relative; display: flex; align-items: center; }
.admin-input-eye-group .form-control { padding-right: 2.75rem; }
.btn-toggle-eye { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: #64748b; cursor: pointer; padding: 0.35rem; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; transition: color 0.2s ease; }
.btn-toggle-eye:hover { color: var(--primary); }

