/* ============================================================
   ADMIN PANEL STYLES
   ============================================================ */

.admin-body {
  background: #F0F2F5;
  display: flex;
  min-height: 100vh;
  font-family: var(--font-primary);
}

/* ========== ADMIN SIDEBAR ========== */
.admin-sidebar {
  width: 220px;
  background: var(--dark-800);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 900;
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.admin-sidebar-header {
  padding: 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-logo { display: flex; align-items: center; gap: 0.6rem; }
.admin-nav {
  flex: 1;
  padding: 0.5rem 0.75rem;
}
.admin-nav-section {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.25);
  padding: 1rem 0.6rem 0.3rem;
  margin-top: 0.25rem;
}
.anav {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 1px;
  position: relative;
}
.anav:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}
.anav.active {
  background: var(--green-800);
  color: white;
  font-weight: 700;
}
.anav-badge {
  margin-left: auto;
  background: #e53935;
  color: white;
  padding: 2px 7px;
  border-radius: var(--r-full);
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 20px;
  text-align: center;
}
.anav-badge-gold { background: var(--gold-500) !important; color: var(--dark-900) !important; }

/* ========== ADMIN MAIN ========== */
.admin-main {
  margin-left: 220px;
  flex: 1;
  min-height: 100vh;
}
.admin-topbar {
  background: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 800;
}
.admin-topbar-right { display: flex; align-items: center; gap: 1rem; }
.admin-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}
.admin-user-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green-500);
}
.admin-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ========== KPI CARDS ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.kpi-card {
  background: white;
  border-radius: var(--r-xl);
  padding: 1.3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-icon {
  width: 52px; height: 52px;
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  color: white;
}
.kpi-label { font-size: 0.75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 3px; }
.kpi-val { font-size: 1.5rem; font-weight: 800; color: var(--dark-900); line-height: 1; margin-bottom: 3px; }
.kpi-change { font-size: 0.75rem; font-weight: 600; }
.kpi-change.positive { color: var(--green-600); }
.kpi-change.negative { color: #e53935; }

/* ========== ADMIN CARDS ========== */
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.admin-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
.admin-card {
  background: white;
  border-radius: var(--r-xl);
  padding: 1.3rem;
  box-shadow: var(--shadow-sm);
}
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.admin-card-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--dark-900); }

/* ========== ORDER LIST ========== */
.admin-orders-list { display: flex; flex-direction: column; gap: 0.75rem; }
.aol-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.85rem;
  background: var(--gray-100);
  border-radius: var(--r-md);
  gap: 0.75rem;
  border: 1px solid var(--gray-200);
  transition: border-color 0.2s;
}
.aol-item:hover { border-color: var(--green-400); }
.aol-left { flex: 1; min-width: 0; }
.aol-id { font-size: 0.85rem; font-weight: 700; color: var(--dark-900); }
.aol-buyer { font-size: 0.78rem; color: var(--gray-500); margin-top: 2px; }
.aol-items { font-size: 0.78rem; color: var(--gray-600); margin-top: 4px; }
.aol-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.aol-amount { font-size: 0.85rem; font-weight: 700; color: var(--dark-900); }
.btn-mini {
  padding: 4px 10px;
  background: var(--green-700);
  color: white;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
  font-family: var(--font-primary);
  border: none;
  cursor: pointer;
}
.btn-mini:hover { background: var(--green-800); }
.btn-mini.urgent { background: var(--gold-500); color: var(--dark-900); }
.btn-mini.urgent:hover { background: var(--gold-600); }

/* ========== BUYER APPROVAL ========== */
.buyer-approval-list { display: flex; flex-direction: column; gap: 0.75rem; }
.bal-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--gray-100);
  border-radius: var(--r-md);
}
.bal-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--green-600), var(--green-800));
  border-radius: 50%;
  color: white;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bal-info { flex: 1; min-width: 0; }
.bal-name { font-size: 0.88rem; font-weight: 700; color: var(--dark-900); }
.bal-country { font-size: 0.75rem; color: var(--gray-500); }
.bal-date { font-size: 0.72rem; color: var(--gray-400); }
.bal-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.ba-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  transition: all 0.2s;
}
.ba-btn.approve { background: var(--green-100); color: var(--green-700); }
.ba-btn.approve:hover { background: var(--green-700); color: white; }
.ba-btn.reject { background: #FFEBEE; color: #c62828; }
.ba-btn.reject:hover { background: #c62828; color: white; }

/* ========== TOP PRODUCTS ========== */
.top-products-list { display: flex; flex-direction: column; gap: 0.55rem; }
.tpl-item { display: flex; align-items: center; gap: 0.6rem; }
.tpl-rank { width: 18px; text-align: center; font-size: 0.72rem; font-weight: 800; color: var(--gray-400); flex-shrink: 0; }
.tpl-emoji { font-size: 1.2rem; flex-shrink: 0; }
.tpl-info { flex: 1; min-width: 0; }
.tpl-name { font-size: 0.82rem; font-weight: 600; color: var(--dark-900); }
.tpl-val { font-size: 0.72rem; color: var(--gray-500); }
.tpl-bar { width: 80px; height: 6px; background: var(--gray-200); border-radius: 3px; flex-shrink: 0; }
.tpl-fill { height: 100%; background: linear-gradient(90deg, var(--green-500), var(--green-700)); border-radius: 3px; }

/* ========== MINI CHART ========== */
.mini-chart { padding: 0 0.5rem; }
.mc-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 130px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--gray-200);
}
.mc-bar {
  flex: 1;
  background: var(--green-200, #C8E6C9);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
  min-height: 8px;
}
.mc-bar:hover { background: var(--green-500); }
.mc-bar.current { background: linear-gradient(180deg, var(--green-500), var(--green-800)); }
.mc-bar-val {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gray-600);
  white-space: nowrap;
}
.mc-bar.current .mc-bar-val { color: var(--green-700); }
.mc-labels {
  display: flex;
  gap: 0.5rem;
  padding-top: 6px;
}
.mc-label {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  color: var(--gray-500);
  font-weight: 600;
}

/* ========== ADMIN ORDERS PAGE ========== */
.admin-table-wrap {
  background: white;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.admin-table-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: white;
}
.admin-table-header h3 { font-size: 1rem; font-weight: 700; color: var(--dark-900); }
.admin-table-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-table-search input {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--r-full);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  width: 220px;
}
.admin-table-search input:focus { border-color: var(--green-500); outline: none; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  background: var(--gray-100);
  padding: 0.8rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-600);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.admin-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.85rem;
  color: var(--gray-700);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-50, #FAFAFA); }
.td-id { font-weight: 700; color: var(--dark-900); }
.td-actions { display: flex; gap: 0.4rem; align-items: center; }

/* QUOTE FORM */
.quote-form-inline {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: var(--r-md);
  padding: 1rem;
  margin-top: 0.5rem;
  display: none;
}
.quote-form-inline.open { display: block; }
.quote-form-inline .form-row { gap: 0.5rem; margin-bottom: 0.5rem; }
.quote-form-inline input {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--green-200, #A5D6A7);
  border-radius: var(--r-sm);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  width: 100%;
}

/* ========== PRODUCTS PAGE ========== */
.prod-grid-admin {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.prod-admin-card {
  background: white;
  border-radius: var(--r-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all 0.2s;
}
.prod-admin-card:hover { border-color: var(--green-400); }
.pac-emoji { font-size: 2.2rem; text-align: center; margin-bottom: 0.5rem; }
.pac-name { font-size: 0.9rem; font-weight: 700; color: var(--dark-900); margin-bottom: 4px; }
.pac-cat { font-size: 0.72rem; color: var(--green-600); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; margin-bottom: 6px; }
.pac-meta { font-size: 0.78rem; color: var(--gray-500); }
.pac-actions { display: flex; gap: 0.4rem; margin-top: 0.75rem; }
.pac-btn {
  flex: 1;
  padding: 0.35rem 0;
  border: none;
  border-radius: var(--r-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-primary);
  transition: all 0.2s;
}
.pac-btn.edit { background: var(--gray-100); color: var(--gray-700); }
.pac-btn.edit:hover { background: var(--gray-200); }
.pac-btn.del { background: #FFEBEE; color: #c62828; }
.pac-btn.del:hover { background: #c62828; color: white; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid-3 { grid-template-columns: 1fr 1fr; }
  .prod-grid-admin { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-grid-3 { grid-template-columns: 1fr; }
  .prod-grid-admin { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .prod-grid-admin { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 1rem; }
}
