/* ==========================================
   AKOGUN SEC - ADMIN DASHBOARD STYLES
   Brand Colors: Navy, Blue, Orange, Red
========================================== */

:root {
  --admin-sidebar-bg: #052951;
  --admin-sidebar-hover: #0a3d75;
  --admin-sidebar-active: #f28c28;
  --admin-bg: #f4f7fc;
  --admin-surface: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text-main: #1e293b;
  --admin-text-muted: #64748b;
  --admin-primary: #073b7a;
  --admin-accent: #f28c28;
  --admin-danger: #dc2626;
  --admin-success: #16a34a;
  --admin-warning: #d97706;
  --admin-radius: 10px;
  --admin-shadow: 0 4px 20px rgba(5, 41, 81, 0.08);
}

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

body.admin-body {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text-main);
  min-height: 100vh;
  display: flex;
}

/* ==========================================
   LOGIN SCREEN
========================================== */
.admin-login-wrapper {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #041f40 0%, #073b7a 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--admin-surface);
  border-radius: 14px;
  padding: 40px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.login-logo {
  width: 170px;
  margin: 0 auto 20px;
  display: block;
}

.login-card h2 {
  font-family: "Manrope", sans-serif;
  font-size: 24px;
  color: var(--admin-primary);
  margin-bottom: 8px;
}

.login-card p.subtitle {
  color: var(--admin-text-muted);
  font-size: 13px;
  margin-bottom: 28px;
}

.login-field {
  text-align: left;
  margin-bottom: 18px;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--admin-text-main);
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-field input:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(7, 59, 122, 0.1);
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: var(--admin-accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.login-btn:hover {
  background: #dc7414;
}

.login-hint {
  margin-top: 20px;
  font-size: 11px;
  color: var(--admin-text-muted);
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px dashed var(--admin-border);
}

/* ==========================================
   ADMIN LAYOUT
========================================== */
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar-bg);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-header img {
  width: 135px;
  max-height: 48px;
  object-fit: contain;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-nav-item:hover {
  color: #ffffff;
  background: var(--admin-sidebar-hover);
}

.sidebar-nav-item.active {
  color: #ffffff;
  background: var(--admin-accent);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}

.admin-topbar {
  height: 68px;
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-content {
  padding: 30px;
  flex: 1;
}

/* ==========================================
   METRIC / STATS CARDS
========================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 22px;
  box-shadow: var(--admin-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-info h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--admin-text-muted);
  margin-bottom: 6px;
}

.stat-card-info .stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--admin-primary);
  font-family: "Manrope", sans-serif;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.stat-icon-blue { background: #e0f2fe; color: #0284c7; }
.stat-icon-orange { background: #ffedd5; color: #ea580c; }
.stat-icon-green { background: #dcfce7; color: #16a34a; }
.stat-icon-purple { background: #f3e8ff; color: #9333ea; }

/* ==========================================
   CARDS & TABLES
========================================== */
.admin-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
  margin-bottom: 30px;
  overflow: hidden;
}

.admin-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-card-header h2 {
  font-size: 18px;
  font-family: "Manrope", sans-serif;
  color: var(--admin-primary);
}

.admin-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.admin-table th {
  background: #f8fafc;
  padding: 12px 18px;
  color: var(--admin-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #fbfcfe;
}

.project-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  background: #e2e8f0;
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-blue { background: #e0f2fe; color: #0369a1; }

/* Buttons */
.btn-primary {
  background: var(--admin-primary);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.btn-accent {
  background: var(--admin-accent);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.btn-accent:hover {
  background: #dc7414;
}

.btn-danger-outline {
  background: transparent;
  color: var(--admin-danger);
  border: 1px solid var(--admin-danger);
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger-outline:hover {
  background: var(--admin-danger);
  color: #ffffff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* ==========================================
   PROJECT MODAL & FORM
========================================== */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 41, 81, 0.7);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.admin-modal.is-active {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal-dialog {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--admin-surface);
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

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

.admin-modal-header h3 {
  font-size: 18px;
  color: var(--admin-primary);
  font-family: "Manrope", sans-serif;
}

.admin-modal-body {
  padding: 24px;
}

/* Cloudinary Upload Dropzone */
.upload-dropzone {
  border: 2px dashed var(--admin-border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 18px;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--admin-accent);
  background: #fff8f0;
}

.upload-preview-container {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
  display: none;
  background: #000;
}

.upload-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-progress-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
  display: none;
}

.upload-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--admin-accent);
  transition: width 0.2s ease;
}

/* Form Groups */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--admin-text-main);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(7, 59, 122, 0.08);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  background: #1e293b;
  color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.3s ease forwards;
}

.toast-success { background: #15803d; }
.toast-error { background: #b91c1c; }
.toast-warning { background: #b45309; }

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

/* Responsive */
@media (max-width: 992px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-menu-btn {
    display: block;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}
