/* ==========================================================================
   Swapno Importer — Admin Panel Layout & Controls
   World-Class Dark Sidebar | Emerald Accents | Metric Cards | Clipboard Uploader
   ========================================================================== */

body.admin-body, .admin-body {
  background-color: #F8FAFC !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: row !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  width: 100% !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1E293B;
}

/* Admin Sidebar */
.admin-sidebar {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  background: var(--dark, #030712);
  color: #94A3B8;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s ease;
}

.admin-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-nav {
  list-style: none;
  padding: 1rem 0;
  flex-grow: 1;
}

.admin-nav-item {
  margin-bottom: 2px;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.5rem;
  color: #94A3B8;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.22s ease;
  min-height: 44px;
  text-decoration: none;
}

.admin-nav-link:hover, .admin-nav-link.active {
  background: rgba(5, 150, 105, 0.15);
  color: #FFF;
  border-left: 4px solid var(--primary, #059669);
  padding-left: calc(1.5rem - 1px);
}

.admin-nav-badge {
  margin-left: auto;
  background: linear-gradient(135deg, var(--primary, #059669), var(--secondary, #0D9488));
  color: #FFF;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
}

.admin-user-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

/* Admin Main Content Wrapper */
.admin-main-wrap {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background-color: #F8FAFC;
  width: calc(100% - 260px);
}

.admin-topbar {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border, #E2E8F0);
  height: 64px;
  min-height: 64px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 12px rgba(5, 150, 105, 0.05);
}

.admin-content {
  padding: 1.5rem;
  flex-grow: 1;
  width: 100%;
}

/* Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: #FFFFFF;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.2;
}

.metric-sub {
  font-size: 0.75rem;
  color: #94A3B8;
  margin-top: 0.5rem;
}

/* Metric card color accents */
.metric-bdt    { border-top: 4px solid var(--primary, #059669); }
.metric-usd    { border-top: 4px solid #0284C7; }
.metric-orders { border-top: 4px solid var(--accent, #F59E0B); }
.metric-alert  { border-top: 4px solid var(--danger, #EF4444); }

/* Panels */
.panel {
  background: #FFFFFF;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Admin Data Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.admin-table th {
  background: #F8FAFC;
  color: #475569;
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border, #E2E8F0);
  white-space: nowrap;
  font-size: 0.8rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  font-size: 0.875rem;
  color: #334155;
}

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

/* Action button group */
.action-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-info { background: #E0F2FE; color: #0369A1; }
.badge-success { background: #DCFCE7; color: #166534; }
.badge-danger { background: #FEE2E2; color: #991B1B; }

/* Alerts */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ==========================================================================
   Clipboard Image Upload & Dropzone System
   ========================================================================== */

.clipboard-dropzone {
  position: relative;
  border: 2px dashed #CBD5E1;
  border-radius: 12px;
  background: #F8FAFC;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  user-select: none;
  margin-top: 0.4rem;
}

.clipboard-dropzone:hover,
.clipboard-dropzone:focus,
.clipboard-dropzone.dragover {
  border-color: var(--primary, #059669);
  background: #ECFDF5;
}

.clipboard-dropzone.active-target {
  border-color: var(--primary, #059669);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15);
  background: #F0FDF8;
}

.dropzone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.dropzone-icon {
  font-size: 1.85rem;
  line-height: 1;
}

.dropzone-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1E293B;
}

.dropzone-sub {
  font-size: 0.76rem;
  color: #64748B;
}

.dropzone-sub kbd {
  background: #E2E8F0;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0F172A;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.dropzone-preview {
  display: none;
  align-items: center;
  gap: 1rem;
  text-align: left;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.dropzone-preview.has-image {
  display: flex;
}

.dropzone-preview-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #E2E8F0;
  flex-shrink: 0;
  background: #F1F5F9;
}

.dropzone-preview-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dropzone-preview-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropzone-preview-size {
  font-size: 0.74rem;
  color: #64748B;
}

.dropzone-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #DCFCE7;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  width: fit-content;
}

.dropzone-remove-btn {
  background: #FEE2E2;
  color: #DC2626;
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.dropzone-remove-btn:hover {
  background: #DC2626;
  color: #FFFFFF;
}

/* Gallery Paste Grid */
.gallery-paste-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.gallery-paste-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #CBD5E1;
  aspect-ratio: 1;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.gallery-paste-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-paste-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(15, 23, 42, 0.75);
  color: #FFF;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.15s ease;
}

.gallery-paste-remove:hover {
  background: #EF4444;
}

/* Global Floating Notification Toast */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  transform: translateY(30px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid var(--primary, #059669);
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

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

#adminSidebarToggle {
  display: none;
}

@media (max-width: 900px) {
  #adminSidebarToggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  body.admin-body, .admin-body {
    flex-direction: column !important;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
  }

  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0,0,0,0.6);
  }

  .admin-main-wrap {
    width: 100% !important;
  }
}

@media (max-width: 600px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .admin-content {
    padding: 1rem;
  }
}
