/* ============================================
   GHANADEALS V2 — ADMIN.CSS
   Dark Admin Dashboard Theme
   ============================================ */

/* Admin password modal */
.admin-password-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-password-modal {
  background: #1A1A2E;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.admin-password-modal .admin-lock-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  background: rgba(230,57,70,0.15);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #E63946;
}
.admin-password-modal .admin-lock-icon svg { width: 28px; height: 28px; }
.admin-password-modal h2 {
  color: #F0F0F0;
  font-size: 22px;
  margin-bottom: 8px;
  font-family: var(--font-display);
}
.admin-password-modal p {
  color: #6B7280;
  font-size: 14px;
  margin-bottom: 24px;
}
.admin-password-modal input {
  width: 100%;
  padding: 12px 16px;
  background: #0F0F1A;
  border: 1.5px solid #2A2A3E;
  border-radius: 10px;
  color: #F0F0F0;
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
  letter-spacing: 4px;
  font-family: var(--font-body);
}
.admin-password-modal input:focus {
  outline: none;
  border-color: #E63946;
  box-shadow: 0 0 0 3px rgba(230,57,70,0.15);
}
.admin-password-modal .admin-error {
  color: #E63946;
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}
.admin-password-modal .btn-admin-login {
  width: 100%;
  padding: 12px;
  background: #E63946;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: var(--font-body);
}
.admin-password-modal .btn-admin-login:hover { background: #cf2f3c; }

/* Admin layout */
.admin-page {
  display: none;
  background: #0F0F1A;
  min-height: 100vh;
  color: #F0F0F0;
}
.admin-page.active { display: flex; }

.admin-sidebar {
  width: 250px;
  background: #0A0A14;
  border-right: 1px solid #1A1A2E;
  min-height: 100vh;
  flex-shrink: 0;
  padding: 20px 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
}
.admin-sidebar .admin-logo {
  padding: 0 20px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #F0F0F0;
}
.admin-sidebar .admin-logo svg { width: 24px; height: 24px; color: #E63946; }
.admin-sidebar .admin-logo span { color: #E63946; }

.admin-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #6B7280;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
}
.admin-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-nav-item:hover {
  color: #F0F0F0;
  background: rgba(255,255,255,0.05);
}
.admin-nav-item.active {
  color: #E63946;
  background: rgba(230,57,70,0.1);
}

.admin-nav-divider {
  height: 1px;
  background: #1A1A2E;
  margin: 12px 16px;
}

.admin-sidebar-footer {
  padding: 16px 20px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}
.admin-sidebar-footer button {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6B7280;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  font-family: var(--font-body);
}
.admin-sidebar-footer button:hover { color: #F0F0F0; }
.admin-sidebar-footer button svg { width: 16px; height: 16px; }

/* Admin main content */
.admin-main {
  flex: 1;
  padding: 24px 30px;
  min-width: 0;
  overflow-x: hidden;
}
.admin-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.admin-main-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #F0F0F0;
  font-family: var(--font-display);
}
.admin-main-header .admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Admin stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.admin-stat-card {
  background: #1A1A2E;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.05);
}
.admin-stat-card .stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.admin-stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-stat-card .stat-icon svg { width: 20px; height: 20px; }
.admin-stat-card .stat-icon.red { background: rgba(230,57,70,0.15); color: #E63946; }
.admin-stat-card .stat-icon.blue { background: rgba(59,130,246,0.15); color: #3B82F6; }
.admin-stat-card .stat-icon.green { background: rgba(16,185,129,0.15); color: #10B981; }
.admin-stat-card .stat-icon.yellow { background: rgba(245,158,11,0.15); color: #F59E0B; }
.admin-stat-card .stat-change {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.admin-stat-card .stat-change.up { background: rgba(16,185,129,0.15); color: #10B981; }
.admin-stat-card .stat-change.down { background: rgba(230,57,70,0.15); color: #E63946; }
.admin-stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  font-family: var(--font-display);
}
.admin-stat-card .stat-label {
  font-size: 13px;
  color: #6B7280;
}

/* Admin cards */
.admin-card {
  background: #1A1A2E;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.05);
}
.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.admin-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #F0F0F0;
  font-family: var(--font-display);
}

/* Admin table */
.admin-table-wrap {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table thead th {
  padding: 12px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6B7280;
  border-bottom: 1px solid #1A1A2E;
  white-space: nowrap;
}
.admin-table tbody td {
  padding: 12px 14px;
  font-size: 14px;
  color: #D1D5DB;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  white-space: nowrap;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}
.admin-table .table-img {
  width: 48px; height: 36px;
  border-radius: 6px;
  object-fit: cover;
}
.admin-table .status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.admin-table .status-badge.active { background: rgba(16,185,129,0.15); color: #10B981; }
.admin-table .status-badge.pending { background: rgba(245,158,11,0.15); color: #F59E0B; }
.admin-table .status-badge.inactive { background: rgba(230,57,70,0.15); color: #E63946; }
.admin-table .table-actions {
  display: flex;
  gap: 6px;
}
.admin-table .table-actions button {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-body);
}
.admin-table .table-actions button svg { width: 14px; height: 14px; }
.admin-table .table-actions .btn-edit {
  background: rgba(59,130,246,0.15);
  color: #3B82F6;
}
.admin-table .table-actions .btn-edit:hover { background: rgba(59,130,246,0.25); }
.admin-table .table-actions .btn-delete {
  background: rgba(230,57,70,0.15);
  color: #E63946;
}
.admin-table .table-actions .btn-delete:hover { background: rgba(230,57,70,0.25); }

/* Admin charts area */
.admin-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.admin-chart-card { min-height: 320px; }
.admin-chart-card canvas { max-height: 280px; }

/* Admin modal */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-modal-overlay.open { display: flex; }
.admin-modal {
  background: #1A1A2E;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.admin-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #F0F0F0;
  font-family: var(--font-display);
}
.admin-modal-header .modal-close-admin {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #6B7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}
.admin-modal-header .modal-close-admin:hover { color: #F0F0F0; }
.admin-modal-header .modal-close-admin svg { width: 16px; height: 16px; }

.admin-form-group {
  margin-bottom: 16px;
}
.admin-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #9CA3AF;
  margin-bottom: 6px;
}
.admin-form-group input,
.admin-form-group select,
.admin-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: #0F0F1A;
  border: 1.5px solid #2A2A3E;
  border-radius: 10px;
  color: #F0F0F0;
  font-size: 14px;
  font-family: var(--font-body);
}
.admin-form-group input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus {
  outline: none;
  border-color: #E63946;
}
.admin-form-group textarea { min-height: 80px; resize: vertical; }
.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.admin-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #2A2A3E;
}
.admin-modal-footer .btn-cancel {
  padding: 10px 20px;
  background: rgba(255,255,255,0.05);
  color: #9CA3AF;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  font-family: var(--font-body);
}
.admin-modal-footer .btn-cancel:hover { background: rgba(255,255,255,0.1); color: #F0F0F0; }
.admin-modal-footer .btn-save {
  padding: 10px 24px;
  background: #E63946;
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  font-family: var(--font-body);
}
.admin-modal-footer .btn-save:hover { background: #cf2f3c; }

/* Admin sections visibility */
.admin-section { display: none; }
.admin-section.active { display: block; animation: page-in 0.3s ease; }

/* Admin responsive */
@media (max-width: 1024px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-main { padding: 16px; }
  .admin-stats { grid-template-columns: 1fr; }
  .admin-form-row { grid-template-columns: 1fr; }
}
