/* =============================================
   ADMIN PANEL — SHELL & SIDEBAR STYLES
   ============================================= */

/* Reset admin root */
.admin-app {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background-color: #ffffff;
  position: relative;
  font-family: var(--font-family);
}

/* =============================================
   SIDEBAR
   ============================================= */
.admin-sidebar {
  width: 240px;
  min-height: 100vh;
  background-color: #ffffff;
  border-right: 1.5px solid #edf2f7;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 500;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 2px 0 12px rgba(0,0,0,0.04);
}

/* Sidebar Logo Section */
.admin-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1.5px solid #f0f4f8;
  min-height: 68px;
}

.admin-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}

.admin-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.admin-brand {
  font-size: 14px;
  font-weight: 800;
  color: var(--dark-charcoal);
}

.admin-brand-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary-green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Nav Items */
.admin-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #64748b;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.admin-nav-item i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.admin-nav-item:hover {
  background-color: #f0fff4;
  color: var(--primary-green);
}

.admin-nav-item.active {
  background-color: #e8f5e9;
  color: var(--primary-green);
  font-weight: 700;
}

.admin-nav-item.active i {
  color: var(--primary-green);
}

/* Nav section label */
.admin-nav-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 14px 4px;
}

/* Sidebar Footer */
.admin-sidebar-footer {
  padding: 14px 10px;
  border-top: 1.5px solid #f0f4f8;
}

.admin-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  margin-bottom: 8px;
}

.admin-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-green), #096836);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 16px;
  flex-shrink: 0;
}

.admin-user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.admin-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark-charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-email {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  background: #fff5f5;
  color: #e53e3e;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-logout-btn:hover {
  background: #e53e3e;
  color: #ffffff;
}

/* Mobile sidebar overlay */
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 499;
  backdrop-filter: blur(2px);
}

.admin-sidebar-overlay.active {
  display: block;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.admin-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  background-color: #ffffff;
}

/* =============================================
   TOP BAR
   ============================================= */
.admin-topbar {
  height: 68px;
  background: #ffffff;
  border-bottom: 1.5px solid #edf2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

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

.admin-hamburger {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid #edf2f7;
  background: #ffffff;
  font-size: 16px;
  color: var(--dark-charcoal);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.admin-hamburger:hover {
  background: #f0fff4;
  border-color: var(--primary-green);
  color: var(--primary-green);
}

.admin-page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--dark-charcoal);
}

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

.admin-topbar-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid #edf2f7;
  background: #ffffff;
  font-size: 16px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

.admin-topbar-icon-btn:hover {
  background: #f0fff4;
  color: var(--primary-green);
}

.admin-topbar-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #f0fff4;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-green);
  border: 1.5px solid #c3e6cb;
}

/* =============================================
   CONTENT AREA
   ============================================= */
.admin-content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background-color: #ffffff;
}

/* =============================================
   SHARED PAGE COMPONENTS
   ============================================= */

/* Page header row */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-page-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark-charcoal);
}

.admin-page-sub {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

/* Primary Action Button */
.admin-btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: 12px;
  border: none;
  background: var(--primary-green);
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(11, 128, 67, 0.2);
  white-space: nowrap;
}

.admin-btn-primary:hover {
  background: #096836;
  transform: translateY(-1px);
}

.admin-btn-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1.5px solid #edf2f7;
  background: #ffffff;
  color: var(--dark-charcoal);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-btn-secondary:hover {
  border-color: var(--primary-green);
  color: var(--primary-green);
}

.admin-btn-danger {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1.5px solid #ffd0d0;
  background: #fff5f5;
  color: #e53e3e;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-btn-danger:hover { background: #e53e3e; color: #fff; }

.admin-btn-edit {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1.5px solid #bee3f8;
  background: #ebf8ff;
  color: #2b6cb0;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-btn-edit:hover { background: #2b6cb0; color: #fff; }

/* Card */
.admin-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1.5px solid #edf2f7;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  padding: 20px;
}

/* =============================================
   MODAL
   ============================================= */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1.5px solid #edf2f7;
}

.admin-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark-charcoal);
}

.admin-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid #edf2f7;
  background: #f8fafc;
  font-size: 16px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.admin-modal-close:hover { background: #e53e3e; color: #fff; border-color: #e53e3e; }

.admin-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.admin-modal-footer {
  padding: 16px 24px;
  border-top: 1.5px solid #edf2f7;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Form controls inside modal */
.admin-form-group {
  margin-bottom: 16px;
}

.admin-form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.admin-form-input,
.admin-form-select,
.admin-form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--dark-charcoal);
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.admin-form-input:focus,
.admin-form-select:focus,
.admin-form-textarea:focus {
  border-color: var(--primary-green);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(11, 128, 67, 0.1);
}

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

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

/* Dynamic list items (features, images) */
.admin-dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-dynamic-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-dynamic-item input {
  flex: 1;
}

.admin-dynamic-remove {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid #ffd0d0;
  background: #fff5f5;
  color: #e53e3e;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.admin-dynamic-remove:hover { background: #e53e3e; color: #fff; }

.admin-add-field-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px dashed #c3e6cb;
  background: transparent;
  color: var(--primary-green);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-add-field-btn:hover { background: #f0fff4; }

.admin-file-input {
  display: none;
}

.admin-upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 132px;
  padding: 18px;
  border: 1.5px dashed #c3e6cb;
  border-radius: 14px;
  background: #f8fff9;
  color: var(--primary-green);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.admin-upload-dropzone:hover {
  border-color: var(--primary-green);
  background: #f0fff4;
}

.admin-upload-dropzone-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.admin-upload-dropzone-sub {
  font-size: 12px;
  color: #64748b;
}

/* Image preview grid */
.admin-image-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.admin-image-manager-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.admin-img-preview {
  aspect-ratio: 16/10;
  border-radius: 10px;
  object-fit: cover;
  border: 1.5px solid #edf2f7;
  background: #f8fafc;
  width: 100%;
}

.admin-image-preview-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1.5px solid #edf2f7;
  border-radius: 14px;
  background: #ffffff;
  min-width: 0;
}

.admin-image-preview-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-image-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.admin-image-preview-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--dark-charcoal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-image-preview-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0fff4;
  border: 1px solid #c3e6cb;
  color: var(--primary-green);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-image-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  padding: 16px;
  border: 1.5px dashed #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  color: #94a3b8;
  text-align: center;
}

.admin-image-empty-state i {
  font-size: 24px;
}

/* =============================================
   RESPONSIVE — MOBILE
   ============================================= */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    width: 260px;
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .admin-hamburger {
    display: flex;
  }

  .admin-topbar {
    padding: 0 16px;
  }

  .admin-content-area {
    padding: 16px;
  }

  .admin-form-row {
    grid-template-columns: 1fr;
  }

  .admin-modal {
    max-height: 95vh;
    border-radius: 16px;
  }

  .admin-image-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
