/* ==========================================================================
   Melatei - Admin Portal Stylesheet
   Modern, sleek, and intuitive administration interface
   ========================================================================== */

:root {
  --admin-bg: #f8faf9;
  --admin-card: #ffffff;
  --admin-sidebar: #122a1e;
  --admin-sidebar-text: #e0e7e3;
  --admin-forest: #1b3d2b;
  --admin-forest-light: #28553d;
  --admin-forest-glow: rgba(27, 61, 43, 0.08);
  --admin-border: #e2e8e4;
  --admin-text: #1a2720;
  --admin-muted: #62746b;
  --admin-danger: #d93829;
  --admin-success: #1a8747;
  --admin-warning: #d97706;
}

body.admin-body {
  background-color: var(--admin-bg);
  color: var(--admin-text);
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  margin: 0;
  min-height: 100vh;
}

/* Login Screen */
.admin-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, #edf3ef 0%, #ffffff 80%);
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 16px 40px rgba(18, 42, 30, 0.08);
  text-align: center;
}

.login-logo {
  height: 60px;
  margin: 0 auto 20px;
}

.login-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--admin-forest);
  margin-bottom: 8px;
}

.login-card p {
  font-size: 14px;
  color: var(--admin-muted);
  margin-bottom: 24px;
}

/* Admin Dashboard Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar);
  color: var(--admin-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.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 {
  height: 40px;
  background: #ffffff;
  padding: 4px 6px;
  border-radius: 6px;
}

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

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #c2d1c8;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-btn.active {
  background: var(--admin-forest-light);
  color: #ffffff;
}

.sidebar-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #e57373;
  width: 100%;
}

/* Admin Main Content */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-title h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--admin-forest);
}

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

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

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-muted);
  margin-bottom: 8px;
}

.stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--admin-forest);
}

/* Admin Table */
.admin-table-container {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

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

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

.admin-table th {
  background: #fbfcfb;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-muted);
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 16px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

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

.table-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--admin-border);
}

.pill-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pill-badge.organic {
  background: #edf6ef;
  color: #1b7a42;
}

.pill-badge.men {
  background: #edf3f7;
  color: #2b5c7a;
}

.pill-badge.women {
  background: #f9eff2;
  color: #8c3258;
}

.pill-badge.accessories {
  background: #f8f4ec;
  color: #926f21;
}

.pill-badge.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.pill-badge.status-shipped {
  background: #e0f2fe;
  color: #0369a1;
}

.pill-badge.status-delivered {
  background: #dcfce7;
  color: #15803d;
}

/* Image Upload Dropzone */
.image-upload-dropzone {
  border: 2px dashed var(--admin-border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  background: #fafbfa;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 6px;
}

.image-upload-dropzone:hover,
.image-upload-dropzone.dragover {
  border-color: var(--admin-forest);
  background: #edf5f0;
}

.upload-preview-wrap {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.upload-preview-img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--admin-border);
}

/* Modals */
.admin-modal-card {
  max-width: 680px;
}

@media (max-width: 900px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
