/* ==========================================================================
   iHolic - Admin Panel Dashboard Stylesheet
   Modern, Sleek, Clean Management Interface
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@600;700;800&display=swap');

:root {
  --admin-bg: #f8fafc;
  --admin-card: #ffffff;
  --admin-sidebar: #0f172a;
  --admin-sidebar-text: #94a3b8;
  --admin-sidebar-active: #ffffff;
  --admin-primary: #0071e3;
  --admin-border: #e2e8f0;
  --admin-text-main: #0f172a;
  --admin-text-muted: #64748b;
  --admin-radius: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background-color: var(--admin-sidebar);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

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

.admin-sidebar-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}

.admin-sidebar-header h2 span {
  color: var(--admin-primary);
}

.admin-nav {
  padding: 24px 16px;
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--admin-sidebar-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.admin-nav-item a:hover, .admin-nav-item.active a {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--admin-sidebar-active);
}

.admin-nav-item.active a {
  background-color: var(--admin-primary);
}

.admin-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

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

/* Main Layout */
.admin-main {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.admin-topbar-title {
  font-size: 20px;
  font-weight: 800;
}

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

.admin-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Page Content */
.admin-content {
  padding: 32px;
  flex: 1;
}

/* Metric Cards */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.metric-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--admin-text-main);
  margin-bottom: 4px;
}

.metric-sub {
  font-size: 12px;
  color: #10b981;
  font-weight: 600;
}

/* Admin Card Container */
.admin-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 32px;
}

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

.admin-card-title {
  font-size: 18px;
  font-weight: 800;
}

/* Admin Tables */
.admin-table-wrap {
  overflow-x: auto;
}

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

.admin-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  border-bottom: 1.5px solid var(--admin-border);
  background: #f8fafc;
}

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

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

.product-row-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: contain;
  background: #f1f5f9;
  padding: 4px;
}

/* Status Badges */
.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
}

.status-confirmed, .status-paid {
  background: #ecfdf5;
  color: #065f46;
}

.status-pending {
  background: #fffbeb;
  color: #92400e;
}

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

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

.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

/* Buttons in Admin */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-admin-primary {
  background: var(--admin-primary);
  color: #ffffff;
}

.btn-admin-primary:hover {
  background: #0060c4;
}

.btn-admin-danger {
  background: #fee2e2;
  color: #ef4444;
}

.btn-admin-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-admin-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Media Upload Boxes */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 12px;
  margin-bottom: 24px;
}

.upload-box {
  border: 2px dashed var(--admin-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  background: #f8fafc;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.upload-box:hover {
  border-color: var(--admin-primary);
  background: #ffffff;
}

.upload-box input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-preview {
  max-width: 100%;
  max-height: 120px;
  border-radius: 8px;
  object-fit: contain;
  margin-bottom: 8px;
  display: none;
}

.upload-box.has-file .upload-preview {
  display: block;
}

.upload-box.has-file .upload-placeholder {
  display: none;
}

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

@media (max-width: 768px) {
  .admin-sidebar {
    display: none;
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-metrics-grid {
    grid-template-columns: 1fr;
  }
  .upload-grid {
    grid-template-columns: 1fr;
  }
}
