
/* ──────────── STAT CARDS ──────────── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--sh-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-card-hover);
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover::after { opacity: 1; }

.stat-card-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.stat-card-icon .lucide { width: 19px; height: 19px; }
.stat-card-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-card-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.stat-card-icon.green { background: var(--success-bg); color: var(--success); }
.stat-card-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-card-icon.purple { background: var(--purple-bg); color: var(--purple); }

.stat-card:has(.stat-card-icon.blue)::after { background: var(--info); }
.stat-card:has(.stat-card-icon.yellow)::after { background: var(--brand); }
.stat-card:has(.stat-card-icon.green)::after { background: var(--success); }
.stat-card:has(.stat-card-icon.red)::after { background: var(--danger); }
.stat-card:has(.stat-card-icon.purple)::after { background: var(--purple); }

.stat-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-card-value {
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 2px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
}

/* ──────────── DASHBOARD PRIMARY KPIs ──────────── */
.dash-stats-primary {
  grid-template-columns: repeat(4, 1fr) !important;
}

/* ──────────── DASHBOARD OVERVIEW ──────────── */
.dash-overview {
  padding: 0 !important;
}
.dash-overview-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}
.dash-overview-header .lucide {
  width: 16px; height: 16px;
  color: var(--text-tertiary);
}
.dash-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.dash-overview-group {
  padding: 16px 22px 14px;
  border-right: 1px solid var(--border-subtle);
}
.dash-overview-group:last-child { border-right: none; }
.dash-overview-group-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-overview-group-title .lucide { width: 12px; height: 12px; }
.dash-overview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  margin: 0 -12px;
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.dash-overview-item:hover {
  background: var(--bg-input);
  box-shadow: inset 2px 0 0 var(--brand);
}
.dash-ov-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.dash-overview-item:hover .dash-ov-label { color: var(--text-primary); }
.dash-ov-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--mono);
  letter-spacing: -0.02em;
  min-width: 44px;
  text-align: right;
}
.dash-ov-value.green { color: var(--success); }
.dash-ov-value.warn { color: var(--warning); }
.dash-ov-value.alert { color: var(--danger); }

/* ──────────── PANELS ──────────── */
.admin-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  overflow: hidden;
  margin-bottom: 20px;
}
.admin-panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.admin-panel-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.admin-panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-card);
}
.admin-panel-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ──────────── TOOLBAR ──────────── */
.admin-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-search {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 12px;
  gap: 7px;
  background: var(--bg-input);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.admin-search .lucide { width: 15px; height: 15px; color: var(--text-tertiary); flex-shrink: 0; }
.admin-search input {
  border: none;
  outline: none;
  padding: 10px 0;
  font-size: 0.85rem;
  font-family: var(--font);
  width: 200px;
  background: transparent;
  color: var(--text-primary);
}
.admin-search input::placeholder { color: var(--text-tertiary); }

.admin-filter {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-family: var(--font);
  background: var(--bg-input);
  cursor: pointer;
  color: var(--text-primary);
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b90a0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.admin-filter:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-glow);
}

/* ──────────── BUTTONS ──────────── */
.admin-btn {
  padding: 9px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
  background: var(--bg-card);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
}
.admin-btn:hover {
  background: var(--bg-input);
  border-color: var(--text-tertiary);
}
.admin-btn:active { transform: scale(0.98); }
.admin-btn .lucide { width: 15px; height: 15px; }

.admin-btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(240, 180, 41, 0.2);
}
.admin-btn-primary:hover {
  background: var(--brand-dim);
  border-color: var(--brand-dim);
  box-shadow: 0 2px 8px rgba(240, 180, 41, 0.3);
}
.admin-btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 1px 2px rgba(240, 180, 41, 0.2);
}

.admin-btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: transparent;
}
.admin-btn-danger:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.admin-btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--r-xs);
}

/* ──────────── TABLES ──────────── */
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  padding: 13px 20px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  background: var(--bg-card);
  position: sticky;
  top: 0;
}
.admin-table td {
  padding: 14px 20px;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-primary);
}
.admin-table tbody tr {
  transition: background 0.12s;
}
.admin-table tbody tr:nth-child(even) td {
  background: rgba(0,0,0,0.012);
}
.admin-table tbody tr:hover td {
  background: rgba(240, 180, 41, 0.04);
}
.admin-table tbody tr:last-child td {
  border-bottom: none;
}
.admin-table .name-cell {
  font-weight: 600;
  color: var(--text-primary);
}

/* ──────────── BADGES ──────────── */
.role-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1.4;
}
.role-badge.customer { background: #f0f1f3; color: #4b5563; }
.role-badge.b2b { background: var(--info-bg); color: #1d4ed8; }
.role-badge.reseller { background: var(--purple-bg); color: var(--purple); }
.role-badge.staff { background: var(--warning-bg); color: #b45309; }
.role-badge.admin { background: var(--danger-bg); color: var(--danger); }

.status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.status-badge.active { background: var(--success-bg); color: var(--success); }
.status-badge.inactive { background: var(--danger-bg); color: var(--danger); }
.status-badge.pending { background: var(--warning-bg); color: #b45309; }
.status-badge.confirmed { background: var(--success-bg); color: var(--success); }
.status-badge.processing { background: var(--info-bg); color: var(--info); }
.status-badge.shipped { background: var(--purple-bg); color: var(--purple); }
.status-badge.delivered { background: var(--success-bg); color: var(--success); }
.status-badge.cancelled { background: var(--danger-bg); color: var(--danger); }
.status-badge.approved { background: var(--success-bg); color: var(--success); }
.status-badge.rejected { background: var(--danger-bg); color: var(--danger); }
.status-badge.completed { background: var(--info-bg); color: var(--info); }

/* ──────────── PAGINATION ──────────── */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
}
.admin-pagination button {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--bg-card);
  font-size: 0.82rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  color: var(--text-secondary);
  -webkit-tap-highlight-color: transparent;
  min-width: 38px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-pagination button:hover:not(:disabled):not(.active) {
  background: var(--bg-input);
  border-color: var(--text-tertiary);
}
.admin-pagination button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
}
.admin-pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

